Search in sources :

Example 36 with TupleFactory

use of kodkod.instance.TupleFactory in project org.alloytools.alloy by AlloyTools.

the class MED001 method bounds.

/**
 * Returns bounds for the given scope.
 *
 * @return bounds for the given scope.
 */
public final Bounds bounds(int n) {
    assert n > 0;
    final List<String> atoms = new ArrayList<String>(n);
    for (int i = 0; i < n; i++) atoms.add("a" + i);
    final Universe u = new Universe(atoms);
    final Bounds b = new Bounds(u);
    final TupleFactory f = u.factory();
    final TupleSet s = f.allOf(1);
    b.bound(bcapacityne, s);
    b.bound(bcapacityex, s);
    b.bound(bcapacitysn, s);
    b.bound(conditionhyper, s);
    b.bound(conditionhypo, s);
    b.bound(conditionnormo, s);
    b.bound(drugi, s);
    b.bound(uptakelg, s);
    b.bound(uptakepg, s);
    b.bound(releaselg, s);
    b.bound(bsecretioni, s);
    b.bound(drugbg, s);
    b.bound(qilt27, s);
    b.bound(s0, s);
    b.bound(s1, s);
    b.bound(s2, s);
    b.bound(s3, s);
    b.bound(drugsu, s);
    b.bound(n0, s);
    b.bound(gt, f.allOf(2));
    return b;
}
Also used : TupleSet(kodkod.instance.TupleSet) Bounds(kodkod.instance.Bounds) ArrayList(java.util.ArrayList) TupleFactory(kodkod.instance.TupleFactory) Universe(kodkod.instance.Universe)

Example 37 with TupleFactory

use of kodkod.instance.TupleFactory in project org.alloytools.alloy by AlloyTools.

the class SET948 method bounds.

/**
 * Returns bounds for the given scope.
 *
 * @return bounds for the given scope.
 */
public final Bounds bounds(int n) {
    assert n > 0;
    final List<String> atoms = new ArrayList<String>(n);
    for (int i = 0; i < n; i++) atoms.add("a" + i);
    final Universe u = new Universe(atoms);
    final Bounds b = new Bounds(u);
    final TupleFactory f = u.factory();
    b.bound(empty, f.allOf(1));
    b.bound(subset, f.allOf(2));
    b.bound(in, f.allOf(2));
    b.bound(disjoint, f.allOf(2));
    b.bound(union, f.allOf(2));
    b.bound(intersect2, f.allOf(3));
    b.bound(union2, f.allOf(3));
    return b;
}
Also used : Bounds(kodkod.instance.Bounds) ArrayList(java.util.ArrayList) TupleFactory(kodkod.instance.TupleFactory) Universe(kodkod.instance.Universe)

Example 38 with TupleFactory

use of kodkod.instance.TupleFactory in project org.alloytools.alloy by AlloyTools.

the class MGT066 method bounds.

/**
 * Returns a bounds for a universe of the given size.
 *
 * @return bounds for a universe of the given size.
 */
public final Bounds bounds(int size) {
    assert size > 0;
    final List<String> atoms = new ArrayList<String>(size);
    for (int i = 0; i < size; i++) atoms.add("a" + i);
    final Universe u = new Universe(atoms);
    final TupleFactory f = u.factory();
    final Bounds b = new Bounds(u);
    b.bound(lt, f.allOf(2));
    b.bound(leq, f.allOf(2));
    b.bound(gt, f.allOf(2));
    b.bound(geq, f.allOf(2));
    return b;
}
Also used : Bounds(kodkod.instance.Bounds) ArrayList(java.util.ArrayList) TupleFactory(kodkod.instance.TupleFactory) Universe(kodkod.instance.Universe)

Example 39 with TupleFactory

use of kodkod.instance.TupleFactory in project org.alloytools.alloy by AlloyTools.

the class SET943 method bounds.

/**
 * Returns bounds for the given scope.
 *
 * @return bounds for the given scope.
 */
public final Bounds bounds(int n) {
    assert n > 0;
    final List<String> atoms = new ArrayList<String>(n);
    for (int i = 0; i < n; i++) atoms.add("a" + i);
    final Universe u = new Universe(atoms);
    final Bounds b = new Bounds(u);
    final TupleFactory f = u.factory();
    b.bound(empty, f.allOf(1));
    b.bound(subset, f.allOf(2));
    b.bound(in, f.allOf(2));
    b.bound(union, f.allOf(2));
    b.bound(union2, f.allOf(3));
    return b;
}
Also used : Bounds(kodkod.instance.Bounds) ArrayList(java.util.ArrayList) TupleFactory(kodkod.instance.TupleFactory) Universe(kodkod.instance.Universe)

Example 40 with TupleFactory

use of kodkod.instance.TupleFactory in project org.alloytools.alloy by AlloyTools.

the class SET967 method bounds.

/**
 * Returns bounds for the given scope.
 *
 * @return bounds for the given scope.
 */
public final Bounds bounds(int n) {
    assert n > 0;
    final List<String> atoms = new ArrayList<String>(n);
    for (int i = 0; i < n; i++) atoms.add("a" + i);
    final Universe u = new Universe(atoms);
    final Bounds b = new Bounds(u);
    final TupleFactory f = u.factory();
    b.bound(empty, f.allOf(1));
    b.bound(subset, f.allOf(2));
    b.bound(in, f.allOf(2));
    b.bound(disjoint, f.allOf(2));
    b.bound(union, f.allOf(2));
    b.bound(singleton, f.allOf(2));
    b.bound(intersect2, f.allOf(3));
    b.bound(cartesian2, f.allOf(3));
    b.bound(union2, f.allOf(3));
    b.bound(ordered, f.allOf(3));
    b.bound(unordered, f.allOf(3));
    return b;
}
Also used : Bounds(kodkod.instance.Bounds) ArrayList(java.util.ArrayList) TupleFactory(kodkod.instance.TupleFactory) Universe(kodkod.instance.Universe)

Aggregations

TupleFactory (kodkod.instance.TupleFactory)85 Universe (kodkod.instance.Universe)77 Bounds (kodkod.instance.Bounds)76 TupleSet (kodkod.instance.TupleSet)55 ArrayList (java.util.ArrayList)45 Relation (kodkod.ast.Relation)45 Formula (kodkod.ast.Formula)35 Solution (kodkod.engine.Solution)30 Solver (kodkod.engine.Solver)25 IntExpression (kodkod.ast.IntExpression)20 Expression (kodkod.ast.Expression)19 Variable (kodkod.ast.Variable)19 Instance (kodkod.instance.Instance)15 Decls (kodkod.ast.Decls)11 Evaluator (kodkod.engine.Evaluator)9 Tuple (kodkod.instance.Tuple)8 LinkedList (java.util.LinkedList)4 LinkedHashSet (java.util.LinkedHashSet)3 Map (java.util.Map)2 Set (java.util.Set)2