public abstract class Formula extends Node
Modifier and Type | Field and Description |
---|---|
static Formula |
FALSE
Constant formula false
|
static Formula |
TRUE
Constant formula true
|
Modifier and Type | Method and Description |
---|---|
abstract <E,F,D,I> F |
accept(ReturnVisitor<E,F,D,I> visitor)
Accepts the given visitor and returns the result.
|
static Formula |
and(Collection<? extends Formula> formulas)
Returns the conjunction of the given formulas.
|
static Formula |
and(Formula... formulas)
Returns the conjunction of the given formulas.
|
Formula |
and(Formula formula)
Returns the conjunction of this and the specified formula.
|
static Formula |
compose(FormulaOperator op,
Collection<? extends Formula> formulas)
Returns the composition of the given formulas using the given operator.
|
static Formula |
compose(FormulaOperator op,
Formula... formulas)
Returns the composition of the given formulas using the given operator.
|
Formula |
compose(FormulaOperator op,
Formula formula)
Returns the composition of this and the specified formula using the
given binary operator.
|
Expression |
comprehension(Decls decls)
Returns the comprehension expression constructed from this formula and
the given declarations.
|
static Formula |
constant(boolean value)
Returns the constant formula with the given value.
|
Formula |
forAll(Decls decls)
Returns a formula that represents a universal quantification of this
formula over the given declarations.
|
Formula |
forSome(Decls decls)
Returns a formula that represents an existential quantification of this
formula over the given declarations.
|
Formula |
iff(Formula formula)
Returns a formula that equates this and the specified formula.
|
Formula |
implies(Formula formula)
Returns the implication of the specified formula by this.
|
Formula |
not()
Returns the negation of this formula.
|
static Formula |
or(Collection<? extends Formula> formulas)
Returns the disjunction of the given formulas.
|
static Formula |
or(Formula... formulas)
Returns the disjunction of the given formulas.
|
Formula |
or(Formula formula)
Returns the conjunction of this and the specified formula.
|
Formula |
quantify(Quantifier quantifier,
Decls decls)
Returns a quantification of this formula using the given quantifier over
the specified declarations.
|
Expression |
thenElse(Expression thenExpr,
Expression elseExpr)
Returns the if expression constructed from this formula and the
specified then and else expressions.
|
IntExpression |
thenElse(IntExpression thenExpr,
IntExpression elseExpr)
Returns the if expression constructed from this formula and the
specified then and else integer expressions.
|
public static final Formula FALSE
public static final Formula TRUE
public abstract <E,F,D,I> F accept(ReturnVisitor<E,F,D,I> visitor)
accept
in class Node
Node.accept(kodkod.ast.visitor.ReturnVisitor)
public static Formula and(Collection<? extends Formula> formulas)
public static Formula and(Formula... formulas)
public final Formula and(Formula formula)
public static Formula compose(FormulaOperator op, Collection<? extends Formula> formulas)
formulas.size() != 2 => op.nary()
formulas.size() = 0 => constant(op=AND) else formulas.size() = 1 => formulas.iterator().next() else {e: Formula | e.children = formulas.toArray() and e.op = this }
public static Formula compose(FormulaOperator op, Formula... formulas)
formulas.length != 2 => op.nary()
formulas.length = 0 => constant(op=AND) else formulas.length=1 => formulas[0] else {e: Formula | e.children = formulas and e.op = this }
public final Formula compose(FormulaOperator op, Formula formula)
public final Expression comprehension(Decls decls)
all d: decls.decls[int] | decl.variable.arity = 1 and decl.multiplicity = ONE
public static Formula constant(boolean value)
public final Formula forAll(Decls decls)
public final Formula forSome(Decls decls)
public final Formula iff(Formula formula)
public final Formula implies(Formula formula)
public final Formula not()
public static Formula or(Collection<? extends Formula> formulas)
public static Formula or(Formula... formulas)
public final Formula or(Formula formula)
public final Formula quantify(Quantifier quantifier, Decls decls)
public final Expression thenElse(Expression thenExpr, Expression elseExpr)
public final IntExpression thenElse(IntExpression thenExpr, IntExpression elseExpr)
© Emina Torlak 2005-present