--> |
jDREW |
<-- |
1. What is the jDREW package composed of? 2. How can I quickly write a program like the demo? 5. Which part of jDREW will use the libraries in the “lib” directory? |
jDREW package is composed of 5 subpackages: BU, TD, TEST, lib, util, each of which is located in a subdirectory of the same name as the package.
“util” : this package contains all the fundamental classes or data structures of jDREW.
“lib”: this package contains the libraries that is used by the jDREW.
“TEST”: this package contains the unit test code of jDREW
“BU”: this package contains the classes of a buttom-up reasoning engine built on jDREW.
“TD”: this is an experiment package that contains a preliminary top-down reasoning engine built on jDREW.
2. How can I quickly write a program like the
demo?
In the
“BU" package, you will find a “ForwardReasoner.java” file. This file is in
fact a command line version of the demo engine (yet it is not able to parse the
RuleML rule set). “BU” package also includes several rule files that contain
some example rules and facts. You need find out the “dcfp.parseDCFile(…);”
statement and replace “…” with the “full directory name” of your input rule
file. For example, if you want the “c:\example.dc” be your input rule file, the
statement should look like this “dcfp.parseDCFile(“c:\\example.dc”);”. Then you
can compile the whole jDREW package and run the “main” function of the
“ForwardReasoner”.
Unit test
is used by the jDREW developers to insure the quality of the code. For more
information, please visit http://junit.sourceforge.net/.
Also called
forward chaining. They both describe the kind of inference process which first
gathers some information and then tries to infer from it whatever can be
inferred.
The three
libraries in the “lib” directory are used for the unit test (junit.jar) and the
RuleML (XML) file parser (jdom.jar, xerces.jar). All the unit test code appears
in the “TEST” package. There are two java files that will use jdom.jar and
xerces.jar. one is RuleMLFileParser.java that uses the libraries to parse the
RuleML file. The other is DefiniteClause.java that uses the libraries to
generate the RuleML output of a definite clause.
There are
three important data structures of jDREW.
|
name |
arity |
1 |
p |
3 |
2 |
f |
1 |
3 |
g1 |
0 |
4 |
g2 |
0 |
5 |
h |
0 |
6 |
h |
1 |
|
symbol |
length |
|
|
symbol |
length |
1 |
1 |
7 |
1 |
1 |
9 |
|
2 |
2 |
2 |
2 |
2 |
3 |
|
3 |
3 |
1 |
3 |
6 |
2 |
|
4 |
5 |
1 |
4 |
-1 |
1 |
|
5 |
6 |
2 |
5 |
6 |
2 |
|
6 |
4 |
1 |
6 |
-2 |
1 |
|
7 |
3 |
1 |
7 |
2 |
2 |
|
|
8 |
-1 |
1 |
|||
p(f(g1), h, h(g2)) |
9 |
-2 |
1 |
|||
|
P(f(h(X)), h(Y), f(X), Y) |
Site
Contact: Bruce Spencer. Last updated: 2004-1-05
jDREW is an open source project
under the GNU General Oublic License (GPL). For more information, please visit http://sourceforge.net/projects/jdrew/.