Fix $initstate handling bug in yosys-smtbmc
authorClifford Wolf <clifford@clifford.at>
Wed, 11 Jan 2017 13:14:12 +0000 (14:14 +0100)
committerClifford Wolf <clifford@clifford.at>
Wed, 11 Jan 2017 13:14:12 +0000 (14:14 +0100)
backends/smt2/smtbmc.py

index 8dbb047aa457401bf55d216288864f0b5d3d236d..ecee6795e7b14d58fc8e27e24e5b5d26488ce489 100644 (file)
@@ -789,6 +789,7 @@ else:  # not tempind
         for i in range(1, step_size):
             if step+i < num_steps:
                 smt.write("(declare-fun s%d () |%s_s|)" % (step+i, topmod))
+                smt.write("(assert (not (|%s_is| s%d)))" % (topmod, step+i))
                 smt.write("(assert (|%s_u| s%d))" % (topmod, step+i))
                 smt.write("(assert (|%s_h| s%d))" % (topmod, step+i))
                 smt.write("(assert (|%s_t| s%d s%d))" % (topmod, step+i-1, step+i))
@@ -812,6 +813,7 @@ else:  # not tempind
                         for i in range(last_check_step+1, last_check_step+1+append_steps):
                             print_msg("Appending additional step %d." % i)
                             smt.write("(declare-fun s%d () |%s_s|)" % (i, topmod))
+                            smt.write("(assert (not (|%s_is| s%d)))" % (topmod, i))
                             smt.write("(assert (|%s_u| s%d))" % (topmod, i))
                             smt.write("(assert (|%s_h| s%d))" % (topmod, i))
                             smt.write("(assert (|%s_t| s%d s%d))" % (topmod, i-1, i))