Saturday, November 5, 2011

Handling complex variable expressions in the ontology engine

once again I seek ways to reducethe code in the engine.  What about a coplex expression?

k1.((a+b) * (4 - g) +8).k2
First, notice I have an operator conflict right away, the asterisk suddenly because a multiplier! But will the engine handle this? Sure, but it will confolve it with the synta analyzer:

k1.convolve((a+b) * (4 - g) +8),SyntaxAnalysis).k2

Syntax analyzer is a G in the world of Gs that can decompose the complex into a nested graph, resolve and expand the computation and return a result, in Graph format. That leaves a problem for the engine, what hint tells it that this node starts and expression needing expansion?

The simpler approach is to give operators grouping power, like the (), {} pairs. Use them to direct the expansion and contraction of Gout, explicit push/pop operations on Gout.. Arithmetic operator will be know to have explicit distributive properties. The conflict with the asterisk, being used differently in two contexts, is a problem with our symbolic language, TE. In the actual engine they have different op codes.

No comments: