Java Code Examples for kodkod.instance.Bounds#upperBounds()

The following examples show how to use kodkod.instance.Bounds#upperBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LeafInterpreter.java    From org.alloytools.alloy with Apache License 2.0 3 votes vote down vote up
/**
 * Returns an exact interpreter for the given bounds and options. If
 * {@code incremental} is <code>true</code>, then the resulting interpreter can
 * be {@linkplain #extend(Set, Map, Map) extended} with new bindings. Otherwise,
 * the interpreter will throw an exception if extension is attempted.
 *
 * @return some l: LeafInterpreter | l.universe = bounds.universe && l.relations
 *         = bounds.relations() && l.ints = bounds.ints() && l.lbounds =
 *         bounds.lowerBound && l.ubounds = bounds.upperBound && l.ibounds =
 *         bounds.intBound && l.factory = BooleanFactory.factory(sum(r:
 *         l.relations | #(l.ubounds[r]-l.lbounds[r]))-1, options) &&
 *         l.vars[relations] = l.factory & BooleanVariable
 */
static final LeafInterpreter exact(Bounds bounds, Options options, boolean incremental) {
    final Map<Relation,IntRange> vars = new LinkedHashMap<Relation,IntRange>();
    final Map<Relation,TupleSet> lowers = incremental ? new LinkedHashMap<Relation,TupleSet>(bounds.lowerBounds()) : bounds.lowerBounds();
    final Map<Relation,TupleSet> uppers = incremental ? new LinkedHashMap<Relation,TupleSet>(bounds.upperBounds()) : bounds.upperBounds();
    final int numVars = allocateVars(1, vars, bounds.relations(), lowers, uppers);
    return new LeafInterpreter(bounds.universe(), lowers, uppers, bounds.intBounds(), BooleanFactory.factory(numVars, options), vars);
}
 
Example 2
Source File: LeafInterpreter.java    From kodkod with MIT License 3 votes vote down vote up
/**  
 * Returns an exact interpreter for the given bounds and options. If {@code incremental}  is <code>true</code>, 
 * then the resulting interpreter can be {@linkplain #extend(Set, Map, Map) extended} with new bindings.  
 * Otherwise, the interpreter will throw an exception if extension is attempted.
 * @return some l: LeafInterpreter | l.universe = bounds.universe && l.relations = bounds.relations() && 
 *          l.ints = bounds.ints() && l.lbounds = bounds.lowerBound && l.ubounds = bounds.upperBound && 
 *          l.ibounds = bounds.intBound && 
 *          l.factory = BooleanFactory.factory(sum(r: l.relations | #(l.ubounds[r]-l.lbounds[r]))-1, options) &&
 *          l.vars[relations] = l.factory & BooleanVariable
 */
static final LeafInterpreter exact(Bounds bounds, Options options, boolean incremental) {
	final Map<Relation, IntRange> vars = new LinkedHashMap<Relation,IntRange>();
	final Map<Relation, TupleSet> lowers = incremental ? new LinkedHashMap<Relation, TupleSet>(bounds.lowerBounds()) : bounds.lowerBounds();
	final Map<Relation, TupleSet> uppers = incremental ? new LinkedHashMap<Relation, TupleSet>(bounds.upperBounds()) : bounds.upperBounds();
	final int numVars = allocateVars(1, vars, bounds.relations(), lowers, uppers);
	return new LeafInterpreter(bounds.universe(), lowers, uppers, bounds.intBounds(), BooleanFactory.factory(numVars, options), vars);
}
 
Example 3
Source File: LeafInterpreter.java    From org.alloytools.alloy with Apache License 2.0 2 votes vote down vote up
/**
 * Returns an overapproximating interpreter for the given bounds and options.
 *
 * @return some l: LeafInterpreter | l.universe = bounds.universe && l.relations
 *         = bounds.relations() && l.ints = bounds.ints() && l.lbounds =
 *         l.ubounds = bounds.upperBound && l.ibounds = bounds.intBound &&
 *         l.factory = BooleanFactory.constantFactory(options) && no l.vars
 */
static final LeafInterpreter overapproximating(Bounds bounds, Options options) {
    return new LeafInterpreter(bounds.universe(), bounds.upperBounds(), bounds.intBounds(), options);
}
 
Example 4
Source File: LeafInterpreter.java    From kodkod with MIT License 2 votes vote down vote up
/**
 * Returns an overapproximating interpreter for the given bounds and options.
 * @return some l: LeafInterpreter | l.universe = bounds.universe && l.relations = bounds.relations() && 
 *           l.ints = bounds.ints() && l.lbounds = l.ubounds = bounds.upperBound && 
 *           l.ibounds = bounds.intBound && l.factory = BooleanFactory.constantFactory(options) && no l.vars 
 */
static final LeafInterpreter overapproximating(Bounds bounds, Options options) {
	return new LeafInterpreter(bounds.universe(), bounds.upperBounds(), bounds.intBounds(), options);
}