本文整理汇总了Java中kodkod.ast.Expression.product方法的典型用法代码示例。如果您正苦于以下问题:Java Expression.product方法的具体用法?Java Expression.product怎么用?Java Expression.product使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.Expression
的用法示例。
在下文中一共展示了Expression.product方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ts2expr
import kodkod.ast.Expression; //导入方法依赖的package包/类
public Expression ts2expr(TupleSet tset) {
if (tset == null)
return Expression.NONE;
Expression tsetExpr = null;
for (Tuple t : tset) {
Expression tupleExpr = null;
for (int i = 0; i < t.arity(); i++) {
Expression atomRel = ensureAtomExpr(t.atom(i));
tupleExpr = tupleExpr == null ? atomRel : tupleExpr.product(atomRel);
}
tsetExpr = tsetExpr == null ? tupleExpr : tsetExpr.union(tupleExpr);
}
return (tsetExpr == null) ? Expression.NONE : tsetExpr;
}
示例2: XiAbPurse
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* 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);
}
示例3: 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;
}
示例4: 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;
}
示例5: addLineOfSightLink
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the addLineOfSightLink predicate.
*
* @return addLineOfSightLink
*/
public Formula addLineOfSightLink(Expression r1, Expression r2, Expression t) {
final Expression link = r1.product(r2);
return link.in(satellite.join(tick.join(t))).and(link.in(lineOfSight.join(t)));
}
示例6: continuedConnection
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the continuedConnection predicate.
*
* @return continuedConnection
*/
public Formula continuedConnection(Expression r1, Expression r2, Expression t) {
final Expression link = r1.product(r2);
return link.intersection(lineOfSight.join(tick.join(t))).eq(link.intersection(lineOfSight.join(t)));
}
示例7: lostConnection
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the lostConnection predicate.
*
* @return lostConnection
*/
public Formula lostConnection(Expression r1, Expression r2, Expression t) {
final Expression link = r1.product(r2);
return link.in(lineOfSight.join(tick.join(t))).and(link.intersection(lineOfSight.join(t)).no());
}