[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Expression problems
From: |
Hans Peter Würmli |
Subject: |
[Axiom-developer] Expression problems |
Date: |
Sun, 6 Nov 2005 22:19:33 +0100 |
User-agent: |
KMail/1.7.2 |
I am struggling with dealing with Expressions. For most sake and purposes I
can find a fix and solve my small problems, but I never feel very assured.
Maybe you can give me some pointers. The question that I originally would have
liked to ask was: is there a "parse tree" object available for elements of
type, say, Expression(Integer).
As there doesn't seem to exist a parse tree object, I should ask a different
question: how are you analysing an Expression?
While browsing through the documentation I found many functions that could be
usable for parsing, but I wasn't very lucky in using them.
For example, there is a function
isMult(p)
which is supposed to return [n,x] if p=n*x if n<>0.
For a Symbol x and an Integer n
isMult(n*x) returns [n,x],
but for another Symbol y
isMult(y*x) returns "failed".
Not exactly analoguously
isPower(x**y) returns [x**y,1], whereas
isPower(x**10) returns [x,10].
isExpt behaves like isPower, where isTimes differs from isMult and returns all
factors of a product, i.e.
isTimes(x*y*z)=[x,y,z].
Whereas
isPlus((x+y+z*y) returns [y z,y,x]
isTimes((x+y)*z) returns "failed" instead of the exp.
Somehow I don't understand the inner logic of these operations.
Any hints for how to proceed are greatly welcome.
Hans Peter
- [Axiom-developer] Expression problems,
Hans Peter Würmli <=
- RE: [Axiom-developer] Expression problems, Bill Page, 2005/11/06
- Re: [Axiom-developer] Expression problems, Francois Maltey, 2005/11/07
- Re: [Axiom-developer] Expression problems, Martin Rubey, 2005/11/13
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- [Axiom-developer] Problems compiling modified Spad file under debian, Martin Rubey, 2005/11/23
- [Axiom-developer] Re: Problems compiling modified Spad file under debian, Francois Maltey, 2005/11/23
- RE: [Axiom-developer] Re: Problems compiling modified Spad file underdebian, Bill Page, 2005/11/23
- Re: [Axiom-developer] Re: Problems compiling modified Spad file underdebian, Camm Maguire, 2005/11/23
- Re: [Axiom-developer] Re: Problems compiling modified Spad file underdebian, Francois Maltey, 2005/11/24
- Re: [Axiom-developer] Re: Problems compiling modified Spad file underdebian, Camm Maguire, 2005/11/25
- Message not available
- Re: [Axiom-developer] Re: Problems compiling modified Spad file underdebian, Camm Maguire, 2005/11/25