|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.ast.Expression
kodkod.ast.LeafExpression
kodkod.ast.Variable
public final class Variable
Represents a variable in a quantified formula
,
a comprehension expression
, or a sum expression
.
Two variables are the same if and only if they
refer to the same object. That is, v1.eauls(v2) <=> v1 == v2. Each
variable has a name, which is basically a comment for the purpose of
printing, viewing, etc. The name has no meaning otherwise. The arity of
a variable specifies the arity of expressions over which the variable can
range.
no children |
name: String |
arity: int |
Field Summary |
---|
Fields inherited from class kodkod.ast.Expression |
---|
IDEN, INTS, NONE, UNIV |
Method Summary | ||
---|---|---|
|
accept(ReturnVisitor<E,F,D,I> visitor)
Returns true of o is a BinaryFormula with the same tree structure as this. |
|
void |
accept(VoidVisitor visitor)
Accepts the given visitor. |
|
Decl |
declare(Multiplicity mult,
Expression expr)
Returns the declaration that constrains this variable to be bound to the specified number of the elements in the given expression: 'this: mult expr'. |
|
Decl |
loneOf(Expression expr)
Returns the declaration that constrains this variable to be bound to at most one element of the given expression: 'this: lone expr'. |
|
static Variable |
nary(java.lang.String name,
int arity)
Returns a new variable with the specified name and arity. |
|
Decl |
oneOf(Expression expr)
Returns the declaration that constrains this variable to be bound to exactly one element of the given expression: 'this: one expr'. |
|
Decl |
setOf(Expression expr)
Returns the declaration that constrains this variable to be bound to a subset of the elements in the given expression: 'this: set expr'. |
|
Decl |
someOf(Expression expr)
Returns the declaration that constrains this variable to be bound to at least one element of the given expression: 'this: some expr'. |
|
static Variable |
unary(java.lang.String name)
Returns a new variable with the specified name and arity 1. |
Methods inherited from class kodkod.ast.LeafExpression |
---|
arity, name, toString |
Methods inherited from class kodkod.ast.Expression |
---|
apply, apply, apply, closure, compose, compose, count, difference, eq, in, intersection, join, lone, no, one, override, product, project, reflexiveClosure, some, sum, transpose, union |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Variable unary(java.lang.String name)
this.name' = name && this.arity' = 1 |
public static Variable nary(java.lang.String name, int arity)
java.lang.IllegalArgumentException
- - arity < 1this.name' = name && this.arity' = arity |
public Decl loneOf(Expression expr)
java.lang.NullPointerException
- - expr = null
java.lang.IllegalArgumentException
- - this.arity != expr.arity || expr.arity != 1public Decl oneOf(Expression expr)
java.lang.NullPointerException
- - expr = null
java.lang.IllegalArgumentException
- - this.arity != expr.arity || expr.arity != 1public Decl someOf(Expression expr)
java.lang.NullPointerException
- - expr = null
java.lang.IllegalArgumentException
- - this.arity != expr.arity || expr.arity != 1public Decl setOf(Expression expr)
java.lang.NullPointerException
- - expr = null
java.lang.IllegalArgumentException
- - this.arity != expr.aritypublic Decl declare(Multiplicity mult, Expression expr)
java.lang.NullPointerException
- - expression = null || mult = null
java.lang.IllegalArgumentException
- - mult = NO
java.lang.IllegalArgumentException
- - mult in ONE + LONE + SOME && expr.arity != 1
java.lang.IllegalArgumentException
- - this.arity != expr.aritypublic <E,F,D,I> E accept(ReturnVisitor<E,F,D,I> visitor)
accept
in interface Node
accept
in class Expression
Node.accept(kodkod.ast.visitor.ReturnVisitor)
public void accept(VoidVisitor visitor)
Node.accept(kodkod.ast.visitor.VoidVisitor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |