SPF| SRS| Karma
Navigation
› Home › Overview › Interactive Demo › Email Anti-Spam › Blog/WWW Anti-Spam › Client libraries › The BQuery Protocol › The DP Language › The Model Language › Download › Mailing list › FAQ
Validation
Validate the XHTML and CSS of this page.

The Karmasphere Model Language.

This is a brief introduction to the Karmasphere Model language, which is not to be confused with the parallel DP language, which is far more interesting.

The Karmasphere model language is a C-like sequential programming language designed for evaluation of functions. It differs from most programming languages in that the halting problem is solvable for this language, yet it remains useful.

The compiler will only accept programs which will halt in finite (and short) time, thus making it suitable for a user-accessible programming language for the Karmasphere server. Since the completion time of any program can be computed at compile-time, the runtime does not need to enforce explicit resource constraints.

It is designed for evaluating arbitrary functions of the attributes generated by the DP Language, in order to produce a final verdict or decision. We are gradually extending it to be able to express the various functions generated by the Karmasphere machine learning tools, and more constructs will be added to the language as required.

How is the Halting Problem Solved?

Of course the language isn't Turing complete, but it is sufficient for the expression of most functions. The solution is simpler than it sounds. We solve the halting problem for our language thus:

  1. Create a directed graph of basic blocks.
  2. Treat this digraph as a partial order on the blocks.
  3. Perform a topological sort on the blocks to generate a full order.
  4. If the sort terminates successfully, the program halts.
  5. If not, the digraph must contain a cycle, which could cause nontermination.

As a corollary of this, loops and recursion are forbidden. Those readers familiar with lambda calculus know that the two are equivalent anyway. We could permit finite loops, but they seem of little use for the purpose of evaluating functions if the language contains explicit vector and matrix operators.

The restriction could be made at runtime either by painting blocks blue as they are seen, or by using an explicit resource constraint, but it is always nicer to detect errors at compile time.

Further Questions

Please join the Karmasphere users mailing list, or mail shevek@karmasphere.com.