kodkod.engine
Class Solution

java.lang.Object
  extended by kodkod.engine.Solution

public final class Solution
extends java.lang.Object

Represents the full solution to a formula: an instance if the formula is satisfiable or a proof of unsatisfiability if not.

Author:
Emina Torlak
specfield:
formula: Formula // the formula being solved
bounds: Bounds // the bounds on the formula

Nested Class Summary
static class Solution.Outcome
          Enumerates the possible outcomes of an attempt to find a model for a FOL formula.
 
Method Summary
 Instance instance()
          Returns a satisfiying instance for this.formula, if the value returned by this.outcome() is either SATISFIABLE or TRIVIALLY_SATISFIABLE.
 Solution.Outcome outcome()
          Returns the outcome of the attempt to find a model for this.formula.
 Proof proof()
          Returns a proof of this.formula's unsatisfiability if the value returned by this.outcome() is UNSATISFIABLE or TRIVIALLY_UNSATISFIABLE, translation logging was enabled during solving, and a core extracting sat solver (if any) was used to determine unsatisfiability.
 Statistics stats()
          Returns the statistics gathered while solving this.formula.
 java.lang.String toString()
          Returns a string representation of this Solution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

outcome

public Solution.Outcome outcome()
Returns the outcome of the attempt to find a model for this.formula. If the outcome is SATISFIABLE or TRIVIALLY_SATISFIABLE, a satisfying instance can be obtained by calling instance(). If the formula is UNSATISFIABLE, a proof of unsatisfiability can be obtained by calling proof() provided that translation logging was enabled and the unsatisfiability was determined using a core extracting sat solver. Lastly, if the returned Outcome is or TRIVIALLY_UNSATISFIABLE, a proof of unsatisfiability can be obtained by calling proof() provided that translation logging was enabled.

Returns:
an Outcome instance designating the satisfiability of this.formula with respect to this.bounds

instance

public Instance instance()
Returns a satisfiying instance for this.formula, if the value returned by this.outcome() is either SATISFIABLE or TRIVIALLY_SATISFIABLE. Otherwise returns null.

Returns:
a satisfying instance for this.formula, if one exists.

proof

public Proof proof()
Returns a proof of this.formula's unsatisfiability if the value returned by this.outcome() is UNSATISFIABLE or TRIVIALLY_UNSATISFIABLE, translation logging was enabled during solving, and a core extracting sat solver (if any) was used to determine unsatisfiability. Otherwise, null is returned.

Returns:
a proof of this.formula's unsatisfiability, if one is available.

stats

public Statistics stats()
Returns the statistics gathered while solving this.formula.

Returns:
the statistics gathered while solving this.formula.

toString

public java.lang.String toString()
Returns a string representation of this Solution.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this Solution.