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


Java Expression.difference方法代码示例

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


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

示例1: testBGP_03172011

import kodkod.ast.Expression; //导入方法依赖的package包/类
public final void testBGP_03172011() {

		Relation x5 = Relation.unary("s012");
		Relation x8 = Relation.unary("zero");
		Relation x9 = Relation.unary("one");
		Relation x12 = Relation.nary("next", 2);

		Universe universe = new Universe(Arrays.asList("0", "1", "2", "3"));
		TupleFactory factory = universe.factory();
		Bounds bounds = new Bounds(universe);

		bounds.boundExactly(x5, factory.setOf("0", "1", "2"));
		bounds.boundExactly(x8, factory.setOf("0"));
		bounds.bound(x9, factory.setOf("1"), factory.setOf("1", "2"));

		TupleSet x12_upper = factory.noneOf(2);
		x12_upper.add(factory.tuple("1", "2"));
		x12_upper.add(factory.tuple("2", "3"));
		bounds.boundExactly(x12, x12_upper);

		Variable x714 = Variable.unary("x714");
		Decls x713 = x714.oneOf(x8.union(x9));

		Variable x720 = Variable.unary("x720");
		Expression x723 = x8.union(x9);
		Expression x724 = x9.join(x12);
		Expression x722 = x723.union(x724);
		Expression x721 = x722.difference(x714);
		Decls x719 = x720.oneOf(x721);

		Variable x727 = Variable.unary("x727");
		Expression x732 = x714.union(x720);
		Expression x728 = x5.difference(x732);
		Decls x726 = x727.oneOf(x728);

		Variable x735 = Variable.unary("x735");
		Decls x734 = x735.oneOf(x8);

		Variable x893 = Variable.unary("x893");
		Decls x892 = x893.oneOf(x727);
		Formula x894 = x720.no();
		Formula x891 = x894.forAll(x892);

		Formula x712 = x891.forSome(x713.and(x719).and(x726).and(x734));
		Formula x267 = Formula.FALSE.or(x712);

		Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		solver.options().setBitwidth(4);
		// solver.options().setFlatten(false);
		solver.options().setIntEncoding(Options.IntEncoding.TWOSCOMPLEMENT);
		solver.options().setSymmetryBreaking(20);
		solver.options().setSkolemDepth(0);

		final Solution sol = solver.solve(x267, bounds);
		assertEquals(sol.outcome(), Solution.Outcome.TRIVIALLY_UNSATISFIABLE);
	}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:58,代码来源:BugTests.java

示例2: grabbedInOrder

import kodkod.ast.Expression; //导入方法依赖的package包/类
/**
 * Returns the GrabbedInOrder predicate.
 * 
 * @return
 * 
 *         <pre>
 * pred GrabbedInOrder ( ) {
 * all pre: State - so/last() |
 *  let post = so/next(pre) |
 *     let had = Process.(pre.holds), have = Process.(post.holds) |
 *     let grabbed = have - had |
 *        some grabbed => grabbed in mo/nexts(had)
 * }
 *         </pre>
 */
public Formula grabbedInOrder() {
	final Variable pre = Variable.unary("pre");
	final Expression post = pre.join(sord);
	final Expression had = Process.join(pre.join(holds));
	final Expression have = Process.join(post.join(holds));
	final Expression grabbed = have.difference(had);
	return grabbed.some().implies(grabbed.in(had.join(mord.closure()))).forAll(pre.oneOf(State.difference(slast)));
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:24,代码来源:Dijkstra.java


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