本文整理汇总了Java中kodkod.ast.BinaryExpression.right方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryExpression.right方法的具体用法?Java BinaryExpression.right怎么用?Java BinaryExpression.right使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.BinaryExpression
的用法示例。
在下文中一共展示了BinaryExpression.right方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
/** @effects appends the tokenization of the given node to this.tokens */
public void visit(BinaryExpression node) {
if (displayed(node)) return;
final boolean oldTop = notTop();
final ExprOperator op = node.op();
final Expression left = node.left(), right = node.right();
if (op==ExprOperator.JOIN && left.arity()==1 && right.arity()==2 && right instanceof Relation) {
append(right);
append("[");
visitChild(left, false);
append("]");
} else {
visitChild(left, parenthesize(op, left));
infix(op);
visitChild(right, parenthesize(op, right));
}
top = oldTop;
}
示例2: visit
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
/**
* Calls lookup(binExpr) 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 { b: BinaryExpression | b.left = binExpr.left.accept(delegate) &&
* b.right = binExpr.right.accept(delegate) && b.op = binExpr.op }
*/
public Expression visit(BinaryExpression binExpr) {
Expression ret = lookup(binExpr);
if (ret != null)
return ret;
final Expression left = binExpr.left().accept(delegate);
final Expression right = binExpr.right().accept(delegate);
ret = (left == binExpr.left() && right == binExpr.right()) ? binExpr : left.compose(binExpr.op(), right);
return cache(binExpr, ret);
}
示例3: right
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
/**
* If x = SOMETHING->RELATION where SOMETHING.arity==1, then return the
* RELATION, else return null.
*/
private static Relation right(Expression x) {
if (!(x instanceof BinaryExpression))
return null;
BinaryExpression bin = (BinaryExpression) x;
if (bin.op() != ExprOperator.PRODUCT)
return null;
if (bin.left().arity() == 1 && bin.right() instanceof Relation)
return (Relation) (bin.right());
else
return null;
}
示例4: right
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
/** If x = SOMETHING->RELATION where SOMETHING.arity==1, then return the RELATION, else return null. */
private static Relation right(Expression x) {
if (!(x instanceof BinaryExpression)) return null;
BinaryExpression bin = (BinaryExpression)x;
if (bin.op() != ExprOperator.PRODUCT) return null;
if (bin.left().arity()==1 && bin.right() instanceof Relation) return (Relation)(bin.right()); else return null;
}
示例5: visit
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
/**
* Calls lookup(binExpr) 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 { b: BinaryExpression | b.left = binExpr.left.accept(this) &&
* b.right = binExpr.right.accept(this) && b.op = binExpr.op }
*/
public Expression visit(BinaryExpression binExpr) {
Expression ret = lookup(binExpr);
if (ret!=null) return ret;
final Expression left = binExpr.left().accept(this);
final Expression right = binExpr.right().accept(this);
ret = (left==binExpr.left() && right==binExpr.right()) ?
binExpr : left.compose(binExpr.op(), right);
return cache(binExpr,ret);
}
示例6: visit
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
public Expression visit(BinaryExpression expr) {
Expression ret = lookup(expr);
if (ret!=null) return ret;
final ExprOperator op = expr.op();
final Expression left = expr.left().accept(this);
final Expression right = expr.right().accept(this);
ret = simplify(op, left, right);
if (ret==null) {
final int hash = hash(op, left, right);
for(Iterator<PartialCannonicalizer.Holder<Expression>> itr = exprs.get(hash); itr.hasNext(); ) {
final Expression next = itr.next().obj;
if (next instanceof BinaryExpression) {
final BinaryExpression hit = (BinaryExpression) 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);
exprs.add(new PartialCannonicalizer.Holder<Expression>(ret, hash));
}
return cache(expr,ret);
}
示例7: visit
import kodkod.ast.BinaryExpression; //导入方法依赖的package包/类
public Expression visit(BinaryExpression expr) {
Expression ret = lookup(expr);
if (ret!=null) return ret;
final ExprOperator op = expr.op();
final Expression left = expr.left().accept(this);
final Expression 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);
}