Пример #1
0
 /**
  * Sets the lower and upper bounds for the given relation.
  *
  * @requires lower.tuples in upper.tuples && lower.arity = upper.arity = r.arity && lower.universe
  *     = upper.universe = this.universe
  * @ensures this.relations' = this.relations + r && this.lowerBound' = this.lowerBound ++ r->lower
  *     && this.upperBound' = this.upperBound ++ r->upper
  * @throws NullPointerException r = null || lower = null || upper = null
  * @throws IllegalArgumentException lower.arity != r.arity || upper.arity != r.arity
  * @throws IllegalArgumentException lower.universe != this.universe || upper.universe !=
  *     this.universe
  * @throws IllegalArgumentException lower.tuples !in upper.tuples
  */
 public void bound(Relation r, TupleSet lower, TupleSet upper) {
   if (!upper.containsAll(lower))
     throw new IllegalArgumentException("lower.tuples !in upper.tuples");
   if (upper.size() == lower.size()) {
     // upper.containsAll(lower) && upper.size()==lower.size() => upper.equals(lower)
     boundExactly(r, lower);
   } else {
     checkBound(r.arity(), lower);
     checkBound(r.arity(), upper);
     lowers.put(r, lower.clone().unmodifiableView());
     uppers.put(r, upper.clone().unmodifiableView());
   }
 }
Пример #2
0
 /**
  * Makes the specified tupleset an exact bound on the relational value that corresponds to the
  * given integer.
  *
  * @requires ibound.arity = 1 && i.bound.size() = 1
  * @ensures this.intBound' = this.intBound' ++ i -> ibound
  * @throws NullPointerException ibound = null
  * @throws IllegalArgumentException ibound.arity != 1 || ibound.size() != 1
  * @throws IllegalArgumentException ibound.universe != this.universe
  */
 public void boundExactly(int i, TupleSet ibound) {
   checkBound(1, ibound);
   if (ibound.size() != 1) throw new IllegalArgumentException("ibound.size != 1: " + ibound);
   intbounds.put(i, ibound.clone().unmodifiableView());
 }