summaryrefslogtreecommitdiff
path: root/prolog/problems
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-12 14:47:33 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-12 14:47:33 +0100
commit05e778a6d06f9d74ebc73fb5113643ffd80a6a8b (patch)
tree61865d508a5cb95e8a750057d11c61159451b861 /prolog/problems
parent75a6d1e8b3f48cb6beb3a5b417d84c83615acd68 (diff)
Prolog: catch exceptions in test functions
Diffstat (limited to 'prolog/problems')
-rw-r--r--prolog/problems/clp_fd/gcd_3/common.py2
-rw-r--r--prolog/problems/clp_fd/magic_1/common.py2
-rw-r--r--prolog/problems/clp_fd/puzzle_abc_3/common.py2
-rw-r--r--prolog/problems/clp_fd/puzzle_beth_1/common.py2
-rw-r--r--prolog/problems/clp_fd/puzzle_momson_2/common.py2
-rw-r--r--prolog/problems/clp_fd/puzzle_ratio_2/common.py2
-rw-r--r--prolog/problems/clp_fd/tobase_3/common.py2
-rw-r--r--prolog/problems/family_relations/ancestor_2/common.py2
-rw-r--r--prolog/problems/family_relations/aunt_2/common.py2
-rw-r--r--prolog/problems/family_relations/brother_2/common.py2
-rw-r--r--prolog/problems/family_relations/connected_3/common.py2
-rw-r--r--prolog/problems/family_relations/cousin_2/common.py2
-rw-r--r--prolog/problems/family_relations/descendant_2/common.py2
-rw-r--r--prolog/problems/family_relations/father_2/common.py2
-rw-r--r--prolog/problems/family_relations/grandparent_2/common.py2
-rw-r--r--prolog/problems/family_relations/mother_2/common.py2
-rw-r--r--prolog/problems/family_relations/sister_2/common.py2
-rw-r--r--prolog/problems/license_plates/checklicenseplate_3/common.py2
-rw-r--r--prolog/problems/license_plates/firstminus_2/common.py2
-rw-r--r--prolog/problems/license_plates/genexp_2/common.py2
-rw-r--r--prolog/problems/license_plates/getdigits_2/common.py2
-rw-r--r--prolog/problems/license_plates/joindigits_2/common.py2
-rw-r--r--prolog/problems/lists/conc_3/common.py2
-rw-r--r--prolog/problems/lists/count_3/common.py2
-rw-r--r--prolog/problems/lists/del_3/common.py2
-rw-r--r--prolog/problems/lists/divide_3/common.py2
-rw-r--r--prolog/problems/lists/dup_2/common.py2
-rw-r--r--prolog/problems/lists/evenlen_1_+_oddlen_1/common.py2
-rw-r--r--prolog/problems/lists/insert_3/common.py2
-rw-r--r--prolog/problems/lists/len_2/common.py2
-rw-r--r--prolog/problems/lists/max_2/common.py2
-rw-r--r--prolog/problems/lists/memb_2/common.py2
-rw-r--r--prolog/problems/lists/min_2/common.py2
-rw-r--r--prolog/problems/lists/palindrome_1/common.py2
-rw-r--r--prolog/problems/lists/permute_2/common.py2
-rw-r--r--prolog/problems/lists/rev_2/common.py2
-rw-r--r--prolog/problems/lists/shiftleft_2/common.py2
-rw-r--r--prolog/problems/lists/shiftright_2/common.py2
-rw-r--r--prolog/problems/lists/sublist_2/common.py2
-rw-r--r--prolog/problems/lists/sum_2/common.py2
-rw-r--r--prolog/problems/sets/diff_3/common.py2
-rw-r--r--prolog/problems/sets/intersect_3/common.py2
-rw-r--r--prolog/problems/sets/is_subset_2/common.py2
-rw-r--r--prolog/problems/sets/is_superset_2/common.py2
-rw-r--r--prolog/problems/sets/powerset_2/common.py2
-rw-r--r--prolog/problems/sets/subset_2/common.py2
-rw-r--r--prolog/problems/sets/union_3/common.py2
-rw-r--r--prolog/problems/sorting/is_sorted_1/common.py2
-rw-r--r--prolog/problems/sorting/isort_2/common.py2
-rw-r--r--prolog/problems/sorting/pivoting_4/common.py2
-rw-r--r--prolog/problems/sorting/quick_sort_2/common.py2
-rw-r--r--prolog/problems/sorting/sins_3/common.py2
-rw-r--r--prolog/problems/sorting/slowest_sort_ever_2/common.py2
53 files changed, 106 insertions, 0 deletions
diff --git a/prolog/problems/clp_fd/gcd_3/common.py b/prolog/problems/clp_fd/gcd_3/common.py
index 234b126..82ffb28 100644
--- a/prolog/problems/clp_fd/gcd_3/common.py
+++ b/prolog/problems/clp_fd/gcd_3/common.py
@@ -45,6 +45,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/magic_1/common.py b/prolog/problems/clp_fd/magic_1/common.py
index 07adf7a..7978c02 100644
--- a/prolog/problems/clp_fd/magic_1/common.py
+++ b/prolog/problems/clp_fd/magic_1/common.py
@@ -43,6 +43,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/puzzle_abc_3/common.py b/prolog/problems/clp_fd/puzzle_abc_3/common.py
index 9ad6d1b..95458ab 100644
--- a/prolog/problems/clp_fd/puzzle_abc_3/common.py
+++ b/prolog/problems/clp_fd/puzzle_abc_3/common.py
@@ -35,6 +35,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/puzzle_beth_1/common.py b/prolog/problems/clp_fd/puzzle_beth_1/common.py
index 99f0445..0a2bbb6 100644
--- a/prolog/problems/clp_fd/puzzle_beth_1/common.py
+++ b/prolog/problems/clp_fd/puzzle_beth_1/common.py
@@ -30,6 +30,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/puzzle_momson_2/common.py b/prolog/problems/clp_fd/puzzle_momson_2/common.py
index 3074d44..927b250 100644
--- a/prolog/problems/clp_fd/puzzle_momson_2/common.py
+++ b/prolog/problems/clp_fd/puzzle_momson_2/common.py
@@ -37,6 +37,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/puzzle_ratio_2/common.py b/prolog/problems/clp_fd/puzzle_ratio_2/common.py
index fc2d678..914f4d1 100644
--- a/prolog/problems/clp_fd/puzzle_ratio_2/common.py
+++ b/prolog/problems/clp_fd/puzzle_ratio_2/common.py
@@ -38,6 +38,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/clp_fd/tobase_3/common.py b/prolog/problems/clp_fd/tobase_3/common.py
index ce137a4..2b5f37a 100644
--- a/prolog/problems/clp_fd/tobase_3/common.py
+++ b/prolog/problems/clp_fd/tobase_3/common.py
@@ -46,6 +46,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/ancestor_2/common.py b/prolog/problems/family_relations/ancestor_2/common.py
index 1ad1d4f..a946636 100644
--- a/prolog/problems/family_relations/ancestor_2/common.py
+++ b/prolog/problems/family_relations/ancestor_2/common.py
@@ -50,6 +50,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/aunt_2/common.py b/prolog/problems/family_relations/aunt_2/common.py
index 6ad8b05..e92ddfa 100644
--- a/prolog/problems/family_relations/aunt_2/common.py
+++ b/prolog/problems/family_relations/aunt_2/common.py
@@ -54,6 +54,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/brother_2/common.py b/prolog/problems/family_relations/brother_2/common.py
index c8ceb75..73084d2 100644
--- a/prolog/problems/family_relations/brother_2/common.py
+++ b/prolog/problems/family_relations/brother_2/common.py
@@ -48,6 +48,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/connected_3/common.py b/prolog/problems/family_relations/connected_3/common.py
index eee1df5..5b1a3aa 100644
--- a/prolog/problems/family_relations/connected_3/common.py
+++ b/prolog/problems/family_relations/connected_3/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/cousin_2/common.py b/prolog/problems/family_relations/cousin_2/common.py
index e53ef99..d87fb85 100644
--- a/prolog/problems/family_relations/cousin_2/common.py
+++ b/prolog/problems/family_relations/cousin_2/common.py
@@ -61,6 +61,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/descendant_2/common.py b/prolog/problems/family_relations/descendant_2/common.py
index eae7c42..bd8e96a 100644
--- a/prolog/problems/family_relations/descendant_2/common.py
+++ b/prolog/problems/family_relations/descendant_2/common.py
@@ -50,6 +50,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/father_2/common.py b/prolog/problems/family_relations/father_2/common.py
index 363eaa2..13333d1 100644
--- a/prolog/problems/family_relations/father_2/common.py
+++ b/prolog/problems/family_relations/father_2/common.py
@@ -51,6 +51,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/grandparent_2/common.py b/prolog/problems/family_relations/grandparent_2/common.py
index 3d187d9..2313387 100644
--- a/prolog/problems/family_relations/grandparent_2/common.py
+++ b/prolog/problems/family_relations/grandparent_2/common.py
@@ -52,6 +52,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/mother_2/common.py b/prolog/problems/family_relations/mother_2/common.py
index cb8ddee..456f51f 100644
--- a/prolog/problems/family_relations/mother_2/common.py
+++ b/prolog/problems/family_relations/mother_2/common.py
@@ -52,6 +52,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py
index 0466a3d..1d8eaeb 100644
--- a/prolog/problems/family_relations/sister_2/common.py
+++ b/prolog/problems/family_relations/sister_2/common.py
@@ -49,6 +49,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/license_plates/checklicenseplate_3/common.py b/prolog/problems/license_plates/checklicenseplate_3/common.py
index 06ce47c..028b077 100644
--- a/prolog/problems/license_plates/checklicenseplate_3/common.py
+++ b/prolog/problems/license_plates/checklicenseplate_3/common.py
@@ -81,6 +81,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/license_plates/firstminus_2/common.py b/prolog/problems/license_plates/firstminus_2/common.py
index 2e3d69d..e4b09a0 100644
--- a/prolog/problems/license_plates/firstminus_2/common.py
+++ b/prolog/problems/license_plates/firstminus_2/common.py
@@ -32,6 +32,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/license_plates/genexp_2/common.py b/prolog/problems/license_plates/genexp_2/common.py
index acee0ff..28d9b57 100644
--- a/prolog/problems/license_plates/genexp_2/common.py
+++ b/prolog/problems/license_plates/genexp_2/common.py
@@ -53,6 +53,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/license_plates/getdigits_2/common.py b/prolog/problems/license_plates/getdigits_2/common.py
index ef9e83d..68b28b8 100644
--- a/prolog/problems/license_plates/getdigits_2/common.py
+++ b/prolog/problems/license_plates/getdigits_2/common.py
@@ -37,6 +37,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/license_plates/joindigits_2/common.py b/prolog/problems/license_plates/joindigits_2/common.py
index 6ff57bf..ed08b28 100644
--- a/prolog/problems/license_plates/joindigits_2/common.py
+++ b/prolog/problems/license_plates/joindigits_2/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/conc_3/common.py b/prolog/problems/lists/conc_3/common.py
index 7ee44b5..e24ec18 100644
--- a/prolog/problems/lists/conc_3/common.py
+++ b/prolog/problems/lists/conc_3/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/count_3/common.py b/prolog/problems/lists/count_3/common.py
index d260b05..25474b6 100644
--- a/prolog/problems/lists/count_3/common.py
+++ b/prolog/problems/lists/count_3/common.py
@@ -40,6 +40,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/del_3/common.py b/prolog/problems/lists/del_3/common.py
index 5be6599..9a1554a 100644
--- a/prolog/problems/lists/del_3/common.py
+++ b/prolog/problems/lists/del_3/common.py
@@ -34,6 +34,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/divide_3/common.py b/prolog/problems/lists/divide_3/common.py
index b522254..a600e02 100644
--- a/prolog/problems/lists/divide_3/common.py
+++ b/prolog/problems/lists/divide_3/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/dup_2/common.py b/prolog/problems/lists/dup_2/common.py
index 36e31f8..0593ae5 100644
--- a/prolog/problems/lists/dup_2/common.py
+++ b/prolog/problems/lists/dup_2/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
index ea86b40..2adacaf 100644
--- a/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
+++ b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
@@ -42,6 +42,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/insert_3/common.py b/prolog/problems/lists/insert_3/common.py
index ac8437b..b3b5f1c 100644
--- a/prolog/problems/lists/insert_3/common.py
+++ b/prolog/problems/lists/insert_3/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/len_2/common.py b/prolog/problems/lists/len_2/common.py
index 2c4fea8..ca3d985 100644
--- a/prolog/problems/lists/len_2/common.py
+++ b/prolog/problems/lists/len_2/common.py
@@ -35,6 +35,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/max_2/common.py b/prolog/problems/lists/max_2/common.py
index 1f6969b..b4a0311 100644
--- a/prolog/problems/lists/max_2/common.py
+++ b/prolog/problems/lists/max_2/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/memb_2/common.py b/prolog/problems/lists/memb_2/common.py
index fea670b..e0914fa 100644
--- a/prolog/problems/lists/memb_2/common.py
+++ b/prolog/problems/lists/memb_2/common.py
@@ -32,6 +32,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/min_2/common.py b/prolog/problems/lists/min_2/common.py
index 4ab3e65..a26a14d 100644
--- a/prolog/problems/lists/min_2/common.py
+++ b/prolog/problems/lists/min_2/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/palindrome_1/common.py b/prolog/problems/lists/palindrome_1/common.py
index cf1a15b..251c0da 100644
--- a/prolog/problems/lists/palindrome_1/common.py
+++ b/prolog/problems/lists/palindrome_1/common.py
@@ -40,6 +40,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/permute_2/common.py b/prolog/problems/lists/permute_2/common.py
index 1c16bd9..2568bbb 100644
--- a/prolog/problems/lists/permute_2/common.py
+++ b/prolog/problems/lists/permute_2/common.py
@@ -38,6 +38,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/rev_2/common.py b/prolog/problems/lists/rev_2/common.py
index b8dbbe3..0875273 100644
--- a/prolog/problems/lists/rev_2/common.py
+++ b/prolog/problems/lists/rev_2/common.py
@@ -38,6 +38,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/shiftleft_2/common.py b/prolog/problems/lists/shiftleft_2/common.py
index 9973e52..be0013f 100644
--- a/prolog/problems/lists/shiftleft_2/common.py
+++ b/prolog/problems/lists/shiftleft_2/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/shiftright_2/common.py b/prolog/problems/lists/shiftright_2/common.py
index 09c4067..21ce708 100644
--- a/prolog/problems/lists/shiftright_2/common.py
+++ b/prolog/problems/lists/shiftright_2/common.py
@@ -36,6 +36,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/sublist_2/common.py b/prolog/problems/lists/sublist_2/common.py
index b5f6b89..99e0cf3 100644
--- a/prolog/problems/lists/sublist_2/common.py
+++ b/prolog/problems/lists/sublist_2/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/lists/sum_2/common.py b/prolog/problems/lists/sum_2/common.py
index 026533f..2b6808a 100644
--- a/prolog/problems/lists/sum_2/common.py
+++ b/prolog/problems/lists/sum_2/common.py
@@ -35,6 +35,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/diff_3/common.py b/prolog/problems/sets/diff_3/common.py
index dbb80b4..d9b5362 100644
--- a/prolog/problems/sets/diff_3/common.py
+++ b/prolog/problems/sets/diff_3/common.py
@@ -48,6 +48,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/intersect_3/common.py b/prolog/problems/sets/intersect_3/common.py
index 4bb9069..e30e3dc 100644
--- a/prolog/problems/sets/intersect_3/common.py
+++ b/prolog/problems/sets/intersect_3/common.py
@@ -47,6 +47,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/is_subset_2/common.py b/prolog/problems/sets/is_subset_2/common.py
index 9e21584..aee4e81 100644
--- a/prolog/problems/sets/is_subset_2/common.py
+++ b/prolog/problems/sets/is_subset_2/common.py
@@ -41,6 +41,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/is_superset_2/common.py b/prolog/problems/sets/is_superset_2/common.py
index 48c64a4..db32c8d 100644
--- a/prolog/problems/sets/is_superset_2/common.py
+++ b/prolog/problems/sets/is_superset_2/common.py
@@ -41,6 +41,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/powerset_2/common.py b/prolog/problems/sets/powerset_2/common.py
index 6208c0f..020b05e 100644
--- a/prolog/problems/sets/powerset_2/common.py
+++ b/prolog/problems/sets/powerset_2/common.py
@@ -39,6 +39,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/subset_2/common.py b/prolog/problems/sets/subset_2/common.py
index 6f2fafb..3871880 100644
--- a/prolog/problems/sets/subset_2/common.py
+++ b/prolog/problems/sets/subset_2/common.py
@@ -52,6 +52,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sets/union_3/common.py b/prolog/problems/sets/union_3/common.py
index 8df6b53..30780dc 100644
--- a/prolog/problems/sets/union_3/common.py
+++ b/prolog/problems/sets/union_3/common.py
@@ -44,6 +44,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/is_sorted_1/common.py b/prolog/problems/sorting/is_sorted_1/common.py
index b4ae92d..8921b54 100644
--- a/prolog/problems/sorting/is_sorted_1/common.py
+++ b/prolog/problems/sorting/is_sorted_1/common.py
@@ -44,6 +44,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/isort_2/common.py b/prolog/problems/sorting/isort_2/common.py
index 5acd971..e929eb1 100644
--- a/prolog/problems/sorting/isort_2/common.py
+++ b/prolog/problems/sorting/isort_2/common.py
@@ -43,6 +43,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/pivoting_4/common.py b/prolog/problems/sorting/pivoting_4/common.py
index 92403c3..e558a8a 100644
--- a/prolog/problems/sorting/pivoting_4/common.py
+++ b/prolog/problems/sorting/pivoting_4/common.py
@@ -40,6 +40,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/quick_sort_2/common.py b/prolog/problems/sorting/quick_sort_2/common.py
index 94677de..c287f38 100644
--- a/prolog/problems/sorting/quick_sort_2/common.py
+++ b/prolog/problems/sorting/quick_sort_2/common.py
@@ -49,6 +49,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/sins_3/common.py b/prolog/problems/sorting/sins_3/common.py
index b466743..0650eb6 100644
--- a/prolog/problems/sorting/sins_3/common.py
+++ b/prolog/problems/sorting/sins_3/common.py
@@ -41,6 +41,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)
diff --git a/prolog/problems/sorting/slowest_sort_ever_2/common.py b/prolog/problems/sorting/slowest_sort_ever_2/common.py
index 93367bb..06df01b 100644
--- a/prolog/problems/sorting/slowest_sort_ever_2/common.py
+++ b/prolog/problems/sorting/slowest_sort_ever_2/common.py
@@ -50,6 +50,8 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
+ except:
+ pass
finally:
if engine_id:
prolog.engine.destroy(engine_id)