SECTIONS

The top level of knowledge representation in ESTA consists of sections. The first section in any knowledge base must be one called start. A section consists of a name, a textual description and a number of paragraphs. ESTA deals with the paragraphs in a section working from top to bottom, one paragraph at the time. If a paragraph contains a boolean expression, then the expression is evaluated first. If the expression is true - or the paragraph does not contain a boolean expression at all - the relevant list of actions are executed in the order given in the paragraph. When a consultation is started via the Begin Consultation command, ESTA starts by evaluating the boolean expressions in the paragraphs of the start section.

The syntax for a section is:

<section> ::= section <section-name> [:] <description-text>

<paragraph-list>

<paragraph-list> ::= <paragraph> [<paragraph-list>]

<paragraph> ::= [if <boolean-expression>] <action>

[if <boolean-expression>] ( <actions> )

<actions> ::= <action> [,<actions>]

<action> ::= advice |

assign |

call |

chain |

do |

do_section_of |

exit |

stop

Example

The following example consists of a knowledge base with one section and one parameter:

section start : 'the first section to be executed'

if car_color = 'red'

( advice 'Your car is red, try to sell it to the fire brigade ' ,

call sound(200,100)

)

if car_color <> 'red' and car_color <> 'blue'

advice 'Your car is not one of our favourite colors !'

advice 'That''s all folks!'

parameter car_color 'the color of the car'

type text

question 'What is the color of your car ?'

The section start contains three paragraphs. The first paragraph contains a list of two actions separated by commas and embedded in parantheses. The next paragraph has only one action in which case the parantheses may be omitted. The last paragraph consists of a single action without any preceding boolean condition.

Notice that evaluation of a boolean expression typically involves the use of parameters - as in car_color = 'red' in the above example. If a parameter does not have a value at the time of evaluation, ESTA will first establish a value for it either by questioning the user or by using a rule - depending on the parameters declaration.