kodkod.engine.fol2sat
Class Translator

java.lang.Object
  extended by kodkod.engine.fol2sat.Translator

public final class Translator
extends java.lang.Object

Translates, evaluates, and approximates nodes with respect to given bounds (or instances) and Options.

Author:
Emina Torlak

Method Summary
static BooleanMatrix approximate(Expression expression, Bounds bounds, Options options)
          Overapproximates the value of the given expression using the provided bounds and options.
static BooleanMatrix evaluate(Expression expression, Instance instance, Options options)
          Evaluates the given expression to a BooleanMatrix using the provided instance and options.
static BooleanConstant evaluate(Formula formula, Instance instance, Options options)
          Evaluates the given formula to a BooleanConstant using the provided instance and options.
static Int evaluate(IntExpression intExpr, Instance instance, Options options)
          Evalutes the given intexpression to an Int using the provided instance and options.
static Translation translate(Formula formula, Bounds bounds, Options options)
          Translates the given formula using the specified bounds and options.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

approximate

public static BooleanMatrix approximate(Expression expression,
                                        Bounds bounds,
                                        Options options)
Overapproximates the value of the given expression using the provided bounds and options.

Returns:
a BooleanMatrix whose TRUE entries represent the tuples contained in a sound overapproximation of the expression.
Throws:
expression - = null || instance = null || options = null
UnboundLeafException - - the expression refers to an undeclared variable or a relation not mapped by the instance
HigherOrderDeclException - - the expression contains a higher order declaration

evaluate

public static BooleanConstant evaluate(Formula formula,
                                       Instance instance,
                                       Options options)
Evaluates the given formula to a BooleanConstant using the provided instance and options.

Returns:
a BooleanConstant that represents the value of the formula.
Throws:
java.lang.NullPointerException - - formula = null || instance = null || options = null
UnboundLeafException - - the formula refers to an undeclared variable or a relation not mapped by the instance
HigherOrderDeclException - - the formula contains a higher order declaration

evaluate

public static BooleanMatrix evaluate(Expression expression,
                                     Instance instance,
                                     Options options)
Evaluates the given expression to a BooleanMatrix using the provided instance and options.

Returns:
a BooleanMatrix whose TRUE entries represent the tuples contained by the expression.
Throws:
java.lang.NullPointerException - - expression = null || instance = null || options = null
UnboundLeafException - - the expression refers to an undeclared variable or a relation not mapped by the instance
HigherOrderDeclException - - the expression contains a higher order declaration

evaluate

public static Int evaluate(IntExpression intExpr,
                           Instance instance,
                           Options options)
Evalutes the given intexpression to an Int using the provided instance and options.

Returns:
an Int representing the value of the intExpr with respect to the specified instance and options.
Throws:
java.lang.NullPointerException - - formula = null || instance = null || options = null
UnboundLeafException - - the expression refers to an undeclared variable or a relation not mapped by the instance
HigherOrderDeclException - - the expression contains a higher order declaration

translate

public static Translation translate(Formula formula,
                                    Bounds bounds,
                                    Options options)
                             throws TrivialFormulaException
Translates the given formula using the specified bounds and options.

Returns:
a Translation whose solver is a SATSolver instance initalized with the CNF representation of the given formula, with respect to the given bounds. The CNF is generated in such a way that the magnitutude of the literal representing the truth value of a given formula is strictly larger than the magnitudes of the literals representing the truth values of the formula's descendents.
Throws:
TrivialFormulaException - - the given formula is reduced to a constant during translation (i.e. the formula is trivially (un)satisfiable).
java.lang.NullPointerException - - any of the arguments are null
UnboundLeafException - - the formula refers to an undeclared variable or a relation not mapped by the given bounds.
HigherOrderDeclException - - the formula contains a higher order declaration that cannot be skolemized, or it can be skolemized but options.skolemize is false.