• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SATFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中kodkod.engine.satlab.SATFactory的典型用法代码示例。如果您正苦于以下问题:Java SATFactory类的具体用法?Java SATFactory怎么用?Java SATFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SATFactory类属于kodkod.engine.satlab包,在下文中一共展示了SATFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.Netconfig [# sites] [# hq] [# routers] [# time
 * steps]
 */
public static void main(String[] args) {
	if (args.length < 4)
		usage();
	final Netconfig model = new Netconfig();
	final Solver solver = new Solver();
	// solver.options().setSolver(SATFactory.ZChaffMincost);
	solver.options().setSolver(SATFactory.MiniSat);
	try {
		final Formula show = model.show();
		final Solution sol = solver.solve(show, model.bounds(Integer.parseInt(args[0]), Integer.parseInt(args[1]),
				Integer.parseInt(args[2]), Integer.parseInt(args[3])));
		// System.out.println(show);
		// System.out.println("p cnf " +
		// (solver.numberOfIntermediateVariables()+solver.numberOfPrimaryVariables())
		// + " " + solver.numberOfClauses());
		System.out.println(sol.outcome());
		System.out.println(sol.stats());

	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:27,代码来源:Netconfig.java


示例2: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.MGT066 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final MGT066 model = new MGT066();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		solver.options().setSymmetryBreaking(n * n);
		final Formula f = model.axioms();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:25,代码来源:MGT066.java


示例3: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.MED007 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final MED007 model = new MED007();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(1000);
		// solver.options().setFlatten(false);
		final Formula f = model.checkTranssls2_qilt27();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:MED007.java


示例4: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: ava examples.tptp.GEO192 [# curves] [# points]
 */
public static void main(String[] args) {
	if (args.length < 2)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);

		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final GEO092 model = new GEO092();
		final Formula f = model.checkProposition2141();

		System.out.println(model.proposition2141());

		final Bounds b = model.bounds(n);
		final Solution sol = solver.solve(f, b);

		System.out.println(sol);
		// System.out.println((new
		// Evaluator(sol.instance())).evaluate(model.axioms().and(model.theorem213().not())));
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:28,代码来源:GEO092.java


示例5: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.GEO191 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);

		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final GEO091 model = new GEO091();
		final Formula f = model.checkTheorem_2_13();

		System.out.println(model.theorem_2_13());

		final Bounds b = model.bounds(n);
		final Solution sol = solver.solve(f, b);

		System.out.println(sol);
		// System.out.println((new
		// Evaluator(sol.instance())).evaluate(model.axioms().and(model.theorem213().not())));
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:28,代码来源:GEO091.java


示例6: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: ava examples.tptp.GEO159 [scope]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);

		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);

		final GEO159 model = new GEO159();
		final Formula f = model.checkDefs();

		final Bounds b = model.bounds(n);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:24,代码来源:GEO159.java


示例7: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.ALG195_1
 */
public static void main(String[] args) {

	try {

		final ALG195_1 model = new ALG195_1();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final Formula f = model.axioms().and(model.co1().not());
		final Bounds b = model.bounds();
		// System.out.println(model.decls());
		// System.out.println(model.ax2ax7());
		// System.out.println(b);
		final Solution sol = solver.solve(f, b);
		if (sol.instance() == null) {
			System.out.println(sol);
		} else {
			System.out.println(sol.stats());
			model.display(sol.instance());
		}
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:27,代码来源:ALG195_1.java


示例8: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.ALG197
 */
public static void main(String[] args) {

	try {

		final ALG197 model = new ALG197();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final Formula f = model.checkCO1();
		final Bounds b = model.bounds();
		final Solution sol = solver.solve(f, b);
		if (sol.instance() == null) {
			System.out.println(sol);
		} else {
			System.out.println(sol.stats());
			model.display(sol.instance());
		}
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:24,代码来源:ALG197.java


示例9: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.COM008 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final COM008 model = new COM008();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(22);
		// solver.options().setFlatten(false);
		final Formula f = model.checkGoalToBeProved();
		final Bounds b = model.bounds(n);
		// System.out.println(f);

		final Solution sol = solver.solve(f, b);
		System.out.println(sol);

	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:28,代码来源:COM008.java


示例10: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.SET967 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final SET967 model = new SET967();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(n*n);
		// solver.options().setFlatten(false);
		final Formula f = model.checkT120_zfmisc_1();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:SET967.java


示例11: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.ALG195
 */
public static void main(String[] args) {

	try {

		final ALG195 model = new ALG195();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final Formula f = model.checkCO1();
		final Bounds b = model.bounds();
		// System.out.println(model.decls());
		// System.out.println(model.ax2ax7());
		// System.out.println(b);
		final Solution sol = solver.solve(f, b);
		if (sol.instance() == null) {
			System.out.println(sol);
		} else {
			System.out.println(sol.stats());
			model.display(sol.instance());
		}
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:27,代码来源:ALG195.java


示例12: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.NUM374 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final NUM374 model = new NUM374();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		solver.options().setSymmetryBreaking(n * n);
		final Formula f = model.checkWilkie();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:25,代码来源:NUM374.java


示例13: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.ALG212 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final ALG212 model = new ALG212();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(n*n);
		// solver.options().setFlatten(false);
		final Formula f = model.checkDistLong();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:ALG212.java


示例14: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.NUM378
 */
public static void main(String[] args) {

	try {

		final NUM378 model = new NUM378();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final Formula f = model.decls().and(model.inequalities());
		final Bounds b = model.bounds();
		// System.out.println(f);
		// System.out.println(b);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol.outcome());
		System.out.println(sol.stats());
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:22,代码来源:NUM378.java


示例15: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.MED009 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final MED009 model = new MED009();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(1000);
		// solver.options().setFlatten(false);
		final Formula f = model.checkTranssls2_qige27();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:MED009.java


示例16: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: ava examples.tptp.GEO115 [scope]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);

		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);

		final GEO115 model = new GEO115();
		final Formula f = model.theorem385();

		final Bounds b = model.bounds(n);
		final Solution sol = solver.solve(f, b);

		System.out.println(sol);

	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:GEO115.java


示例17: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.TOP020 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final TOP020 model = new TOP020();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		final Formula f = model.checkChallenge_AMR_1_4_4();
		final Bounds b = model.bounds(n);
		// System.out.println(f);
		// System.out.println(b);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:25,代码来源:TOP020.java


示例18: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.SET943 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final SET943 model = new SET943();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(1000);
		// solver.options().setFlatten(false);
		final Formula f = model.checkT96_zfmisc_1();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:SET943.java


示例19: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java examples.tptp.SET948 [univ size]
 */
public static void main(String[] args) {
	if (args.length < 1)
		usage();

	try {
		final int n = Integer.parseInt(args[0]);
		if (n < 1)
			usage();
		final SET948 model = new SET948();
		final Solver solver = new Solver();
		solver.options().setSolver(SATFactory.MiniSat);
		// solver.options().setSymmetryBreaking(n*n);
		// solver.options().setFlatten(false);
		final Formula f = model.checkT101_zfmisc_1();
		final Bounds b = model.bounds(n);
		System.out.println(f);
		final Solution sol = solver.solve(f, b);
		System.out.println(sol);
	} catch (NumberFormatException nfe) {
		usage();
	}
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:26,代码来源:SET948.java


示例20: main

import kodkod.engine.satlab.SATFactory; //导入依赖的package包/类
/**
 * Usage: java tests.Viktor
 */
public static void main(String[] args) {

	final Viktor model = new Viktor();

	final Solver solver = new Solver();
	solver.options().setSolver(SATFactory.MiniSat);
	solver.options().setReporter(new ConsoleReporter());
	solver.options().setBitwidth(7);
	final Formula f = model.checkEquations();
	final Bounds b = model.bounds();
	System.out.println(f);
	System.out.println(b);
	final Solution sol = solver.solve(f, b);

	System.out.println(sol);
	if (sol.instance() != null)
		model.display(sol.instance(), solver.options());

}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:23,代码来源:Viktor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ExchangeFilterFunction类代码示例发布时间:2022-05-22
下一篇:
Java ByteType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap