[Aldor-l] Functions and Expression trees
Christian Aistleitner
tmgisi at gmx.at
Sat May 6 01:36:26 EDT 2006
Hello,
> my current work involves converting aldor objects to and from OpenMath
> format, via. the ExpressionTree type (from the algebra lib.). I'm a bit
> stuck when it comes to function objects, I don't seem to be able to get a
> handle on anything, the signatures of the functions or the body of the
> function.
>
> It would be really nice to have an extree(f) function [...]
I am not convinced that I understood, what you are looking for, but I
assume, you want a function extree, such that extree(f) with
f( a: Integer, b: Integer ) == { a + 4*b + a*b; }
gives you the expression tree
( + a ( * 4 b ) ( * a b ) )
.
Honestly, I do not know of a way to do this. And I do not think, there is
a way to implement such a function. Such a function would require that the
Aldor code would know by itself, what it is doing.
However, there may be two starting points to look for information:
- Aldor's Trace package allows to print the name of a domain (including
its parameters).
- Given the identifier f of the previously defined function, it is
possible to obtain a pointer to a string "f" -- with a lot of trickery,
debugging turned on and assuming, you are allowed to call the function to
get its name. I could detail on that, if it would be helpful for you.
--
Kind regards,
Christian
More information about the Aldor-l
mailing list