Search in sources :

Example 81 with Variable

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

the class MED001 method insulin_effect.

/**
 * Returns the insulin_effect axiom.
 *
 * @return insulin_effect
 */
public final Formula insulin_effect() {
    final Variable x0 = Variable.unary("X0");
    final Expression x1 = UNIV.difference(x0.join(gt));
    return x1.in(drugi).implies(x1.in(uptakelg.intersection(uptakepg))).forAll(x0.oneOf(UNIV));
}
Also used : Variable(kodkod.ast.Variable) Expression(kodkod.ast.Expression)

Example 82 with Variable

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

the class MED001 method sulfonylurea_effect.

/**
 * Returns the sulfonylurea_effect axiom.
 *
 * @return sulfonylurea_effect
 */
public final Formula sulfonylurea_effect() {
    final Variable x0 = Variable.unary("X0");
    final Expression x1 = UNIV.difference(x0.join(gt));
    return x1.in(drugi).and(x0.in(bcapacityex).not()).implies(x1.in(bsecretioni)).forAll(x0.oneOf(UNIV));
}
Also used : Variable(kodkod.ast.Variable) Expression(kodkod.ast.Expression)

Example 83 with Variable

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

the class MED009 method transsls2_qige27.

/**
 * Returns transsls2_qige27 conjecture.
 *
 * @return transsls2_qige27
 */
public final Formula transsls2_qige27() {
    final Variable x0 = Variable.unary("X0");
    final Formula f0 = n0.in(s1).and(n0.join(gt).in(conditionhyper)).and(n0.in(bcapacitysn).not()).and(n0.in(qilt27).not());
    final Formula f1 = n0.product(x0).in(gt).not().and(x0.in(s2)).and(x0.join(gt).in(conditionhyper)).and(x0.in(bcapacityne.union(bcapacityex))).forSome(x0.oneOf(UNIV));
    return f0.implies(f1);
}
Also used : Formula(kodkod.ast.Formula) Variable(kodkod.ast.Variable)

Example 84 with Variable

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

the class NUM374 method associative.

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

Example 85 with Variable

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

the class NUM374 method wilkie.

/**
 * Returns the wilkie conjecture.
 *
 * @return wilkie
 */
public final Formula wilkie() {
    // ! [C,P,Q,R,S,A,B] :
    // ( ( C = product(A,A)
    // & P = sum(n1,A)
    // & Q = sum(P,C)
    // & R = sum(n1,product(A,C))
    // & S = sum(sum(n1,C),product(C,C)) )
    // =>
    // product(exponent(sum(exponent(P,A),exponent(Q,A)),B),exponent(sum(exponent(R,B),exponent(S,B)),A))
    // =
    // product(exponent(sum(exponent(P,B),exponent(Q,B)),A),exponent(sum(exponent(R,A),exponent(S,A)),B))
    // ) )).
    final Variable c = Variable.unary("C");
    final Variable p = Variable.unary("P");
    final Variable q = Variable.unary("Q");
    final Variable r = Variable.unary("R");
    final Variable s = Variable.unary("S");
    final Variable a = Variable.unary("A");
    final Variable b = Variable.unary("B");
    final Formula f0 = c.eq(product(a, a));
    final Formula f1 = p.eq(sum(n1, a));
    final Formula f2 = q.eq(sum(p, c));
    final Formula f3 = r.eq(sum(n1, product(a, c)));
    final Formula f4 = s.eq(sum(sum(n1, c), product(c, c)));
    final Expression e0 = product(exponent(sum(exponent(p, a), exponent(q, a)), b), exponent(sum(exponent(r, b), exponent(s, b)), a));
    final Expression e1 = product(exponent(sum(exponent(p, b), exponent(q, b)), a), exponent(sum(exponent(r, a), exponent(s, a)), b));
    final Formula f5 = e0.eq(e1);
    return (f0.and(f1).and(f2).and(f3).and(f4)).implies(f5).forAll(c.oneOf(UNIV).and(p.oneOf(UNIV)).and(q.oneOf(UNIV)).and(r.oneOf(UNIV)).and(s.oneOf(UNIV)).and(a.oneOf(UNIV)).and(b.oneOf(UNIV)));
}
Also used : Formula(kodkod.ast.Formula) Variable(kodkod.ast.Variable) Expression(kodkod.ast.Expression)

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