kodkod.engine.satlab
Interface SATProver

All Superinterfaces:
SATSolver

public interface SATProver
extends SATSolver

Provides an interface to a SAT solver that can generate proofs of unsatisfiability.

Author:
Emina Torlak
invariant:
all i: [2..) | i in variables => i-1 in variables
all c: clauses + resolvents | all lit: c.lits | lit in variables || -lit in variables
all c: clauses + resolvents | all disj i,j: c.lits | abs(i) != abs(j)
specfield:
variables: set [1..)
clauses: set Clause
resolvents: set Clause

Method Summary
 ResolutionTrace proof()
          Returns a resolution-based proof of unsatisfiability of this.clauses.
 void reduce(ReductionStrategy strategy)
          Uses the given reduction strategy to remove irrelevant clauses from the set of unsatisfiable clauses stored in this prover.
 
Methods inherited from interface kodkod.engine.satlab.SATSolver
addClause, addVariables, free, numberOfClauses, numberOfVariables, solve, valueOf
 

Method Detail

proof

ResolutionTrace proof()
Returns a resolution-based proof of unsatisfiability of this.clauses.

Returns:
{ t: ResolutionTrace | t.prover = this }
Throws:
java.lang.IllegalStateException - - SATSolver.solve() has not been called, or the last call to SATSolver.solve() returned true
requires:
{@link SATSolver#solve()} has been called, and it returned false

reduce

void reduce(ReductionStrategy strategy)
Uses the given reduction strategy to remove irrelevant clauses from the set of unsatisfiable clauses stored in this prover. A clause c is irrelevant iff this.clauses - c is unsatisfiable. The removal algorithm works as follows:
 for (IntSet next = strategy.next(this.proof()); !next.isEmpty(); next = strategy.next(this.proof())) {
  let oldClauses = this.clauses, oldResolvents = this.resolvents
  clear this.clauses
  clear this.resolvents
  for(Clause c : this.proof().elts[next]) {
    if (no c.antecedents)
      add c to this.clauses
    else
      add c to this.resolvents
  }
  if (this.solve()) {
   this.clauses = oldClauses 
   this.resolvents = oldResolvents
  }
 }
 

Throws:
java.lang.IllegalStateException - - SATSolver.solve() has not been called, or the last call to SATSolver.solve() returned true
See Also:
ReductionStrategy
effects:
modifies this.clauses and this.resolvents according to the algorithm described above
requires:
{@link SATSolver#solve()} has been called, and it returned false