|
From: | Ralf Hemmecke |
Subject: | Re: [Axiom-developer] Re: Defining piece-wise functions and drawing, integrating, ... |
Date: | Mon, 04 Jun 2007 10:35:39 +0200 |
User-agent: | Thunderbird 2.0.0.0 (X11/20070326) |
Yep. I like to see a true expression domain. Axiom's Expression(..) is rather special. It covers a lot, but itsThen 'x<0' can be treated as an expression of type Expression Integer just like 'sin(x)'. Or more generally we need a domain of predicate expressions which can interact with other domains like Expression.inhabitants are not expression trees. They are rational functions.
That is true but I think that there is a good reason for this - part of the "Axiom philosophy". The mathematical domains that we define should always be as "algebraic" as possible.
Oh, I never said, that the current Expression(...) should be removed. If I see what people do here at RISC with symbolic summation, that domain fits very well in that area. Still, Axiom lacks a true ExpressionTree domain. Or have I just not found it?
Well, what I would dream of is an expression domain (or several of them) that lets you define a general expressionIf we had a domain for predicate expressions then it would not be difficult to introduce an expression in Expression of the form: piecewise(Cond:Expression Boolean, Then:Expression Integer, Else:Expression Integer):Expression Integertree where you would have control over what is allowed as nodes. Maybe it would be interesting to be able to give agrammar G and MyExpression(G) would then describe the language generated by G. It would be nice to be able to encode the Aldor language in that way.
For Axiom this does not seem sufficiently "algebraic" to me.
Then remove the "Set" domain. Why must everything be "algebraic". Actually, you could probably turn an ExpressionTree into some form of universal algebra (just leave the set of operations empty).
Axiom does not like to work with things like "general expression trees", or rather it does already very nearly have such things, e.g. SExpression, but they are considered rather low-level compared to the usual mathematical objects with which one is expected to work.
Oh, maybe SExpression is near to what I want. But is somehow sounds to LISPish for me. ;-) Anyway, I think it would be a good thing to have a very general expression domain (maybe like SExpression) and yet others that only allow certain expression trees that correspond to a grammar.
You all probably know that everything in Maple is an expression also "if a then b else c fi" and that one cancompute with these things. (Yes, yes, looks again like the Maple language is nothing but Lisp with another syntax. ;-) ).
I think it is quite deliberate that Axiom is different from Maple in this regard.
Hmm, still, I guess for BNatural we need something like that + a connection to the compiler do actually turn the expression into a running program.
Aldor's LibAlgebra defines a domain ExpressionTree. But that is certainly not yet perfect.
I think of this as a more sophisticated replacement for SExpression.
Maybe. But it is written in Aldor and does not rely on an underlying LISP. Ralf
[Prev in Thread] | Current Thread | [Next in Thread] |