Interface Prover

All Known Implementing Classes:
ClingoProver, DCEC, Prolog

public interface Prover
  • Method Details

    • querySupport

      Boolean querySupport(Term query)
      checks validity of a belief.
      Parameters:
      query - The query / belief
      Returns:
      whether the belief holds
    • querySupportWithExplanation

      org.apache.commons.lang3.tuple.Pair<Boolean,Map<Term,Boolean>> querySupportWithExplanation(Term query)
      checks validity of a belief, with an explanation from spy.
      Parameters:
      query - The query / belief
      Returns:
      whether the belief holds
    • queryBelief

      List<Map<Variable,Symbol>> queryBelief(Term query)
      Queries the Belief State about the term in the argument, and a set of bindings corresponding to all of the found answers.
      Parameters:
      query - : a query in Term format
      Returns:
      an ArrayList of bindings: here represented as a HashMap from Variables to Symbols
    • assertBelief

      void assertBelief(Term belief)
      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.
      Parameters:
      belief -
    • retractBelief

      void retractBelief(Term belief)
      Removes a single belief from the Belief State of the agent.
      Parameters:
      belief -
    • assertRule

      void assertRule(Term head, List<Term> body)
      Parameters:
      head -
      body -
    • retractRule

      void retractRule(Term head, List<Term> body)
      remove the specified rule
    • initializeFromFiles

      void initializeFromFiles(List<String> filenames) throws IOException
      initialize the knowledge base from a file
      Throws:
      IOException
    • getTheory

      String getTheory()
      Get the theory representation as a string in target language format. Returned string depends on prover implementation.
      Returns:
      internal theory representation
    • getInternalTheory

      Object getInternalTheory()
      Get the theory representation in its source format
      Returns:
      internal theory representation
    • setTheory

      boolean setTheory(String theory)
      Set the theory (aka beliefs aka assumptions).
      Returns:
      true if theory was set successfully
    • assertBelief

      void assertBelief(String belief)
      Assert belief to prover.
      Parameters:
      belief -
    • retractBelief

      void retractBelief(String belief)
      Retract belief from prover.
      Parameters:
      belief -
    • assertRule

      void assertRule(String rule)
      Add rule to prover.
      Parameters:
      rule -
    • retractRule

      void retractRule(String rule)
      Retract rule from prover.
      Parameters:
      rule -
    • sanitize

      String sanitize(Term term)
      Convert 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
      Parameters:
      term -
      Returns: