### Future Extensions

Now that the functions of the Semantica package have been introduced and illustrated, and the construction techniques behind the package have been sketched, we can turn our attention to the future possibilities with a critical eye.

First, some obvious shortcomings of Semantica should be noted. Often it is possible to set up equations that look perfectly reasonable but are insolvable. This means Semantica can lull one into a false sense of ease. For instance, consider the following simple pricing formula from finance, that of a bond of par value paying interest with a time to maturity of n.

It would be nice to be able to calculate the implied interest rate given the value of a bond.

Even though this is conceptually a reasonable thing to do, there is no closed form solution for in terms of , , and n. It would be desirable for Semantica to give more warning when it is not possible to solve the underlying system of equations. Furthermore, since this is easily numerically solvable, it might be nice if Semantica switched to a numerical model when , , and n were numerically specified. This does not happen, although this feature could be added.

More importantly, the issue of assumptions and how Semantica deals with them should be addressed. Mathematica has no uniform support for assumptions outside simplification and integration. Let us examine how we would modify Semantica if and when such support becomes available.

Let us revisit the previous example for `foo`.

If an assumptions mechanism were present, it would be desirable to allow the user to ask and receive answers to questions like "Assuming `a<0` and , what is `foo[z]`?" To answer this, let us re-examine the underlying rules that Semantica generates for `foo.`

Examining the rather complicated equations above we can see that there are three solutions if `0<a<1` but only one solution if `a<0`. Internally we can work out the answers on each of these branches by introducing the final left hand side as a variable, say , in an equation, in this case , then solve for while eliminating and . Finally, we include the conditions on the other variables to get the solutions and their regions of validity.

In this way we can see that we have found solutions where the conditions on the solutions are only dependent on the semantic variables, in this case `a` and `b`, and the matched input . We did not have to use any of the pattern matching symbols, which in this case are and . If we had a general assumptions mechanism, it would be a simple matter to determine which branches of the solution structure satisfy the assumptions and then return the appropriate solutions. As one can see, the form of the solution is also nicer than the rules generated by Semantica.

Implementing a general routine that incorporates this behavior is sometimes possible, as has been demonstrated. It is fairly easy to imagine generalizations of the above. However, there are some obvious consequences. Due to the diverse nature of the structure of the solution set, one has to be much more careful in the implementation. Also, the experimental implementation of cylindrical algebraic decomposition found in Mathematica 4 only works for polynomial systems at the time of the writing of this article. At present Mathematica does not have a more generalized assumptions mechanism, so it does not help to simplify the conditions to a set which only involves the semantic variables. One cannot use them for deductions involving assumptions in any case. Future versions of Semantica may incorporate more advanced rule generation. Because of the above reasons, this version of Semantica does not make use of the experimental cylindrical algebraic decomposition algorithm found in Mathematica 4.

Converted by Mathematica      September 30, 1999

[Prev Page][Next Page]