edu.mit.csail.sdg.alloy4compiler.translator
Class A4TupleSet

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4compiler.translator.A4TupleSet
All Implemented Interfaces:
java.lang.Iterable<A4Tuple>

public final class A4TupleSet
extends java.lang.Object
implements java.lang.Iterable<A4Tuple>

Immutable; represents a collection of Alloy tuples; comparison is by identity rather than by value.


Method Summary
 int arity()
          Returns the arity.
 kodkod.instance.TupleSet debugGetKodkodTupleset()
          Return the underlying Kodkod tupleset.
 A4TupleSet intersect(A4TupleSet that)
          Construct a new tupleset as the intersection of this and that; this and that must be come from the same solution.
 java.util.Iterator<A4Tuple> iterator()
          Returns a read-only iterator that iterates over each tuple in this TupleSet.
 A4TupleSet minus(A4TupleSet that)
          Construct a new tupleset as the subtraction of this and that; this and that must be come from the same solution.
 A4TupleSet plus(A4TupleSet that)
          Construct a new tupleset as the union of this and that; this and that must be come from the same solution.
 A4TupleSet product(A4TupleSet that)
          Construct a new tupleset as the product of this and that; this and that must be come from the same solution.
 int size()
          Returns the number of tuples in this tuple set.
 java.lang.String toString()
          Prints a human-readable description of this TupleSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

debugGetKodkodTupleset

public kodkod.instance.TupleSet debugGetKodkodTupleset()
Return the underlying Kodkod tupleset.


iterator

public java.util.Iterator<A4Tuple> iterator()
Returns a read-only iterator that iterates over each tuple in this TupleSet.

Specified by:
iterator in interface java.lang.Iterable<A4Tuple>

arity

public int arity()
Returns the arity.


size

public int size()
Returns the number of tuples in this tuple set.


product

public A4TupleSet product(A4TupleSet that)
                   throws ErrorAPI
Construct a new tupleset as the product of this and that; this and that must be come from the same solution.

Throws:
ErrorAPI

plus

public A4TupleSet plus(A4TupleSet that)
                throws ErrorAPI
Construct a new tupleset as the union of this and that; this and that must be come from the same solution. Note: if that==null, then the method returns this A4TupleSet as-is.

Throws:
ErrorAPI

minus

public A4TupleSet minus(A4TupleSet that)
                 throws ErrorAPI
Construct a new tupleset as the subtraction of this and that; this and that must be come from the same solution. Note: if that==null, then the method returns this A4TupleSet as-is.

Throws:
ErrorAPI

intersect

public A4TupleSet intersect(A4TupleSet that)
                     throws ErrorAPI
Construct a new tupleset as the intersection of this and that; this and that must be come from the same solution.

Throws:
ErrorAPI

toString

public java.lang.String toString()
Prints a human-readable description of this TupleSet.

Overrides:
toString in class java.lang.Object