Search in sources :

Example 86 with Variable

use of kodkod.ast.Variable in project org.alloytools.alloy by AlloyTools.

the class NUM374 method sumProductDistribution.

/**
 * Returns the sum_product_distribution axiom.
 *
 * @return sum_product_distribution
 */
public final Formula sumProductDistribution() {
    // ! [X,Y,Z] : product(X,sum(Y,Z)) = sum(product(X,Y),product(X,Z)) )).
    final Variable x = Variable.unary("X");
    final Variable y = Variable.unary("Y");
    final Variable z = Variable.unary("Z");
    return product(x, sum(y, z)).eq(sum(product(x, y), product(x, z))).forAll(x.oneOf(UNIV).and(y.oneOf(UNIV)).and(z.oneOf(UNIV)));
}
Also used : Variable(kodkod.ast.Variable)

Example 87 with Variable

use of kodkod.ast.Variable in project org.alloytools.alloy by AlloyTools.

the class NUM374 method exponentProductDistribution.

/**
 * Returns the exponent_product_distribution axiom.
 *
 * @return exponent_product_distribution
 */
public final Formula exponentProductDistribution() {
    // ! [X,Y,Z] : exponent(product(X,Y),Z) =
    // product(exponent(X,Z),exponent(Y,Z))
    final Variable x = Variable.unary("X");
    final Variable y = Variable.unary("Y");
    final Variable z = Variable.unary("Z");
    return exponent(product(x, y), z).eq(product(exponent(x, z), exponent(y, z))).forAll(x.oneOf(UNIV).and(y.oneOf(UNIV)).and(z.oneOf(UNIV)));
}
Also used : Variable(kodkod.ast.Variable)

Example 88 with Variable

use of kodkod.ast.Variable in project org.alloytools.alloy by AlloyTools.

the class NUM374 method symmetric.

/**
 * Returns all X, Y: Num | op[X][Y] = op[Y][X]
 *
 * @return all X, Y: Num | op[X][Y] = op[Y][X]
 */
final Formula symmetric(Relation op) {
    // all X, Y: Num | op[X][Y] = op[Y][X]
    final Variable x = Variable.unary("X");
    final Variable y = Variable.unary("Y");
    return apply(op, x, y).eq(apply(op, y, x)).forAll(x.oneOf(UNIV).and(y.oneOf(UNIV)));
}
Also used : Variable(kodkod.ast.Variable)

Example 89 with Variable

use of kodkod.ast.Variable in project org.alloytools.alloy by AlloyTools.

the class SET948 method t97_zfmisc_1.

/**
 * Returns t97_zfmisc_1 axiom.
 *
 * @return t97_zfmisc_1
 */
public final Formula t97_zfmisc_1() {
    final Variable a = Variable.unary("A");
    final Variable b = Variable.unary("B");
    return subset(union(set_intersection2(a, b)), set_intersection2(union(a), union(b))).forAll(a.oneOf(UNIV).and(b.oneOf(UNIV)));
}
Also used : Variable(kodkod.ast.Variable)

Example 90 with Variable

use of kodkod.ast.Variable in project org.alloytools.alloy by AlloyTools.

the class SET948 method d3_xboole_0.

/**
 * Returns d3_xboole_0 axiom.
 *
 * @return d3_xboole_0
 */
public final Formula d3_xboole_0() {
    final Variable a = Variable.unary("A");
    final Variable b = Variable.unary("B");
    final Variable c = Variable.unary("C");
    return c.eq(set_intersection2(a, b)).iff(in.join(c).eq(in.join(a).intersection(in.join(b)))).forAll(a.oneOf(UNIV).and(b.oneOf(UNIV)).and(c.oneOf(UNIV)));
}
Also used : Variable(kodkod.ast.Variable)

Aggregations

Variable (kodkod.ast.Variable)221 Formula (kodkod.ast.Formula)151 Expression (kodkod.ast.Expression)80 Decls (kodkod.ast.Decls)24 Solution (kodkod.engine.Solution)24 Relation (kodkod.ast.Relation)23 IntExpression (kodkod.ast.IntExpression)22 Bounds (kodkod.instance.Bounds)21 Universe (kodkod.instance.Universe)21 ArrayList (java.util.ArrayList)19 TupleFactory (kodkod.instance.TupleFactory)19 TupleSet (kodkod.instance.TupleSet)15 Solver (kodkod.engine.Solver)14 Decl (kodkod.ast.Decl)12 QuantifiedFormula (kodkod.ast.QuantifiedFormula)10 Test (org.junit.Test)10 Instance (kodkod.instance.Instance)8 BinaryExpression (kodkod.ast.BinaryExpression)5 SumExpression (kodkod.ast.SumExpression)3 Expr (edu.mit.csail.sdg.ast.Expr)2