|
|
|
This slide show
that the resolution based inference process can be represented in the form of
a Finite State Machine (FSM).
|
|
The ovals in the
slide indicate the states; the rectangles are functions, that are executed
when passing from state to another. Here follows an overview of all state
changes.
|
|
1 ŕ 2
|
|
The proces
starts with state 1 where the menu is displayed. Besides functions that are
not shown in the figure, from the menu an inferencing process can be started
by selecting a database and a query.
|
|
|
|
2 ŕ 3
|
|
In state 2 the
data structures for the inferencing process are prepared and the query is
entered in the goallist. Then the main state, 3, of the process is entered.
|
|
|
|
3 ŕ 3
|
|
Depending on the
next triple in the goallist there are three possibilities:
|
|
a) the triple
contains a builtin e.g. (Txxx, io:print, ”Message to the user”). Some
following triples might also be used. After executing the builtin, the FSM
will return to state 3.
|
|
b) the triple and a certain
number of following triples define a subquery. The subquery is directed to
another server. The returned results are integrated into the database and the
FSM returns to state 3.
|
|
c) the engine will take a goal and will try
to match it with the database. One alternative is selected and added to the
goallist and the other alternatives are pushed on the stack. If there were
alternatives the FSM returns to state 3. If there were not, it goes to state
6.
|
|
|
|
3 ŕ 4
|
|
The program
detects an empty goallist. This means all goals have been ‘proved’ and the
resolution refutation process is complete. A solution has been found and the
FSM passes to state 4.
|
|
|
|
4 ŕ 5
|
|
A solution has
been found. The FSM passes control to the backtrack function that
looks if alternatives are present on the stack for further investigation. If
this is the case, then control is passed to state 5.
|
|
|
|
3 ŕ 6
|
|
The solve
function tries to unify a goal with the database; however the unification
process fails. The choose function detects the lack of alternatives and the
FSM passes to state 6.
|
|
|
|
6 ŕ 5
|
|
The current
search path is aborted. The backtrack
function looks for further alternatives; if this is the case, the FSM passes
control to state 5.
|
|
|
|
5 ŕ 3
|
|
A backtrack has
been done. An alternative will be chosen from the stack.
|
|
|
|
4 ŕ 7
|
|
6 ŕ 7
|
|
No more
alternatives are present on the stack. The inferencing process is finished.
The FSM passes to state 7.
|
|
|
|
7 ŕ 1
|
|
The inferencing
process is finished. Results are displayed and/or used and control is passed
to state 1.
|
|
|