Beispiel #1
0
static void readDIMACSTest()
{
	Minisat::Formula formula;
	AssertThat(formula.readDimacs(RESOURCE_DIR + "/" + "minisat/satisfiable.txt"), IsTrue());
	Minisat::Model model;
	bool satisfiable = formula.solve(model);
	AssertThat(satisfiable, IsTrue());

	formula.addClause(std::vector<int>{3});
	satisfiable = formula.solve(model);
	AssertThat(satisfiable, IsFalse());
}
Beispiel #2
0
static void readDIMACSTest()
{
	Minisat::Formula formula;
	std::stringstream ss{ResourceFile::get("minisat/satisfiable.txt")->data()};
	AssertThat(formula.readDimacs(ss), IsTrue());
	Minisat::Model model;
	bool satisfiable = formula.solve(model);
	AssertThat(satisfiable, IsTrue());

	formula.addClause(std::vector<int>{3});
	satisfiable = formula.solve(model);
	AssertThat(satisfiable, IsFalse());
}