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;
}
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);
}
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);
}
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);
}
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);
}
Aggregations