Class Prover9FolReasoner

java.lang.Object
org.tweetyproject.logics.fol.reasoner.FolReasoner
org.tweetyproject.logics.fol.reasoner.Prover9FolReasoner
All Implemented Interfaces:
QualitativeReasoner<FolBeliefSet,FolFormula>, Reasoner<Boolean,FolBeliefSet,FolFormula>

public class Prover9FolReasoner extends FolReasoner
Invokes Prover9 ( https://www.cs.unm.edu/~mccune/mace4/), an automated theorem prover for first-order logic, and returns its results.
Author:
Nils Geilen, Matthias Thimm
  • Constructor Details

    • Prover9FolReasoner

      public Prover9FolReasoner(String binaryLocation, Shell bash)
      Constructs a new instance pointing to a specific Prover9.
      Parameters:
      binaryLocation - of the prover9 executable on the hard drive
      bash - shell to run commands
    • Prover9FolReasoner

      public Prover9FolReasoner(String binaryLocation)
      Constructs a new instance pointing to a specific Prover9
      Parameters:
      binaryLocation - of the prover9 executable on the hard drive
  • Method Details

    • query

      public Boolean query(FolBeliefSet kb, FolFormula query)
      Description copied from interface: QualitativeReasoner
      Queries the given belief base with the provided formula and returns a boolean result. The result indicates whether the formula is entailed or satisfied by the belief base according to the qualitative reasoning method implemented by the reasoner.
      Specified by:
      query in interface QualitativeReasoner<FolBeliefSet,FolFormula>
      Specified by:
      query in interface Reasoner<Boolean,FolBeliefSet,FolFormula>
      Specified by:
      query in class FolReasoner
      Parameters:
      kb - The belief base to be queried.
      query - The formula for which the query is made.
      Returns:
      `TRUE` if the formula is entailed or satisfied by the belief base, `FALSE` otherwise.
    • equivalent

      public boolean equivalent(FolBeliefSet kb, FolFormula a, FolFormula b)
      Description copied from class: FolReasoner
      This method determines whether two formulas are equivalent wrt. to the given knowledge base.
      Specified by:
      equivalent in class FolReasoner
      Parameters:
      kb - the knowledge base
      a - the first formula.
      b - the second formula.
      Returns:
      the answer to the query.
    • getBinaryLocation

      public String getBinaryLocation()
      Return the path of the Prover9 binaries.
      Returns:
      the path of the Prover9 binaries.
    • setBinaryLocation

      public void setBinaryLocation(String binaryLocation)
      Changes the path of the Prover9 binaries.
      Parameters:
      binaryLocation - the new path of the binary
    • isInstalled

      public boolean isInstalled()
      Description copied from interface: QualitativeReasoner
      Checks whether the underlying solver or reasoning mechanism used by this reasoner is installed and available for use. This can be helpful when the reasoner depends on external tools or libraries for performing the reasoning tasks.
      Returns:
      `true` if the solver is installed and available, `false` otherwise.