|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkodkod.instance.Bounds
public final class Bounds
A Bounds object maps a relation
r to two
sets of tuples
, rL and rU, which represent the lower and upper
bounds on the set of tuples
to which an instance
based on these bounds may map r. The set rL represents all the tuples
that a given relation must contain. The set rU represents all the tuples
that a relation may contain. All bounding sets range over the same universe
.
A Bounds object also maps integers to singleton tupleset that represent them. A tupleset may represent more than one integer, but an integer is represented by at most one tupleset.
all i: intBound.TupleSet | intBound[i].size() = 1 && intBound[i].arity() = 1 |
lowerBound[relations].universe = upperBound[relations].universe = universe |
all r: relations | lowerBound[r].arity = upperBound[r].arity = r.arity |
all r: relations | lowerBound[r].tuples in upperBound[r].tuples |
universe: Universe |
relations: set Relation |
intBound: int -> lone TupleSet |
lowerBound: relations -> one TupleSet |
upperBound: relations -> one TupleSet |
Constructor Summary | |
---|---|
Bounds(Universe universe)
Constructs new Bounds over the given universe. |
Method Summary | |
---|---|
void |
bound(Relation r,
TupleSet upper)
Makes the specified tupleset the upper bound on the contents of the given relation. |
void |
bound(Relation r,
TupleSet lower,
TupleSet upper)
Sets the lower and upper bounds for the given relation. |
void |
boundExactly(int i,
TupleSet ibound)
Makes the specified tupleset an exact bound on the relational value that corresponds to the given integer. |
void |
boundExactly(Relation r,
TupleSet tuples)
Sets both the lower and upper bounds of the given relation to the given set of tuples. |
Bounds |
clone()
Returns a deep copy of this Bounds object. |
TupleSet |
exactBound(int i)
Returns the set of tuples representing the given integer. |
SparseSequence<TupleSet> |
intBounds()
Returns a sparse sequence view of this.intBound. |
IntSet |
ints()
Returns the set of all integers bound by this Bounds. |
TupleSet |
lowerBound(Relation r)
Returns the set of tuples that r must contain (the lower bound on r's contents). |
java.util.Map<Relation,TupleSet> |
lowerBounds()
Returns a map view of this.lowerBound. |
java.util.Set<Relation> |
relations()
Returns the set of all relations bound by this Bounds. |
java.lang.String |
toString()
|
Universe |
universe()
Returns this.universe. |
Bounds |
unmodifiableView()
Returns an unmodifiable view of this Bounds object. |
TupleSet |
upperBound(Relation r)
Returns the set of tuples that r may contain (the upper bound on r's contents). |
java.util.Map<Relation,TupleSet> |
upperBounds()
Returns a map view of this.upperBound. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Bounds(Universe universe)
java.lang.NullPointerException
- - universe = nullthis.universe' = universe && no this.relations' && no this.intBound' |
Method Detail |
---|
public Universe universe()
public java.util.Set<Relation> relations()
public IntSet ints()
public TupleSet lowerBound(Relation r)
public java.util.Map<Relation,TupleSet> lowerBounds()
public TupleSet upperBound(Relation r)
public java.util.Map<Relation,TupleSet> upperBounds()
public TupleSet exactBound(int i)
public SparseSequence<TupleSet> intBounds()
public void boundExactly(Relation r, TupleSet tuples)
java.lang.NullPointerException
- - r = null || tuples = null
java.lang.IllegalArgumentException
- - tuples.arity != r.arity || tuples.universe != this.universethis.relations' = this.relations + r
this.lowerBound' = this.lowerBound' ++ r->tuples &&
this.upperBound' = this.lowerBound' ++ r->tuples |
tuples.arity = r.arity && tuples.universe = this.universe |
public void bound(Relation r, TupleSet lower, TupleSet upper)
java.lang.NullPointerException
- - r = null || lower = null || upper = null
java.lang.IllegalArgumentException
- - lower.arity != r.arity || upper.arity != r.arity
java.lang.IllegalArgumentException
- - lower.universe != this.universe || upper.universe != this.universe
java.lang.IllegalArgumentException
- - lower.tuples !in upper.tuplesthis.relations' = this.relations + r &&
this.lowerBound' = this.lowerBound ++ r->lower &&
this.upperBound' = this.upperBound ++ r->upper |
lower.tuples in upper.tuples && lower.arity = upper.arity = r.arity &&
lower.universe = upper.universe = this.universe |
public void bound(Relation r, TupleSet upper)
java.lang.NullPointerException
- - r = null || upper = null
java.lang.IllegalArgumentException
- - upper.arity != r.arity || upper.universe != this.universethis.relations' = this.relations + r
this.lowerBound' = this.lowerBound ++ r->{s: TupleSet | s.universe = this.universe && s.arity = r.arity && no s.tuples} &&
this.upperBound' = this.upperBound ++ r->upper |
upper.arity = r.arity && upper.universe = this.universe |
public void boundExactly(int i, TupleSet ibound)
java.lang.NullPointerException
- - ibound = null
java.lang.IllegalArgumentException
- - ibound.arity != 1 || ibound.size() != 1
java.lang.IllegalArgumentException
- - ibound.universe != this.universethis.intBound' = this.intBound' ++ i -> ibound |
ibound.arity = 1 && i.bound.size() = 1 |
public Bounds unmodifiableView()
public Bounds clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |