本文整理汇总了Java中kodkod.ast.Expression.join方法的典型用法代码示例。如果您正苦于以下问题:Java Expression.join方法的具体用法?Java Expression.join怎么用?Java Expression.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.Expression
的用法示例。
在下文中一共展示了Expression.join方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: domainConstraint
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns a formula that properly constrains the given skolem's domain.
*
* @requires !nonSkolems.isEmpty()
* @return a formula that properly constrains the given skolem's domain.
*/
private Formula domainConstraint(Decl skolemDecl, Relation skolem) {
final Iterator<DeclInfo> itr = nonSkolems.iterator();
Decls rangeDecls = null;
while (itr.hasNext()) {
Decl d = itr.next().decl;
Decl dd = d.variable().oneOf(d.expression());
rangeDecls = rangeDecls != null ? rangeDecls.and(dd) : dd;
}
// System.out.println(skolemDecl.expression());
Expression skolemDomain = skolem;
for (int i = 0, max = skolemDecl.variable().arity(); i < max; i++) {
skolemDomain = skolemDomain.join(Expression.UNIV);
}
return skolemDomain.in(Formula.TRUE.comprehension(rangeDecls));
}
示例2: ax14and15
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Parametrization of axioms 14 and 15.
*
* @requires e's are unary, op is ternary
*/
Formula ax14and15(Relation[] e, Relation op) {
final Expression expr0 = e[5].join(op); // op(e5,...)
final Expression expr1 = e[5].join(expr0); // op(e5,e5)
final Expression expr2 = expr1.join(expr0); // op(e5,op(e5,e5))
final Expression expr3 = expr2.join(expr2.join(op)); // op(op(e5,op(e5,e5)),op(e5,op(e5,e5)))
final Expression expr3a = expr3.join(op); // op(op(op(e5,op(e5,e5)),op(e5,op(e5,e5))),...)
final Expression expr4 = e[5].join(expr3a); // op(op(op(e5,op(e5,e5)),op(e5,op(e5,e5))),e5)
// e0 = op(op(op(e5,op(e5,e5)),op(e5,op(e5,e5))),op(e5,op(e5,e5)))
final Formula f0 = e[0].eq(expr2.join(expr3a));
// e1 = op(e5,e5)
final Formula f1 = e[1].eq(expr1);
// e2 = op(op(e5,op(e5,e5)),op(e5,op(e5,e5)))
final Formula f2 = e[2].eq(expr3);
// e3 = op(op(op(e5,op(e5,e5)),op(e5,op(e5,e5))),e5)
final Formula f3 = e[3].eq(expr4);
// e4 = op(e5,op(e5,e5))
final Formula f4 = e[4].eq(expr2);
// e6 =
// op(op(op(op(e5,op(e5,e5)),op(e5,op(e5,e5))),e5),op(e5,op(e5,e5)))
final Formula f6 = e[6].eq(expr2.join(expr4.join(op)));
return f0.and(f1).and(f2).and(f3).and(f4).and(f6);
}
示例3: ax16_22
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Parametrization of axioms 16-22.
*
* @requires e is unary, h is binary
*/
Formula ax16_22(Relation e, Relation h) {
final Expression expr0 = e.join(op2); // op2(e,...)
final Expression expr1 = e.join(expr0); // op2(e,e)
final Expression expr2 = expr1.join(expr0); // op2(e,op2(e,e))
final Expression expr3 = expr2.join(expr2.join(op2)); // op2(op2(e,op2(e,e)),op2(e,op2(e,e)))
final Expression expr3a = expr3.join(op2); // op2(op2(op2(e,op2(e,e)),op2(e,op2(e,e))),...)
final Expression expr4 = e.join(expr3a); // op2(op2(op2(e,op2(e,e)),op2(e,op2(e,e))),e)
// h(e10) = op2(op2(op2(e,op2(e,e)),op2(e,op2(e,e))),op2(e,op2(e,e)))
final Formula f0 = e1[0].join(h).eq(expr2.join(expr3a));
// h(e11) = op2(e,e)
final Formula f1 = e1[1].join(h).eq(expr1);
// h(e12) = op2(op2(e,op2(e,e)),op2(e,op2(e,e)))
final Formula f2 = e1[2].join(h).eq(expr3);
// h(e13) = op2(op2(op2(e,op2(e,e)),op2(e,op2(e,e))),e)
final Formula f3 = e1[3].join(h).eq(expr4);
// h(e14) = op2(e,op2(e,e))
final Formula f4 = e1[4].join(h).eq(expr2);
// h1(e15) = e
final Formula f5 = e1[5].join(h).eq(e);
// h(e16) =
// op2(op2(op2(op2(e,op2(e,e)),op2(e,op2(e,e))),e),op2(e,op2(e,e)))
final Formula f6 = e1[6].join(h).eq(expr2.join(expr4.join(op2)));
return f0.and(f1).and(f2).and(f3).and(f4).and(f5).and(f6);
}
示例4: AbTransferLost
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* 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);
}
示例5: ax16_22
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Parametrization of axioms 16-22.
*
* @requires e is unary, h is binary
*/
Formula ax16_22(Relation e, Relation h) {
final Expression expr0 = e.join(op2); // op2(e,...)
final Expression expr1 = e.join(expr0); // op2(e,e)
final Expression expr2 = expr1.join(expr1.join(op2)); // op2(op2(e,e),op2(e,e))
final Expression expr3 = expr2.join(expr0); // op2(e,op2(op2(e,e),op2(e,e)))
// h(e10) = op2(e,op2(e,e))
final Formula f0 = e1[0].join(h).eq(expr1.join(expr0));
// h(e11) = op2(op2(e,e),op2(e,e))
final Formula f1 = e1[1].join(h).eq(expr2);
// h(e12) = op2(op2(op2(e,e),op2(e,e)),op2(e,e))
final Formula f2 = e1[2].join(h).eq(expr1.join(expr2.join(op2)));
// h(e13) = op2(e,op2(op2(e,e),op2(e,e)))
final Formula f3 = e1[3].join(h).eq(expr3);
// h(e14) = op2(e,op2(e,op2(op2(e,e),op2(e,e))))
final Formula f4 = e1[4].join(h).eq(expr3.join(expr0));
// h(e15) = op2(e,e)
final Formula f5 = e1[5].join(h).eq(expr1);
return Formula.and(f0, f1, f2, f3, f4, f5);
}
示例6: distLong
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the dist_long conjecture.
*
* @return dist_long
*/
public final Formula distLong() {
// all u, w, x, y, z: A | f[f[x][y][z]][u][w] =
// f[f[x][u][w]][f[y][u][w]][f[z][u][w]]
final Variable u = Variable.unary("u");
final Variable w = Variable.unary("w");
final Variable x = Variable.unary("x");
final Variable y = Variable.unary("y");
final Variable z = Variable.unary("z");
final Expression e0 = z.join(y.join(x.join(f)));
final Expression e1 = w.join(u.join(e0.join(f)));
final Expression e2 = w.join(u.join(x.join(f)));
final Expression e3 = w.join(u.join(y.join(f)));
final Expression e4 = w.join(u.join(z.join(f)));
final Expression e5 = e4.join(e3.join(e2.join(f)));
return e1.eq(e5)
.forAll(u.oneOf(UNIV).and(w.oneOf(UNIV)).and(x.oneOf(UNIV)).and(y.oneOf(UNIV)).and(z.oneOf(UNIV)));
}
示例7: AbWorldSecureOp
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the application of the AbWorldSecureOp predicate.
*
* @return application of the AbWorldSecureOp predicate.
*/
public Formula AbWorldSecureOp(Expression s, Expression sprime, Expression a_in, Expression a_out) {
final Formula f0 = AbOp(a_out);
final Formula f1 = a_in.in(TransferDetails);
final Expression e0 = a_in.join(from);
final Expression e1 = a_in.join(to);
final Expression e2 = s.join(abAuthPurse).difference(e0).difference(e1);
final Expression e3 = sprime.join(abAuthPurse).difference(e0).difference(e1);
final Formula f2 = e2.eq(e3);
final Formula f3 = XiAbPurse(s, sprime, e2);
return Formula.and(f0, f1, f2, f3);
}
示例8: sim
import kodkod.ast.Expression; //导入方法依赖的package包/类
/** If ex is a simple combination of Relations, then return that combination, else return null. */
private Expression sim(Expr ex) {
while(ex instanceof ExprUnary) {
ExprUnary u = (ExprUnary)ex;
if (u.op!=ExprUnary.Op.NOOP && u.op!=ExprUnary.Op.EXACTLYOF) break;
ex = u.sub;
}
if (ex instanceof ExprBinary) {
ExprBinary b = (ExprBinary)ex;
if (b.op==ExprBinary.Op.ARROW || b.op==ExprBinary.Op.PLUS || b.op==ExprBinary.Op.JOIN) {
Expression left = sim(b.left); if (left==null) return null;
Expression right = sim(b.right); if (right==null) return null;
if (b.op==ExprBinary.Op.ARROW) return left.product(right);
if (b.op==ExprBinary.Op.PLUS) return left.union(right); else return left.join(right);
}
}
if (ex instanceof ExprConstant) {
switch(((ExprConstant)ex).op) {
case EMPTYNESS: return Expression.NONE;
}
}
if (ex==Sig.NONE) return Expression.NONE;
if (ex==Sig.SIGINT) return Expression.INTS;
if (ex instanceof Sig) return sol.a2k((Sig)ex);
if (ex instanceof Field) return sol.a2k((Field)ex);
return null;
}
示例9: associativity
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the associativity axiom.
*
* @return associativity
*/
public final Formula associativity() {
// all w, x, y, z: A | f[f[x][w][y]][w][z] = f[x][w][f[y][w][z]]
final Variable w = Variable.unary("w");
final Variable x = Variable.unary("x");
final Variable y = Variable.unary("y");
final Variable z = Variable.unary("z");
final Expression e0 = y.join(w.join(x.join(f)));
final Expression e1 = z.join(w.join(e0.join(f)));
final Expression e2 = z.join(w.join(y.join(f)));
final Expression e3 = e2.join(w.join(x.join(f)));
return e1.eq(e3).forAll(w.oneOf(UNIV).and(x.oneOf(UNIV)).and(y.oneOf(UNIV)).and(z.oneOf(UNIV)));
}
示例10: prefixes
import kodkod.ast.Expression; //导入方法依赖的package包/类
private Expression prefixes(Expression expr) {
return expr.join(prefixes);
}
示例11: releaseMutex
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the GrabMutex predicate for states s1, s2, process p and mutex m.
*
* @return
*
* <pre>
* pred State.ReleaseMutex (p: Process, m: Mutex, s': State) {
* !this::IsStalled(p)
* m in p.(this.holds)
* p.(s'.holds) = p.(this.holds) - m
* no p.(s'.waits)
* no m.~(this.waits) => {
* no m.~(s'.holds)
* no m.~(s'.waits)
* } else {
* some lucky: m.~(this.waits) | {
* m.~(s'.waits) = m.~(this.waits) - lucky
* m.~(s'.holds) = lucky
* }
* }
* all mu: Mutex - m {
* mu.~(s'.waits) = mu.~(this.waits)
* mu.~(s'.holds)= mu.~(this.holds)
* }
* }
* </pre>
*/
public Formula releaseMutex(Expression s1, Expression s2, Expression p, Expression m) {
final Formula f1 = isStalled(s1, p).not().and(m.in(p.join(s1.join(holds))));
final Formula f2 = p.join(s2.join(holds)).eq(p.join(s1.join(holds)).difference(m));
final Formula f3 = p.join(s2.join(waits)).no();
final Expression cexpr = m.join((s1.join(waits)).transpose());
final Formula f4 = m.join(s2.join(holds).transpose()).no();
final Formula f5 = m.join(s2.join(waits).transpose()).no();
final Formula f6 = cexpr.no().implies(f4.and(f5));
final Variable lucky = Variable.unary("lucky");
final Formula f7 = m.join(s2.join(waits).transpose()).eq(m.join(s1.join(waits).transpose()).difference(lucky));
final Formula f8 = m.join(s2.join(holds).transpose()).eq(lucky);
final Formula f9 = f7.and(f8).forSome(lucky.oneOf(m.join(s1.join(waits).transpose())));
final Formula f10 = cexpr.some().implies(f9);
final Variable mu = Variable.unary("mu");
final Formula f11 = mu.join(s2.join(waits).transpose()).eq(mu.join(s1.join(waits).transpose()));
final Formula f12 = mu.join(s2.join(holds).transpose()).eq(mu.join(s1.join(holds).transpose()));
final Formula f13 = f11.and(f12).forAll(mu.oneOf(Mutex.difference(m)));
return Formula.and(f1, f2, f3, f6, f10, f13);
}
示例12: guest
import kodkod.ast.Expression; //导入方法依赖的package包/类
/** @return e.guest */
Expression guest(Expression e) {
return e.join(guest);
}
示例13: car
import kodkod.ast.Expression; //导入方法依赖的package包/类
private Expression car(Expression expr) {
return expr.join(car);
}
示例14: pre
import kodkod.ast.Expression; //导入方法依赖的package包/类
/** @return e.pre */
Expression pre(Expression e) {
return e.join(pre);
}
示例15: room
import kodkod.ast.Expression; //导入方法依赖的package包/类
/** @return e.room */
Expression room(Expression e) {
return e.join(room);
}