示例#1
0
 def test_condition_abduction_test5(self):
     print("running test_condition_abduction_test5")
     s = Synthesizer(self.condition_abduction_grammar, [(4, 16), (6, 14),
                                                        (3, 8), (5, 25)])
     start = time.time()
     sol = s.find_solution_with_condition_abduction(self.boolean_grammar)
     end = time.time()
     assert (SynthesizerTest.found_sol(sol))
     if SynthesizerTest.found_sol(sol):
         with open("tests_results/test_condition_abduction_test5",
                   'w') as f:
             f.write(sol)
     with open("synthesizer_tests_report.csv", 'a') as f:
         f.write(
             f"test_condition_abduction_test5, {'Found' if self.found_sol(sol) else 'Not Found'}"
             f", {end - start}\n")
示例#2
0
 def test_condition_abduction_test4_unrealizable(self):
     print("running test_condition_abduction_test4_unrealizable")
     s = Synthesizer(self.condition_abduction_grammar, [(2, 6), (6, 2),
                                                        (3, 9), (5, 15),
                                                        (12, 36)])
     start = time.time()
     sol = s.find_solution_with_condition_abduction(self.boolean_grammar)
     end = time.time()
     assert (not SynthesizerTest.found_sol(sol))
     if not SynthesizerTest.found_sol(sol):
         with open(
                 "tests_results/test_condition_abduction_test4_unrealizable",
                 'w') as f:
             f.write(sol)
     with open("synthesizer_tests_report.csv", 'a') as f:
         f.write(
             f"test_condition_abduction_test4_unrealizable, {'Found' if self.found_sol(sol) else 'Not Found'}"
             f", {end - start}\n")