Skip to content

Latest commit

 

History

History
83 lines (64 loc) · 2.34 KB

README.md

File metadata and controls

83 lines (64 loc) · 2.34 KB

DEFT

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.

Installation

Two ways to do it:

  1. Easy way: Go to target and download `DEFT-{version}-jar-with-dependencies.jar'. It contains all the dependencies including Graal.

  2. Or, Flexible way:

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 :).

Usage

  1. 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).
  1. 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();
  1. Transform your atomic query to an atom
Atom atom = kb.getAtomsSatisfiyingAtomicQuery("?(X) :- nofly(kowalski).").iterator().next();
  1. Set the preference function to use
kb.setPreferenceFunction(new GeneralizedSpecificityPreference());
  1. Get its entailment status
int entailment = kb.EntailmentStatus(a);
/* the KB class contains constants explaining the entailement status: 
NOT_ENTAILED, STRICTLY_ENTAILED, DEFEASIBLY_ENTAILED */

Next Versions TODO List

  • Add detailed documentation.
  • Add preference on rules.
  • Add support for default negation.
  • Add a graphical tool for dialectical tree visualisation.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

DEFT is an open-sourced software licensed under the MIT license