Added smtc support for top-level state with [], [N:] syntax
authorClifford Wolf <clifford@clifford.at>
Sat, 8 Oct 2016 10:25:34 +0000 (12:25 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 8 Oct 2016 10:25:34 +0000 (12:25 +0200)
backends/smt2/smtbmc.py
backends/smt2/smtio.py

index eac693632fbd27846212ce9589c5693e8a8716c5..0cfb386a163a2e86e194b3cac2b9dc1aaa0d7619 100644 (file)
@@ -249,7 +249,7 @@ def get_constr_expr(db, state, final=False, getvalues=False):
         if state not in db:
             return ([], [], []) if getvalues else "true"
 
-    netref_regex = re.compile(r'(^|[( ])\[(-?[0-9]+:|)([^\]]+)\](?=[ )]|$)')
+    netref_regex = re.compile(r'(^|[( ])\[(-?[0-9]+:|)([^\]]*)\](?=[ )]|$)')
 
     def replace_netref(match):
         state_sel = match.group(2)
index eccb6501429b1e40838c9716340eb0576aba643a..72bd8b178b33a16161d04adc40a5f231d1322019 100644 (file)
@@ -534,6 +534,8 @@ class SmtIo:
     def net_expr(self, mod, base, path):
         if len(path) == 1:
             assert mod in self.modinfo
+            if path[0] == "":
+                return base
             if path[0] in self.modinfo[mod].cells:
                 return "(|%s_h %s| %s)" % (mod, path[0], base)
             if path[0] in self.modinfo[mod].wsize: