本文整理汇总了Java中kodkod.ast.Expression.no方法的典型用法代码示例。如果您正苦于以下问题:Java Expression.no方法的具体用法?Java Expression.no怎么用?Java Expression.no使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.Expression
的用法示例。
在下文中一共展示了Expression.no方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: size
import kodkod.ast.Expression; //导入方法依赖的package包/类
/** Helper method that returns the constraint that the sig has exactly "n" elements, or at most "n" elements */
private Formula size(Sig sig, int n, boolean exact) {
Expression a = sol.a2k(sig);
if (n<=0) return a.no();
if (n==1) return exact ? a.one() : a.lone();
Formula f = exact ? Formula.TRUE : null;
Decls d = null;
Expression sum = null;
while(n>0) {
n--;
Variable v = Variable.unary("v" + Integer.toString(TranslateAlloyToKodkod.cnt++));
kodkod.ast.Decl dd = v.oneOf(a);
if (d==null) d=dd; else d=dd.and(d);
if (sum==null) sum=v; else { if (f!=null) f=v.intersection(sum).no().and(f); sum=v.union(sum); }
}
if (f!=null) return sum.eq(a).and(f).forSome(d); else return a.no().or(sum.eq(a).forSome(d));
}
示例2: Abstract
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Returns the application of the Abstract predicate.
*
* @return application of the Abstract predicate.
*/
public Formula Abstract(Expression s) {
final Expression e0 = s.join(abAuthPurse).join(abBalance).join(s).intersection(
s.join(abAuthPurse).join(abLost).join(s));
final Formula f0 = e0.no();
final Expression e1 = s.join(abAuthPurse).product(Expression.UNIV);
final Expression e2 = e1.intersection((abBalance.union(abLost)).join(s));
final Formula f1 = e2.in(AbPurse.product(Coin));
final Variable c = Variable.unary("c");
final Formula f2 = e2.join(c).lone().forAll(c.oneOf(Coin));
return Formula.and(f0, f1, f2);
}
示例3: size
import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
* Helper method that returns the constraint that the sig has exactly "n"
* elements, or at most "n" elements
*/
private Formula size(Sig sig, int n, boolean exact) {
Expression a = sol.a2k(sig);
if (n <= 0)
return a.no();
if (n == 1)
return exact ? a.one() : a.lone();
Formula f = exact ? Formula.TRUE : null;
Decls d = null;
Expression sum = null;
while (n > 0) {
n--;
Variable v = Variable.unary("v" + Integer.toString(TranslateAlloyToKodkod.cnt++));
kodkod.ast.Decl dd = v.oneOf(a);
if (d == null)
d = dd;
else
d = dd.and(d);
if (sum == null)
sum = v;
else {
if (f != null)
f = v.intersection(sum).no().and(f);
sum = v.union(sum);
}
}
if (f != null)
return sum.eq(a).and(f).forSome(d);
else
return a.no().or(sum.eq(a).forSome(d));
}