Links - Javascript Inference Engines

March 28 2009: added links, few edits. revisiting subject in general

There are some Javascript oldies but goodies to be found on the Web.

There was an active Javascript inference engine at CNLP ( Syracuse Univeristy ) at some point, but it may be moribund. From the site:

By using eQuery tool of CNLP, documents are represented in a frame-based format. The Inference Engine is a knowledge-based question answering system, that simply works with this frame-based representation. It builds a knowledge base with frame-based processed documents, then tries to prove a query frame, which is a frame-based representation of a question. Inference Engine converts this query frame from one form to other forms by using inference rules written by CNLP.

Springer Berlin published a text in 2004 titled Using XML and Other Techniques to Enhance Supportability of Diagnostic Expert Systems. For the extract.

Until now, Diagnostic Expert Systems usually used "shells" comprising an inference engine, user interfaces and a means of storing the rules. Our new design incorporates the JavaScript inference engine and the user interface in code for a standard web browser and translates the rules into XML.

There is a old demo of RDF Query in Javascript demo at w3.org, circa the year 2000. It is the foundation of a more more recent demo of the Javascript MinXML, which is capable of Prolog-like inferencing.

The Rhino Syndrome

If there is a "fly in the reactor core" of Javascript inference engines, it might be the Rhino Javascript Interpreter, implemented entirely in Java. It is very mature, stable and portable, a good thing in itself. Firefox uses Rhino and almost everyone likes Firefox - the last I heard, it was the second most popular browser.

But when running complex tree navigation algorithms, Rhino leaves much to be desired performance-wise. About 8X to be desired, roughly speaking. Remember that Rhino-as-inference-engine is a Java byte-code interpreter implementing a Javascript interpreter navigating through a rule base with many interlinked tree structures. Even a small rule example can run consume 10-15 seconds in Java, versus 1-2 seconds in C.

The Seamonkey browser avoids this bottleneck by using the SpiderMonkey Javascript Interpreter, implemented in C. It makes a big difference for heavy-duty applications like inference engines.

So ... there may be a plugin for Firefox, see Link- Mozilla RDF for more details.

 


Note: apparently link is dead. Hope to find new link for OC Prover.

Correction: OC Prover uses Javascript for data entry, the engine is a CGI script. The original:

The Order Calculus Prover provides a simple inference Engine for proving statements in a restricted language.

Example 13 uses the "every" rule:

Premises

  • Every student smiled
  • No student who smiled walked


Conclusion

  • No student walked

Clearly, it is capable of fairly sophisticated reasoning.