Class Solver
- java.lang.Object
-
- ai.libs.jaicore.logic.fol.algorithms.resolution.Solver
-
- Direct Known Subclasses:
UnitResolutionSolver
public abstract class Solver extends java.lang.Object
This solver tries to solver PL1 formulas in CNF where all variables are existentially quantified
-
-
Constructor Summary
Constructors Constructor Description Solver()
-
Method Summary
-
-
-
Method Detail
-
getFormulas
public java.util.Set<CNFFormula> getFormulas()
-
getInternalRepresentationOfFormulas
public java.util.Map<CNFFormula,CNFFormula> getInternalRepresentationOfFormulas()
-
addFormula
public void addFormula(CNFFormula formula)
-
removeFormula
public void removeFormula(CNFFormula formula)
-
isSatisfiable
public boolean isSatisfiable(CNFFormula formula) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
isSatisfiable
public boolean isSatisfiable(CNFFormula formula, CNFFormula formulaToChooseAtLeastOneLiteralFrom) throws java.lang.InterruptedException
is f & g satisfiable if resolution must take in each step at least one clause from g (and resolvents produced)?- Parameters:
formula
-formulaToChooseAtLeastOneLiteralFrom
-- Returns:
- Throws:
java.lang.InterruptedException
-
isSatisfiable
public boolean isSatisfiable() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
performResolutionUntilEmptyClauseIsFound
protected CNFFormula performResolutionUntilEmptyClauseIsFound(CNFFormula formula, CNFFormula formulaToChooseAtLeastOneLiteralFrom) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getTree
public ResolutionTree getTree()
-
getNextPair
protected ResolutionPair getNextPair(java.util.Set<ResolutionPair> candidates)
-
getPossibleResolutionPairs
protected java.util.List<ResolutionPair> getPossibleResolutionPairs(CNFFormula formula)
-
getAdmissiblePairs
protected abstract java.util.List<ResolutionPair> getAdmissiblePairs(java.util.List<ResolutionPair> pairs)
-
getPossibleResolutionPairs
protected java.util.List<ResolutionPair> getPossibleResolutionPairs(CNFFormula formula, Clause c2)
-
getClausesWithSamePredicates
protected java.util.Set<Clause> getClausesWithSamePredicates(CNFFormula formula, Clause c2)
-
isClauseAlreadyContainedInFormula
protected boolean isClauseAlreadyContainedInFormula(CNFFormula formula, Clause c) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getPossibleResolutionsPairsOfClauses
protected java.util.List<ResolutionPair> getPossibleResolutionsPairsOfClauses(Clause c1, Clause c2)
- Parameters:
c1
- Note that c1 MUST be the smaller clause by conventionc2
-- Returns:
-
performResolutionStepForPair
protected ResolutionStep performResolutionStepForPair(ResolutionPair pair)
-
getUnificatorForLiterals
protected java.util.Map<VariableParam,LiteralParam> getUnificatorForLiterals(Literal l1, Literal l2)
Performs Robinsons's unification- Parameters:
l1
-l2
-- Returns:
-
-