From 8d7d287e088068c661a241f88cf70412b5121a58 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Fri, 27 Nov 2015 15:03:14 +0100 Subject: Leave query modification in tests to Prolog engine --- prolog/problems/family_relations/ancestor_2/common.py | 4 +--- prolog/problems/family_relations/aunt_2/common.py | 4 +--- prolog/problems/family_relations/brother_2/common.py | 4 +--- prolog/problems/family_relations/connected_3/common.py | 4 +--- prolog/problems/family_relations/cousin_2/common.py | 4 +--- prolog/problems/family_relations/descendant_2/common.py | 4 +--- prolog/problems/family_relations/father_2/common.py | 4 +--- prolog/problems/family_relations/grandparent_2/common.py | 4 +--- prolog/problems/family_relations/mother_2/common.py | 4 +--- prolog/problems/family_relations/sister_2/common.py | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) (limited to 'prolog/problems/family_relations') diff --git a/prolog/problems/family_relations/ancestor_2/common.py b/prolog/problems/family_relations/ancestor_2/common.py index ec44d41..68cbc6d 100644 --- a/prolog/problems/family_relations/ancestor_2/common.py +++ b/prolog/problems/family_relations/ancestor_2/common.py @@ -52,9 +52,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/aunt_2/common.py b/prolog/problems/family_relations/aunt_2/common.py index d2051b0..b0a18bf 100644 --- a/prolog/problems/family_relations/aunt_2/common.py +++ b/prolog/problems/family_relations/aunt_2/common.py @@ -56,9 +56,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/brother_2/common.py b/prolog/problems/family_relations/brother_2/common.py index 2b45b53..4d01c0b 100644 --- a/prolog/problems/family_relations/brother_2/common.py +++ b/prolog/problems/family_relations/brother_2/common.py @@ -50,9 +50,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/connected_3/common.py b/prolog/problems/family_relations/connected_3/common.py index 8b462f5..2555fe9 100644 --- a/prolog/problems/family_relations/connected_3/common.py +++ b/prolog/problems/family_relations/connected_3/common.py @@ -41,9 +41,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/cousin_2/common.py b/prolog/problems/family_relations/cousin_2/common.py index 68c4b34..382c7a0 100644 --- a/prolog/problems/family_relations/cousin_2/common.py +++ b/prolog/problems/family_relations/cousin_2/common.py @@ -63,9 +63,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/descendant_2/common.py b/prolog/problems/family_relations/descendant_2/common.py index 0963994..e979b0f 100644 --- a/prolog/problems/family_relations/descendant_2/common.py +++ b/prolog/problems/family_relations/descendant_2/common.py @@ -52,9 +52,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/father_2/common.py b/prolog/problems/family_relations/father_2/common.py index 802193d..45b9255 100644 --- a/prolog/problems/family_relations/father_2/common.py +++ b/prolog/problems/family_relations/father_2/common.py @@ -53,9 +53,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/grandparent_2/common.py b/prolog/problems/family_relations/grandparent_2/common.py index ff94f31..0c902da 100644 --- a/prolog/problems/family_relations/grandparent_2/common.py +++ b/prolog/problems/family_relations/grandparent_2/common.py @@ -54,9 +54,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/mother_2/common.py b/prolog/problems/family_relations/mother_2/common.py index 2fb2722..535e7ed 100644 --- a/prolog/problems/family_relations/mother_2/common.py +++ b/prolog/problems/family_relations/mother_2/common.py @@ -54,9 +54,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py index 6a1a745..1eb4a6a 100644 --- a/prolog/problems/family_relations/sister_2/common.py +++ b/prolog/problems/family_relations/sister_2/common.py @@ -51,9 +51,7 @@ def test(program, solved_problems): if engine_id is not None and 'error' not in map(itemgetter(0), output): # Engine successfully created, and no syntax error in program. for query, answers in test_cases: - # Limit inferences for each solution to curb unbounded recursion. - limited = 'call_with_inference_limit(({}), 100000, _)'.format(query) - if prolog.engine.check_answers(engine_id, query=limited, answers=answers, timeout=1.0): + if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 finally: if engine_id: -- cgit v1.2.1