Class Sat4jSolver

  • All Implemented Interfaces:
    net.sf.tweety.logics.commons.analysis.BeliefSetConsistencyTester<PlFormula>, net.sf.tweety.logics.commons.analysis.ConsistencyTester<net.sf.tweety.commons.BeliefSet<PlFormula,​?>>, net.sf.tweety.logics.commons.analysis.ConsistencyWitnessProvider<PlBeliefSet,​PlFormula>

    public class Sat4jSolver
    extends SatSolver
    Uses the Sat4j library for SAT solving (note that currently only the light version is used).
    Author:
    Matthias Thimm
    • Constructor Detail

      • Sat4jSolver

        public Sat4jSolver​(int maxvar,
                           int nbclauses)
        Creates a new solver with the given parameters.
        Parameters:
        maxvar - Max number of variables for this solver.
        nbclauses - Max number of expected clauses for this solver.
      • Sat4jSolver

        public Sat4jSolver()
        Creates a new solver with default parameters (maxvar=1000000, nbclauses=500000).
    • Method Detail

      • isSatisfiable

        public boolean isSatisfiable​(Collection<PlFormula> formulas)
        Description copied from class: SatSolver
        Checks whether the given set of formulas is satisfiable.
        Specified by:
        isSatisfiable in class SatSolver
        Parameters:
        formulas - a set of formulas.
        Returns:
        "true" if the set is consistent.
      • getWitness

        public net.sf.tweety.commons.Interpretation<PlBeliefSet,​PlFormula> getWitness​(Collection<PlFormula> formulas)
        Description copied from class: SatSolver
        If the collection of formulas is consistent this method returns some model of it or, if it is inconsistent, null.
        Specified by:
        getWitness in interface net.sf.tweety.logics.commons.analysis.ConsistencyWitnessProvider<PlBeliefSet,​PlFormula>
        Specified by:
        getWitness in class SatSolver
        Returns:
        some model of the formulas or null.