Search in sources :

Example 36 with Formula

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

the class AbstractWorldDefinitions method AbOp_total.

/**
 * Returns the AbOp_total assertion.
 *
 * @return AbOp_total assertion
 */
public Formula AbOp_total() {
    final Variable a = Variable.unary("a");
    final Variable a_in = Variable.unary("a_in");
    final Formula f0 = Abstract(a).implies(AbIgnore(a, a, aNullOut).and(AbTransfer(a, a, a_in, aNullOut)));
    final Formula f1 = f0.forAll(a.oneOf(AbWorld).and(a_in.oneOf(AIN)));
    return f1;
}
Also used : Formula(kodkod.ast.Formula) Variable(kodkod.ast.Variable)

Example 37 with Formula

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

the class AbstractWorldDefinitions method XiAbPurse.

/**
 * Returns the application of the XiAbPurse predicate.
 *
 * @return application of the XiAbPurse predicate.
 */
public Formula XiAbPurse(Expression s, Expression sprime, Expression a) {
    final Expression aRestrict = a.product(Expression.UNIV);
    final Formula f0 = aRestrict.intersection(abBalance.join(s)).eq(aRestrict.intersection(abBalance.join(sprime)));
    final Formula f1 = aRestrict.intersection(abLost.join(s)).eq(aRestrict.intersection(abLost.join(sprime)));
    return f0.and(f1);
}
Also used : Formula(kodkod.ast.Formula) Expression(kodkod.ast.Expression)

Example 38 with Formula

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

the class AbstractWorldDefinitions method XiTransfer.

/**
 * Applies the XiTransfer predicate to the arguments.
 *
 * @return application of the XiTransfer predicate to the arguments.
 */
public final Formula XiTransfer(Expression p, Expression pprime) {
    final Formula f0 = p.join(from).eq(pprime.join(from));
    final Formula f1 = p.join(to).eq(pprime.join(to));
    final Formula f2 = p.join(value).eq(pprime.join(value));
    return Formula.and(f0, f1, f2);
}
Also used : Formula(kodkod.ast.Formula)

Example 39 with Formula

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

the class AbstractWorldDefinitions method AbTransferLost.

/**
 * Returns the application of the AbTransferLost predicate.
 *
 * @return application of the AbTransferOkay predicate.
 */
public Formula AbTransferLost(Expression s, Expression sprime, Expression a_in, Expression a_out) {
    final Expression e0 = a_in.join(from);
    final Expression e1 = a_in.join(to);
    final Formula f0 = AbWorldSecureOp(s, sprime, a_in, a_out);
    final Formula f1 = Authentic(s, e0);
    final Formula f2 = Authentic(s, e1);
    final Formula f3 = SufficientFundsProperty(s, a_in);
    final Formula f4 = e0.intersection(e1).no();
    final Formula f5 = e0.join(abBalance).join(sprime).eq(e0.join(abBalance).join(s).difference(a_in.join(value)));
    final Formula f6 = e0.join(abLost).join(sprime).eq(e0.join(abLost).join(s).union(a_in.join(value)));
    final Formula f7 = XiAbPurse(s, sprime, e1);
    final Formula f8 = Authentic(sprime, e0);
    final Formula f9 = Authentic(sprime, e1);
    return Formula.and(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
}
Also used : Formula(kodkod.ast.Formula) Expression(kodkod.ast.Expression)

Example 40 with Formula

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

the class DNACuts method declarations.

/**
 * Returns declarations constraints.
 *
 * @return declarations constraints.
 */
public Formula declarations() {
    final Variable l = Variable.unary("l");
    final Formula f0 = l.join(base).one().forAll(l.oneOf(Link));
    final Formula f1 = CutLink.union(JoinLink).eq(Link);
    final Formula f2 = CutLink.intersection(JoinLink).no();
    return f0.and(f1).and(f2);
}
Also used : Formula(kodkod.ast.Formula) Variable(kodkod.ast.Variable)

Aggregations

Formula (kodkod.ast.Formula)346 Variable (kodkod.ast.Variable)151 Solution (kodkod.engine.Solution)101 Expression (kodkod.ast.Expression)95 Bounds (kodkod.instance.Bounds)83 QuantifiedFormula (kodkod.ast.QuantifiedFormula)72 Solver (kodkod.engine.Solver)67 BinaryFormula (kodkod.ast.BinaryFormula)50 NaryFormula (kodkod.ast.NaryFormula)49 Relation (kodkod.ast.Relation)45 NotFormula (kodkod.ast.NotFormula)43 ComparisonFormula (kodkod.ast.ComparisonFormula)40 IntExpression (kodkod.ast.IntExpression)40 IntComparisonFormula (kodkod.ast.IntComparisonFormula)39 MultiplicityFormula (kodkod.ast.MultiplicityFormula)39 Universe (kodkod.instance.Universe)37 ArrayList (java.util.ArrayList)35 TupleFactory (kodkod.instance.TupleFactory)35 ConstantFormula (kodkod.ast.ConstantFormula)29 TupleSet (kodkod.instance.TupleSet)29