本文整理汇总了Java中kodkod.ast.BinaryIntExpression.left方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryIntExpression.left方法的具体用法?Java BinaryIntExpression.left怎么用?Java BinaryIntExpression.left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.BinaryIntExpression
的用法示例。
在下文中一共展示了BinaryIntExpression.left方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import kodkod.ast.BinaryIntExpression; //导入方法依赖的package包/类
/**
* Calls lookup(intExpr) and returns the cached value, if any. If a
* replacement has not been cached, visits the expression's children. If
* nothing changes, the argument is cached and returned, otherwise a
* replacement expression is cached and returned.
*
* @return { c: IntExpression | [[c]] = intExpr.left.accept(delegate) op
* intExpr.right.accept(delegate) }
*/
public IntExpression visit(BinaryIntExpression intExpr) {
IntExpression ret = lookup(intExpr);
if (ret != null)
return ret;
final IntExpression left = intExpr.left().accept(delegate);
final IntExpression right = intExpr.right().accept(delegate);
ret = (left == intExpr.left() && right == intExpr.right()) ? intExpr : left.compose(intExpr.op(), right);
return cache(intExpr, ret);
}
示例2: visit
import kodkod.ast.BinaryIntExpression; //导入方法依赖的package包/类
/**
* Calls lookup(intExpr) and returns the cached value, if any.
* If a replacement has not been cached, visits the expression's
* children. If nothing changes, the argument is cached and
* returned, otherwise a replacement expression is cached and returned.
* @return { c: IntExpression | [[c]] = intExpr.left.accept(this) op intExpr.right.accept(this) }
*/
public IntExpression visit(BinaryIntExpression intExpr) {
IntExpression ret = lookup(intExpr);
if (ret!=null) return ret;
final IntExpression left = intExpr.left().accept(this);
final IntExpression right = intExpr.right().accept(this);
ret = (left==intExpr.left() && right==intExpr.right()) ?
intExpr : left.compose(intExpr.op(), right);
return cache(intExpr,ret);
}
示例3: visit
import kodkod.ast.BinaryIntExpression; //导入方法依赖的package包/类
public IntExpression visit(BinaryIntExpression expr) {
IntExpression ret = lookup(expr);
if (ret!=null) return ret;
final IntOperator op = expr.op();
final IntExpression left = expr.left().accept(this);
final IntExpression right = expr.right().accept(this);
ret = simplify(op, left, right);
if (ret==null) {
final int hash = hash(op, left, right);
for(Iterator<PartialCannonicalizer.Holder<IntExpression>> itr = intExprs.get(hash); itr.hasNext(); ) {
final IntExpression next = itr.next().obj;
if (next instanceof BinaryIntExpression) {
final BinaryIntExpression hit = (BinaryIntExpression) next;
if (hit.op()==op && hit.left()==left && hit.right()==right) {
return cache(expr, hit);
}
}
}
ret = left==expr.left()&&right==expr.right() ? expr : left.compose(op, right);
intExprs.add(new PartialCannonicalizer.Holder<IntExpression>(ret, hash));
}
return cache(expr,ret);
}
示例4: visit
import kodkod.ast.BinaryIntExpression; //导入方法依赖的package包/类
public IntExpression visit(BinaryIntExpression expr) {
IntExpression ret = lookup(expr);
if (ret!=null) return ret;
final IntOperator op = expr.op();
final IntExpression left = expr.left().accept(this);
final IntExpression right = expr.right().accept(this);
ret = simplify(op, left, right);
if (ret==null) {
ret = left==expr.left()&&right==expr.right() ? expr : left.compose(op, right);
}
return cache(expr,ret);
}