From 6523023645bd2227cac68f46364dff3867d9641a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 22 Aug 2016 17:45:01 +0200 Subject: [PATCH] Minor yosys-smtbmc bugfix --- backends/smt2/smtbmc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backends/smt2/smtbmc.py b/backends/smt2/smtbmc.py index a11fed2d5..498621612 100644 --- a/backends/smt2/smtbmc.py +++ b/backends/smt2/smtbmc.py @@ -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) -- 2.30.2