More docs available upon request from the author: email@example.com.
The main concept is to provide a runtime environment for the Hekate Markup Language Mark 1 supported with I/O primitives complying with the ideas emerged form hekate_case_io and implemented in Prolog (based on hekate_prolog_io) or Java.
The runtime is coded in Prolog (guess why ).
The inference process must be explicitly started from an indicated XTT table by using
rwclass attributes present in the conditions),
rwclass attributes present in the decisions),
The inference process ends if there are no rules to fire (fails), or if the last fired rule has no outgoing links (succeeds).
For future releases it might be desired to have an algorithm which finds which XTT should the inference process start with. It could be an XTT without incoming links, however it is still subject to further research.
The conflict set is built with rules which conditions are met. It is resolved in the following way:
Appropriate trigger routines are called for
wo class attributes.
To define a routine a predicate
io/3 is used:
The above defines that an attribute with unique identifier
att_12 has a routine
get_character/1 defined which will be spawned before reading attribute value (the attribute is
write_chars_to_file/2 which will be spawned after the rule, with such an attribute in the condition part, is fired.
Comparing to the original idea (hekate_prolog_io) there is a slight adjustment. Attribute values are passed to/for the trigger routines as list. Attribute values are passed as lists, single element list for single valued attributes, multiple element list for multiple valued attribute. See example below.
The following operators are defined in
The implementation is far from being complete, just a few operators are defined at present to cover the editor case .
These operators are used in
Current development vresion:
cvs -d :ext:charon.ia.agh.edu.pl/mnt/cvs/cvs-hades co bheart
cvs -d :ext:charon.ia.agh.edu.pl/mnt/cvs/cvs-hades co -r rel-2 bheart
cvs -d :ext:charon.ia.agh.edu.pl/mnt/cvs/cvs-hades co -r rel-1 bheart
The inference engine is highly modularized. It consists of the following modules:
This way the Beating HeaRT can be extended easily.
There are two I/O modules currently available for the Inference Engine. They allow to call apropriate trigger routines for non-state attributes which are implemented as Prolog predicates or Java methods.
The following example is included in the Beating Heart in a file:
It provides logic for a simple text editor.
The editor is capable of reading in characters into a buffer (
chars) which contents is displayed at any change (
wo class) along with the value of
cursor attribute, which represents cursor position.
There are following key sequences covered by the rules:
The XTT editor model is given below (click to enlarge). The model is generated by the Beating HeaRT visualization plugin.
The following code, loads up The Beating HeaRT, reads in logic, defines all I/O routines for apropriate attributes and launches the inference process.
The original thermostat XTT model is given below:
There is a question to be asked: which rules should be interpreted first, these from table id 1, or these from table id 2 ? To eliminate such an ambiguity an alteration is performed which results in the following XTTs:
Now it is easy to assume that the inference process hsould start with Table id 1.
The following visualization is generated by the Beating HeaRT visualization module.
The following code, loads up The Beating HeaRT, reads in logic, defines all I/O routines for appropriate attributes and launches the inference process.
Since input has to be delivered to the inference engine, it spawns appropriate I/O routines to get actual month, hour, and day of week.