Minor yosys-smtbmc bugfix
authorClifford Wolf <clifford@clifford.at>
Mon, 22 Aug 2016 15:45:01 +0000 (17:45 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 22 Aug 2016 15:45:01 +0000 (17:45 +0200)
backends/smt2/smtbmc.py

index a11fed2d52b0d01cd6b28af30cb6c508376fcc56..4986216120221877b06e539163392ac0fffe2b64 100644 (file)
@@ -171,6 +171,12 @@ def get_constr_expr(db, state):
         expr = re.sub(r'\[([^\]]+)\]', lambda match: smt.net_expr(topmod, "s%d" % state, smt.get_path(topmod, match.group(1))), expr)
         expr_list.append(expr)
 
+    if len(expr_list) == 0:
+        return "true"
+
+    if len(expr_list) == 1:
+        return expr_list[0]
+
     return "(and %s)" % " ".join(expr_list)