当前位置: 首页>>代码示例>>Java>>正文


Java UnaryIntExpression.intExpr方法代码示例

本文整理汇总了Java中kodkod.ast.UnaryIntExpression.intExpr方法的典型用法代码示例。如果您正苦于以下问题:Java UnaryIntExpression.intExpr方法的具体用法?Java UnaryIntExpression.intExpr怎么用?Java UnaryIntExpression.intExpr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kodkod.ast.UnaryIntExpression的用法示例。


在下文中一共展示了UnaryIntExpression.intExpr方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
public IntExpression visit(UnaryIntExpression expr) { 
	IntExpression ret = lookup(expr);
	if (ret!=null) return ret;
	
	final IntOperator op = expr.op();
	final IntExpression child = expr.intExpr().accept(this);
	
	ret = simplify(op, child);
	if (ret==null) {
		final int hash = hash(op, child);
		for(Iterator<PartialCannonicalizer.Holder<IntExpression>> itr = intExprs.get(hash); itr.hasNext(); ) {
			final IntExpression next = itr.next().obj;
			if (next.getClass()==UnaryIntExpression.class) { 
				if (((UnaryIntExpression)next).intExpr()==child)
					return cache(expr, next);
			}
		}
		ret = child==expr.intExpr() ? expr : child.apply(op);
		intExprs.add(new PartialCannonicalizer.Holder<IntExpression>(ret, hash));
	}
	return cache(expr,ret);
}
 
开发者ID:wala,项目名称:MemSAT,代码行数:23,代码来源:PartialCannonicalizer.java

示例2: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
/**
 * Calls lookup(intExpr) and returns the cached value, if any. If a
 * replacement has not been cached, visits the expression's child. If
 * nothing changes, the argument is cached and returned, otherwise a
 * replacement expression is cached and returned.
 * 
 * @return { u: UnaryIntExpression | u.expression =
 *         intExpr.expression.accept(delegate) && u.op = intExpr.op }
 */
public IntExpression visit(UnaryIntExpression intExpr) {
	IntExpression ret = lookup(intExpr);
	if (ret != null)
		return ret;

	final IntExpression child = intExpr.intExpr().accept(delegate);
	ret = (child == intExpr.intExpr()) ? intExpr : child.apply(intExpr.op());
	return cache(intExpr, ret);
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:19,代码来源:AbstractReplacer.java

示例3: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
/**
 * @ensures appends the given op and child to this.tokens; the child is
 *          parenthesized if it's not an instance of unary int
 *          expression or int constant.
 **/
public void visit(UnaryIntExpression node) {
	final IntExpression child = node.intExpr();
	final IntOperator op = node.op();
	final boolean parens = (op == IntOperator.ABS) || (op == IntOperator.SGN) || parenthesize(child);
	append(node.op());
	visitChild(child, parens);
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:13,代码来源:PrettyPrinter.java

示例4: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
/** 
 * Calls lookup(intExpr) and returns the cached value, if any.  
 * If a replacement has not been cached, visits the expression's 
 * child.  If nothing changes, the argument is cached and
 * returned, otherwise a replacement expression is cached and returned.
 * @return { u: UnaryIntExpression | u.expression = intExpr.expression.accept(this) && u.op = intExpr.op }
 */
public IntExpression visit(UnaryIntExpression intExpr) {
	IntExpression ret = lookup(intExpr);
	if (ret!=null) return ret;

	final IntExpression child = intExpr.intExpr().accept(this);
	ret = (child==intExpr.intExpr()) ?  intExpr : child.apply(intExpr.op());
	return cache(intExpr,ret);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:16,代码来源:AbstractReplacer.java

示例5: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
/** @ensures appends the given op and child to this.tokens; the child is 
 * parenthesized if it's not an instance of unary int expression or int constant. **/
public void visit(UnaryIntExpression node)  { 
	final IntExpression child = node.intExpr();
	final IntOperator op = node.op();
	final boolean parens = 
		(op==IntOperator.ABS) || (op==IntOperator.SGN) || 
		parenthesize(child);
	append(node.op());
	visitChild(child, parens);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:12,代码来源:PrettyPrinter.java

示例6: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
/** @effects appends the given op and child to this.tokens; the child is 
 * parenthesized if it's not an instance of unary int expression or int constant. **/
public void visit(UnaryIntExpression node)  { 
	if (displayed(node)) return;
	final boolean oldTop = notTop();
	final IntExpression child = node.intExpr();
	final IntOperator op = node.op();
	final boolean parens = 
		(op==IntOperator.ABS) || (op==IntOperator.SGN) || 
		parenthesize(child);
	append(node.op());
	visitChild(child, parens);
	top = oldTop;
}
 
开发者ID:wala,项目名称:MemSAT,代码行数:15,代码来源:PrettyPrinter.java

示例7: visit

import kodkod.ast.UnaryIntExpression; //导入方法依赖的package包/类
public IntExpression visit(UnaryIntExpression expr) { 
	IntExpression ret = lookup(expr);
	if (ret!=null) return ret;
	
	final IntOperator op = expr.op();
	final IntExpression child = expr.intExpr().accept(this);
	
	ret = simplify(op, child);
	if (ret==null) {
		ret = child==expr.intExpr() ? expr : child.apply(op);
	}
	return cache(expr,ret);
}
 
开发者ID:wala,项目名称:MemSAT,代码行数:14,代码来源:Simplifier.java


注:本文中的kodkod.ast.UnaryIntExpression.intExpr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。