|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.ast.Formula
public abstract class Formula
A first-order formula. Unless otherwise noted, all methods in this class throw a NullPointerException when given null arguments.
Implementation Note: The compose method performs constant folding, so that, for example, calling f.and(Formula.TRUE) returns f. If it is necessary to have a new Formula returned in such cases, then f.and(triviallyTrue) should be called instead, where triviallyTrue is a trivially true formula such as Expression.NONE.no().
Field Summary | |
---|---|
static Formula |
FALSE
Constant formula false |
static Formula |
TRUE
Constant formula true |
Method Summary | ||
---|---|---|
abstract
|
accept(ReturnVisitor<E,F,D,I> visitor)
Accepts the given visitor and returns the result. |
|
Formula |
and(Formula formula)
Returns the conjunction of this and the specified formula. |
|
Formula |
compose(BinaryFormula.Operator 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. |
|
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. |
|
Formula |
or(Formula formula)
Returns the conjunction of this and the specified formula. |
|
Formula |
quantify(QuantifiedFormula.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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface kodkod.ast.Node |
---|
accept |
Field Detail |
---|
public static final Formula TRUE
public static final Formula FALSE
Method Detail |
---|
public final Formula and(Formula formula)
public final Formula or(Formula formula)
public final Formula iff(Formula formula)
public final Formula implies(Formula formula)
public final Formula compose(BinaryFormula.Operator op, Formula formula)
public final Formula forAll(Decls decls)
public final Formula forSome(Decls decls)
public final Formula quantify(QuantifiedFormula.Quantifier quantifier, Decls decls)
public final Expression comprehension(Decls decls)
public final Expression thenElse(Expression thenExpr, Expression elseExpr)
public final IntExpression thenElse(IntExpression thenExpr, IntExpression elseExpr)
public final Formula not()
public abstract <E,F,D,I> F accept(ReturnVisitor<E,F,D,I> visitor)
accept
in interface Node
Node.accept(kodkod.ast.visitor.ReturnVisitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |