... | ... | @@ -56,7 +56,7 @@ Next, you can create the main class in a file called for instance `Main.java` an |
|
|
|
|
|
You may change the name of the class according to the name of your file.
|
|
|
|
|
|
You will also need to create a file `example.dlgp` at the root of the java project with the following content :
|
|
|
You will also need to create a file `example.dlgp` at the root of the java project with following the following content:
|
|
|
|
|
|
```
|
|
|
@facts
|
... | ... | @@ -76,11 +76,11 @@ t(X) :- s(X). |
|
|
?(Y) :- s(Y).
|
|
|
```
|
|
|
|
|
|
When you execute the given example, the `example.dlgp` file is parsed and a factbase and rulebase are created. Then, the queries are evaluated over the factbase and the answers are printed on the standard output.
|
|
|
When you execute the Main class, the `example.dlgp` file is parsed and a factbase and rulebase are created. Then, the queries are evaluated over the factbase and the answers are printed on the standard output.
|
|
|
|
|
|
## Adding reasoning parts
|
|
|
|
|
|
The previous example included rules but they are not taken into account for answering the queries. In this step we will add the reasoning part with a saturation approach.
|
|
|
The previous example includes rules but these are not taken into account for answering the queries. In this step we will add the reasoning part with a saturation approach.
|
|
|
|
|
|
If you want to get familiar with the library you can try to do so by yourself
|
|
|
- Hint: There is 2 lines of code to copy from the documentation
|
... | ... | @@ -92,4 +92,4 @@ chase.execute(); |
|
|
```
|
|
|
- Don't forget the corresponding imports
|
|
|
|
|
|
When you execute the given example, the factbase and rulebase are created. Then, the factbase is saturated with the rulebase and the queries are evaluated over the saturated factbase. |
|
|
\ No newline at end of file |
|
|
Now, the factbase and rulebase are created, then the factbase is saturated with the rulebase and the queries are evaluated over the saturated factbase. |
|
|
\ No newline at end of file |