Hello Bill,
Yes, that is a good idea if you desire to solve the general
problem of defining a domain in which contains all possible
expressions as members. Perhaps this is the kind of "userdomain"
that Jenks and Trager had in mind in the design of BNatural.
http://wiki.axiom-developer.org/BNatural
How would this differ from Aldor's ExpressionTree domain?
Ehm...
If I were to program BNatural, I would certainly consider to take
ExpressionTree from libalgebra. Well that domain is not yet rich enough,
but it is in some way an approach to forget about types. In libalgebra
most domains are of type ExpressionType and Parsable.
define ExpressionType: Category == Join(OutputType, PrimitiveType) with {
extree: % -> ExpressionTree;
...
}
define Parsable: Category == InputType with {
eval: TREE -> Partial %;
eval: LEAF -> Partial %;
eval: (MachineInteger, List TREE) -> Partial %;
}
where TREE==>ExpressionTree, LEAF==>ExpressionTreeLeaf.
So one basically has a coercion from and to ExpressionTree.
But I am not so sure whether one should extend ExpressionTree properly
with any operation you could imagine or rather use some syntax parsing
code of the Aldor compiler itself. Look at the output of
aldor -fasy foo.as
for some arbitrary program foo.as. One basically has to extract
"mathematical" expressions and do something reasonable with them. Yes,
maybe wrap them with something like ExpressionTree.
To be honest, I haven't really thought about that, because I am lacking
some expertise here.
Ralf
_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer