DEFT for Defeasible Datalog+/- is an open source software for Defeasible Reasonning based on Graal. It is still under active developpment and offers a working API for defeasible reasonning in Datalog+/-.
For more details and examples See DEFT homepage.
Two ways to do it:
-
Easy way: Go to target and download `DEFT-{version}-jar-with-dependencies.jar'. It contains all the dependencies including Graal.
-
Or, Flexible way:
- install graal as a maven dependency: graal installation.
- Clone the DEFT repository
https://github.com/hamhec/DEFT.git
- go to the DEFT folder and package it
mvn clean install
- add DEFT as a maven dependency to your project.
- profit :).
- Express your knowledge base using the DLGP format. e.g. kowalski.dlgp
% kowalski.dlgp
%----------------- Rules --------------------
bird(X) :- penguin(X).
nofly(X) :- penguin(X).
[DEFT] fly(X) :- bird(X).
%----------- Negative Constraints -----------
! :- nofly(X), fly(X).
%----------------- Facts --------------------
penguin(kowalski).
- in your code, create a KB object using the dlgp file, and saturate the knowledge base
KB kb = new KB("path/to/kowalski.dlgp");
kb.saturate();
- Transform your atomic query to an atom
Atom atom = kb.getAtomsSatisfiyingAtomicQuery("?(X) :- nofly(kowalski).").iterator().next();
- Set the preference function to use
kb.setPreferenceFunction(new GeneralizedSpecificityPreference());
- Get its entailment status
int entailment = kb.EntailmentStatus(a);
/* the KB class contains constants explaining the entailement status:
NOT_ENTAILED, STRICTLY_ENTAILED, DEFEASIBLY_ENTAILED */
- Add detailed documentation.
- Add preference on rules.
- Add support for default negation.
- Add a graphical tool for dialectical tree visualisation.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
DEFT is an open-sourced software licensed under the MIT license