Table of Contents

Hekate Meta Representation

The visual XTT2 model is represented by means of a human readable, algebraic notation, also called the XTT presentation syntax, or HeKatE Meta Representation (HMR).

The representation can be directly run by the HeKatE RunTime environment HeaRT. HMR file is in fact a legal Prolog code that can be interpreted directly (number of custom operators are defined). Therefore HeaRT prototype is implemented in Prolog and provides the implementation for number of inference solutions including the three described before.

HMR can be used to write rules directly, or it can be generated by the HQEd XTT2 editor from the visual XTT2 model. The same rule-based knowledge can be serialized to XML-based HML.

See the HaDEs page for an overview.

Example

An example excerpt of HMR is given below:

xschm th: [today,hour] ==> [operation].
 
xrule th/1:
  [today eq workday,
   hour gt 17]
  ==>
  [operation set not_bizhours].
 
xrule th/4:
  [today eq workday,
   hour  in [9 to 17]]
  ==>
  [operation set bizhours].

The first line defines an XTT table scheme, or header, defining all of the attributes used in the table.

Its semantics is as follows:
The XTT table th has two conditional attributes: today and hour and one decision attribute: operation.
This information is determined from the conceptual design phase using the ARD method. Then two examples of rules are given.

The second rule can be read as:
Rule with ID 4 in the XTT table called th: if value of the attribute today equals (=) value workday and the value of the attribute hour belongs to the range (in) <9,17> then set the value of the attribute operation to the value bizhours.

HMR language

HMR language was created to provide simple and human-readable text representation for XTT diagrams. The HMR language is fully Prolog compatible, which means that it is interpreted directly by Prolog interpreter, without any additional parser. The HMR file consists of the following elements:

All HMR elements are described below. Following notation was introduced:

Types definitions

Types in HMR language are used to define kind, structure and domain for further attributes definitions. Type definition looks as follows:

xtype [ +name: %STRING%,
		+base: {numeric | symbolic},
		+domain: %LIST%,
		?scale: %NUMBER%,
		?ordered: {yes | no},
		?desc: %STRING%].

Type definition may look as follows:

xtype [ name: days,
		domain: [mon/1,tue/3,wed/5,thu/7,fri/9,sat/10,sun/20],
		ordered: yes, 
		desc: 'Days of the week'].

Attributes definitions

Attributes in HMR language denotes instances of defined types. Every attribute in the HMR language must have a type assigned. Only one type can be assigned to one attribute. Type definitions looks as follows:

xattr [ +name : %STRING%,
		+class: {simple | general},
		+type: %XTYPE_NAME%,
		+comm: {in | out | inter | comm},
		?callback: %LIST%,
		?abbrev: %STRING%,
		?desc: %STRING%].

Atribute definition may look as follows:

xattr [name: day,
		abbrev: day,
		class: simple,
		type: days,
		comm: in,
		callback: [ask_console,[day]]].

Types and attributes groups definitions

Groups contain sets of attributes' or types' names. It is possible to refer to a group of attributes or types using group name instead of each type's or attributes name separately. Groups were designed for future use in HeaRT interpreter.

Groups definitions looks as follows:

xtpgr [ +name : %STRING%,
		?abbrev: %STRING%,
		+types: %LIST%
		].
xatgr [ +name : %STRING%,
		?abbrev: %STRING%,
		+types: %LIST%
		].

Schemas definitions

Schemas represents XTT tables in HMR language. However, they cannot be considered as entities filled with rows containing rules. Schema is only a representation of relation between attributes that rules falling into this schema realizes. Definitions of schema looks as follows:

xschm +%STRING1%/?%STRING2% : +%LIST1% ==> +%LIST2%.

An example of schema definitions may look as follows:

xschm ms: [month] ==> [season].

Rules definitions

Rules in HMR language are defined as follows:

xrule %STRING1%/%NUMBER%: %LIST1% ==> %LIST2% **> %LIST3% : %STRING2%.

An example of a rule definition is shown below.

xrule dt/1:
      [day in [mon,tue,wed,thu,fri]]
    ==>
      [today set workday]
	**>
	  [tell_console,['Today is a workday']]
    :th.

States definitions

State in HMR language is a set of attributes and corresponding values that describes system's status. State definitions looks as follows:

xstat %STRING%: %LIST%.

An example of xstat record may look as follows:

xstat s1: [month, january]

Callbacks definitions

Callback is an operation that is fired at the certain point of inference process, and can change system's state. Callbacks are defined as follows:

xcall %STRING% : %LIST% >>> (%CLAUSE%).

An example of xcall record is shown below:

xcall ask_console : [AttName] >>> (write('Type value for attribute:  '),
					write(AttName),nl,
					read(Answer),
					alsv_new_val(AttName,Answer)).

Actions definitions

Action is an operation that is fired when rule's firing conditions are true. Actions cannot change system's state.

xactn %STRING% : %LIST% >>> (%CLAUSE%).

An example of xactn record is shown below:

xactn tell_console : [AttName] >>> (write('Attribute '),
					write(AttName),
					write(' output value is '),
					xstat(current:[AttName,V]),
					write(V),nl).

Verifications reports

Predicates containing versification's reports are generated automatically by the HeaRT interpreter. Every record contains only one message generated by verification plugin. All messages generated during verification are grouped within a set of xhalv/1 predicates of the same ID (name). Definition of xhalv/1 looks as follows:

xhalv %STRING% : %LIST%.

Trajectory traces

Predicates containing trajectories of the system's inference process are automatically generated by the HeaRT and saved as xtraj/1. A single xtraj/1 record contains information about one inference process from the start until the end. Definitions of xtraj/1 are build as follows:

xtraj %STRING% : %LIST%.