Add proper error message for when smtbmc "append" fails
authorClifford Wolf <clifford@clifford.at>
Sun, 4 Nov 2018 13:41:28 +0000 (14:41 +0100)
committerClifford Wolf <clifford@clifford.at>
Sun, 4 Nov 2018 13:41:28 +0000 (14:41 +0100)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
backends/smt2/smtbmc.py

index 6af2a5ac169276779dd2f5fd69144e7e2b2dbb64..b944ee004d883b3deefc77a9fab6d5ce2160a334 100644 (file)
@@ -1259,7 +1259,11 @@ elif covermode:
                     smt_assert_antecedent("(|%s_t| s%d s%d)" % (topmod, i-1, i))
                     smt_assert_consequent(get_constr_expr(constr_assumes, i))
                 print_msg("Re-solving with appended steps..")
-                assert smt_check_sat() == "sat"
+                if smt_check_sat() == "unsat":
+                    print("%s Cannot appended steps without violating assumptions!" % smt.timestamp())
+                    found_failed_assert = True
+                    retstatus = False
+                    break
 
             reached_covers = smt.bv2bin(smt.get("(covers_%d s%d)" % (coveridx, step)))
             assert len(reached_covers) == len(cover_desc)
@@ -1377,7 +1381,11 @@ else:  # not tempind, covermode
                             smt_assert_antecedent("(|%s_h| s%d)" % (topmod, i))
                             smt_assert_antecedent("(|%s_t| s%d s%d)" % (topmod, i-1, i))
                             smt_assert_consequent(get_constr_expr(constr_assumes, i))
-                            assert smt_check_sat() == "sat"
+                    print_msg("Re-solving with appended steps..")
+                    if smt_check_sat() == "unsat":
+                        print("%s Cannot appended steps without violating assumptions!" % smt.timestamp())
+                        retstatus = False
+                        break
                     print_anyconsts(step)
                     for i in range(step, last_check_step+1):
                         print_failed_asserts(i)