login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for FriCASInterpreter revision 2 of 5

1 2 3 4 5
Editor: page
Time: 2013/04/28 17:54:36 GMT+0
Note:

changed:
-The Axiom interpreter is the part of Axiom responsible for handling
The FriCAS interpreter is the part of FriCAS responsible for handling

added:
For people interested in technical details: what documentation
usually calls "interpreter" actually has two parts.  One is
classical intepreter that evaluates user expression.  But
there is other part which compiles user functions.
For function to be compiled it must pass type checks
(otherwise "interpreter" will fall back to real interpretation).


The FriCAS? interpreter is the part of FriCAS? responsible for handling user input during an interactive session.

The interpreter parses the user's input expression to create an expression tree, then does a bottom-up evaluation of the tree. Each subtree encountered that is not a value consists of a root node denoting an operation name and one or more leaf nodes denoting operands. The interpreter resolves type mismatches and uses type-inferencing and a library database to determine appropriate types for the operands and the result, and the operation to be performed.

The interpreter determines the domain in which to perform the indicated operation, and invokes a function from the domain to compute a value. The subtree is then replaced by that value and the process continues. Once the entire tree has been processed, the value replacing the top node of the tree is displayed back to the user as the value of the expression.

Input to the interpreter may be read from a file using the command:

  )read filename.input

For people interested in technical details: what documentation usually calls "interpreter" actually has two parts. One is classical intepreter that evaluates user expression. But there is other part which compiles user functions. For function to be compiled it must pass type checks (otherwise "interpreter" will fall back to real interpretation).