You are here

Description of the technologies used (XSugar and Prolog)

The Vensim-to-Simile conversion process makes use of two technologies: XSugar and Prolog.

XSugar (http://www.brics.dk/xsugar/) has been developed to enable a plain-text (non-XML) syntax to be transformed into an XML syntax, and vice-versa.   It does this by enabling you to specify a set of grammar rules, which define the language concerned.  The special thing about XSugar is that each rule has tow matching parts: the rule for the non-XML syntax and the rule for the XML syntax.  This enables the XSugar rule-set to be used in either direction: i.e. converting from plain text to XML or from XML to plain text.  

In the present context, the use of XSugar opens up the possibility that a single converter can be used to convert from Vensim to Simile or the other way around, without havingto write a separate converter for each direction.

Prolog (Programming in Logic) is a logic-based programming language developed in the 1970s.   Unlike most programming languages, a Prolog program does not consist of a set of instructions to the computer.  Rather, a Prolog program consists of facts and rules, each of which is 'true' in its own right.  The equivalent of 'running  program' is to ask the Prolog interpreter to find a solution to a problem, by searching through all the facts and rules it has at its disposal.  

In the epresent context, the Prolog program can define complex relationships between one data structure (the model in vensim's data model) and another (the same model in Simile's data structure).