I have a problem and I don't really know how to implement it in OZ: Suppose that you are given an arithmetic expression described by a tree constructed from tuples as follows:
- An integer is described by a tuple int(N), where N is an integer.
- An addition is described by a tuple add(X Y), where both X and Y are arithmetic expressions.
- A multiplication is described by a tuple mul(X Y), where both X and Y are arithmetic expressions.
Implement a function Eval that takes an arithmetic expression and returns its value.
For example, add(int(1) mul(int(3) int(4)))
is an arithmetic expression and its evaluation returns 13.