kodkod.ast
Class Decl

java.lang.Object
  extended by kodkod.ast.Decls
      extended by kodkod.ast.Decl
All Implemented Interfaces:
java.lang.Iterable<Decl>, Node

public final class Decl
extends Decls

A variable declaration, such as 'x : lone X'. Declarations are used with quantified formulas and comprehension expressions.

Author:
Emina Torlak
invariant:
variable.arity = expression.arity
children = variable + expression
specfield:
variable: Variable
expression: Expression
multiplicity: LONE + ONE + SOME + SET

Method Summary
<E,F,D,I> D
accept(ReturnVisitor<E,F,D,I> visitor)
          Accepts the given visitor and returns the result.
 void accept(VoidVisitor visitor)
          Accepts the given visitor.
 Expression expression()
          Returns the expression in this declaration.
 Multiplicity multiplicity()
          Returns the multiplicity in this declaration.
 java.lang.String toString()
          Returns the string representation of this decl.
 Variable variable()
          Returns the variable in this declaration.
 
Methods inherited from class kodkod.ast.Decls
and, declarations, iterator, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

variable

public Variable variable()
Returns the variable in this declaration.

Returns:
this.variable

multiplicity

public Multiplicity multiplicity()
Returns the multiplicity in this declaration.

Returns:
this.multiplicity

expression

public Expression expression()
Returns the expression in this declaration.

Returns:
this.exresssion

accept

public final <E,F,D,I> D accept(ReturnVisitor<E,F,D,I> visitor)
Accepts the given visitor and returns the result.

Specified by:
accept in interface Node
Overrides:
accept in class Decls
Returns:
the result of being visited by the given visitor
See Also:
Node.accept(kodkod.ast.visitor.ReturnVisitor)

accept

public void accept(VoidVisitor visitor)
Accepts the given visitor.

Specified by:
accept in interface Node
Overrides:
accept in class Decls
See Also:
Node.accept(kodkod.ast.visitor.VoidVisitor)

toString

public java.lang.String toString()
Returns the string representation of this decl.

Overrides:
toString in class Decls
Returns:
string representation of this decl