kodkod.ast
Class RelationPredicate

java.lang.Object
  extended by kodkod.ast.Formula
      extended by kodkod.ast.RelationPredicate
All Implemented Interfaces:
Node
Direct Known Subclasses:
RelationPredicate.Acyclic, RelationPredicate.Function, RelationPredicate.TotalOrdering

public abstract class RelationPredicate
extends Formula

Represents common predicates on relations; e.g. predicates stating that a relation is a total function, partial function, acyclic, or a total ordering over a set of atoms.

Author:
Emina Torlak
invariant:
relation.arity = 2
specfield:
relation: Relation
name: Name // name of the predicate

Nested Class Summary
static class RelationPredicate.Acyclic
          Represents the acyclic predicate.
static class RelationPredicate.Function
          Represents the function predicate.
static class RelationPredicate.Name
          The name of the predicate.
static class RelationPredicate.TotalOrdering
          Represents the total ordering predicate.
 
Field Summary
 
Fields inherited from class kodkod.ast.Formula
FALSE, TRUE
 
Method Summary
<E,F,D,I> F
accept(ReturnVisitor<E,F,D,I> visitor)
          Accepts the given visitor and returns the result.
 void accept(VoidVisitor visitor)
          Accepts the given visitor.
abstract  RelationPredicate.Name name()
          Returns the name of this predicate.
 Relation relation()
          Returns the relation to which this predicate applies.
abstract  Formula toConstraints()
          Turns this predicate into explicit constraiants.
 
Methods inherited from class kodkod.ast.Formula
and, compose, comprehension, forAll, forSome, iff, implies, not, or, quantify, thenElse, thenElse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

relation

public Relation relation()
Returns the relation to which this predicate applies.

Returns:
this.relation

name

public abstract RelationPredicate.Name name()
Returns the name of this predicate.

Returns:
this.name

toConstraints

public abstract Formula toConstraints()
Turns this predicate into explicit constraiants.

Returns:
{f: Formula - RelationPredicate | f <=> this }

accept

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

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

accept

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

See Also:
Node.accept(kodkod.ast.visitor.VoidVisitor)