Exemplo n.º 1
0
 def test_einstein(self):
     print()
     print("Testing einstein.cnf")
     filename = "sample_cnf/einstein.cnf"
     solver = add_arguments(filename, heuristic)
     start = time.clock()
     self.assertEqual(solver.solve_test(), 'satisfied')
     end = time.clock()
     print("Num times pick-branching", solver.get_num_pick_branch())
     print("Time taken is", end - start)
Exemplo n.º 2
0
from CDCL.cdcl_routine import add_arguments
import argparse


def parse_input():
	"""
	Get the input file with clauses in DIMACS format.
	:return: generated clause
	"""
	parser = argparse.ArgumentParser()
	parser.add_argument('file')
	parser.add_argument('pick_branching', choices=['random', 'random_frequency', '2-clause', 'DLIS', 'VSIDS_nodecay', 'VSIDS'])
	return parser.parse_args().file, parser.parse_args().pick_branching

if __name__ == '__main__':
	filename, heuristic = parse_input()
	solver = add_arguments(filename, heuristic)
	solver.solve()