Represents an ordered set of unique atoms. Objects used as atoms must properly implement {@link java.lang.Object#equals equals} and {@link java.lang.Object#hashCode hashCode}methods. The behavior of a universe is not specified if the value of an object is changed in a manner that affects equals comparisons while the object is an atom in the universe.
Each universe provides a {@link kodkod.instance.TupleFactory tuple factory}to facilitate creation of {@link kodkod.instance.Tuple tuples} and {@link kodkod.instance.TupleSet sets of tuples} based on the atoms in the universe.
Implementation Note: although the atoms in a universe are not interpreted in any way by the Kodkod engine, it is strongly recommended that the atoms of the same 'type' be grouped together. For instance, suppose that a client model is specified in terms of disjoint types Person={Person0, Person1, Person2} and Dog={Dog0, Dog1}. Then, the client may observe an improvement in performance if he constructs the universe over the sequences {Person0, Person1, Person2, Dog0, Dog1} or {Dog0, Dog1, Person0, Person1, Person2} rather than any other permutation of these five atoms. @specfield size: int @specfield atoms: [0..size)->one Object @specfield factory: TupleFactory @invariant factory = (TupleFactory<:universe).this @invariant size> 0 @author Emina Torlak
|
|
|
|