--> |
|
jDREW |
<-- |
This Applet demo illustrates a simple bottom-up inference engine built from the jDREW package. The engine will take a set of “rules” and “facts” as input and inference bottom-up through them. The output of the engine is an exhaustive set of “facts” that can be derived from the input set. The demo provides three preset example input sets to illustrate how the engine works. Also, the users can use their own “rule” and “fact” sets in the demo.
The demo GUI has a “Format” radio button group, a “Trace” check box, an “example” selection box and a “Run” button:
·
“Example”
selection box: a combo box to select an example input set that you want to
run. (See picture 1) By selecting the
“user input”, you can type in your own “rules” and “facts” in “Prolog” or
“RuleML” format.
·
“Format” radio button group:
indicates the format (“Prolog” or “RuleML”) of the input set. Select it
correctly when you are using “user input”.
·
“Trace”
check box: click “Run” when unchecked,
the demo only gives the finial exhaustive set of “ facts” that can be derived
from the input set. (See picture 2)
click “Run” when checked, the demo will give the processing details of the bottom-up inference. (See picture 3)
·
“Run”
button: click to start the bottom-up inference.
·
“Console” tab window: holds the
output from the demo.
·
“Rule Set” tab window: holds
the current input set for the demo.
|
Picture 1 |
Picture 3 |
|
Picture 2 |
The explanation
of the process details:
Data structure: New facts: priority queue.
Old facts: Discrimination tree.
Rules: Discrimination tree.
New facts <- all the facts of the input
set. Old facts <- empty. Rules <- all the rules of the input
set.
Process:
Initial stage
loop until New
facts is empty select and remove a new fact n from New
facts if n is not forward subsumed by the
facts in old facts for each rule in Rules whose
first goal matches n resolve process
new result add
n to old facts
Main loop
“Selected newFact n” message
is outputted at this step as a trace info.
“new fact n subsumed by
old fact …” message is
outputted at this step if n is subsumed by the facts in old
facts. “new resolvent …” message is outputted at this step as a
trace info.
![]()
![]()
Process new result (c) If
c is rule For
each old fact in old facts that matching the first goal of c resolve process
new result add
c to Rules else add
c to New facts
“new resolvent …” message is outputted at this step as a
trace info.
![]()