if step > num_steps-skip_steps: print_msg("Skipping induction in step %d.." % (step)) continue skip_counter += 1 if skip_counter < step_size: print_msg("Skipping induction in step %d.." % (step)) continue skip_counter = 0 print_msg("Trying induction in step %d.." % (step)) if smt.check_sat() == "sat": if step == 0: print("%s Temporal induction failed!" % smt.timestamp()) print_anyconsts(num_steps) print_failed_asserts(num_steps) write_trace(step, num_steps+1, '%') elif dumpall: print_anyconsts(num_steps) print_failed_asserts(num_steps) write_trace(step, num_steps+1, "%d" % step) else: print("%s Temporal induction successful." % smt.timestamp()) retstatus = True break
smt_assert_antecedent("(not (|%s_is| s%d))" % (topmod, step+i)) smt_assert_consequent("(|%s_u| s%d)" % (topmod, step+i)) smt_assert_antecedent("(|%s_h| s%d)" % (topmod, step+i)) smt_assert_antecedent("(|%s_t| s%d s%d)" % (topmod, step+i-1, step+i)) smt_assert_consequent(get_constr_expr(constr_assumes, step+i)) last_check_step = step+i if not gentrace: if presat: if last_check_step == step: print_msg("Checking assumptions in step %d.." % (step)) else: print_msg("Checking assumptions in steps %d to %d.." % (step, last_check_step)) if smt_check_sat() == "unsat": print("%s Warmup failed!" % smt.timestamp()) retstatus = False break if not final_only: if last_check_step == step: print_msg("Checking assertions in step %d.." % (step)) else: print_msg("Checking assertions in steps %d to %d.." % (step, last_check_step)) smt_push() smt_assert("(not (and %s))" % " ".join(["(|%s_a| s%d)" % (topmod, i) for i in range(step, last_check_step+1)] + [get_constr_expr(constr_asserts, i) for i in range(step, last_check_step+1)])) if smt_check_sat() == "sat": print("%s BMC failed!" % smt.timestamp())