Class ClingoProver
java.lang.Object
edu.tufts.hrilab.belief.provers.clingo.ClingoProver
- All Implemented Interfaces:
Prover
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.tufts.hrilab.belief.provers.Prover
Prover.Engine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertBelief(Term belief) Adds a single belief to the Belief State of the agent.voidassertBelief(String belief) Assert belief to prover.voidassertRule(Term head, List<Term> body) voidassertRule(String belief) Add rule to prover.Get the theory representation in its source formatgetRules()Get the theory representation as a string in target language format.voidinitializeFromFiles(List<String> files) initialize the knowledge base from a filequeryBelief(Term query) Queries the Belief State about the term in the argument, and a set of bindings corresponding to all of the found answers.queryBelief(String query) queryString(String query) querySupport(Term query) checks validity of a belief.querySupportWithExplanation(Term query) checks validity of a belief, with an explanation from spy.voidretractBelief(Term belief) Removes a single belief from the Belief State of the agent.voidretractBelief(String belief) Retract belief from prover.voidretractRule(Term head, List<Term> body) remove the specified rulevoidretractRule(String belief) Retract rule from prover.Convert DIARC FOL Term to appropriate prover syntax.booleanSet the theory (aka beliefs aka assumptions).
-
Constructor Details
-
ClingoProver
public ClingoProver()
-
-
Method Details
-
querySupport
Description copied from interface:Proverchecks validity of a belief.- Specified by:
querySupportin interfaceProver- Parameters:
query- The query / belief- Returns:
- whether the belief holds
-
querySupportWithExplanation
public org.apache.commons.lang3.tuple.Pair<Boolean,Map<Term, querySupportWithExplanationBoolean>> (Term query) Description copied from interface:Proverchecks validity of a belief, with an explanation from spy.- Specified by:
querySupportWithExplanationin interfaceProver- Parameters:
query- The query / belief- Returns:
- whether the belief holds
-
queryBelief
Queries the Belief State about the term in the argument, and a set of bindings corresponding to all of the found answers.- Specified by:
queryBeliefin interfaceProver- Parameters:
query- : a query in Term format- Returns:
- an ArrayList of bindings: here represented as a HashMap from Variables to Symbols
-
assertBelief
Adds a single belief to the Belief State of the agent. Note: new beliefs are added such that they take priority in unification to old beliefs. queryBelief() will still return all asserted and inferred bindings.- Specified by:
assertBeliefin interfaceProver- Parameters:
belief-
-
retractBelief
Removes a single belief from the Belief State of the agent.- Specified by:
retractBeliefin interfaceProver- Parameters:
belief-
-
assertRule
- Specified by:
assertRulein interfaceProver- Parameters:
head-body-
-
getRules
-
retractRule
Description copied from interface:Proverremove the specified rule- Specified by:
retractRulein interfaceProver
-
initializeFromFiles
initialize the knowledge base from a file- Specified by:
initializeFromFilesin interfaceProver- Throws:
IOException
-
getTheory
Get the theory representation as a string in target language format. Returned string depends on prover implementation. -
getInternalTheory
Get the theory representation in its source format- Specified by:
getInternalTheoryin interfaceProver- Returns:
- internal theory representation
-
setTheory
Set the theory (aka beliefs aka assumptions). -
queryString
-
queryBelief
-
assertBelief
Description copied from interface:ProverAssert belief to prover.- Specified by:
assertBeliefin interfaceProver
-
retractBelief
Description copied from interface:ProverRetract belief from prover.- Specified by:
retractBeliefin interfaceProver
-
assertRule
Description copied from interface:ProverAdd rule to prover.- Specified by:
assertRulein interfaceProver
-
retractRule
Description copied from interface:ProverRetract rule from prover.- Specified by:
retractRulein interfaceProver
-
sanitize
Description copied from interface:ProverConvert DIARC FOL Term to appropriate prover syntax. TODO: consolidate all code related to converting FOL to/from Prover and replace this method with two new methods (1) convertToProverForm and (2) convertToDiarcForm
-