diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-04-30 21:27:18 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-25 20:38:29 +0000 |
commit | 903456c267c84d6d924a96ddf4f2b4e2b5caec4a (patch) | |
tree | 8c01bc44823e25afb480ab331f7f92dc98da89cd /backends | |
parent | 59b355fb85cb7cda4a25696850bb3caffce3115f (diff) | |
download | yosys-903456c267c84d6d924a96ddf4f2b4e2b5caec4a.tar.gz yosys-903456c267c84d6d924a96ddf4f2b4e2b5caec4a.tar.bz2 yosys-903456c267c84d6d924a96ddf4f2b4e2b5caec4a.zip |
qbfsat: Add `-solver` option and allow choice of Z3 or Yices, making Yices the default.
Ensures that "BV" is the logic whenever solving an exists-forall problem with Yices, moves the "(set-logic ...)" directive above any non-info line, sets the `ef-max-iters` parameter to a very high number when using Yices in exists-forall mode so as not to prematurely abandon difficult problems, and does not provide the incompatible "--incremental" Yices argument when in exists-forall mode.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/smt2/smtio.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py index 69f59df79..7cb1e8968 100644 --- a/backends/smt2/smtio.py +++ b/backends/smt2/smtio.py @@ -172,7 +172,7 @@ class SmtIo: self.unroll = False if self.solver == "yices": - if self.noincr: + if self.noincr or self.forall: self.popen_vargs = ['yices-smt2'] + self.solver_opts else: self.popen_vargs = ['yices-smt2', '--incremental'] + self.solver_opts @@ -232,17 +232,21 @@ class SmtIo: if self.logic_uf: self.logic += "UF" if self.logic_bv: self.logic += "BV" if self.logic_dt: self.logic = "ALL" + if self.solver == "yices" and self.forall: self.logic = "BV" self.setup_done = True - for stmt in self.info_stmts: - self.write(stmt) + if self.forall and self.solver == "yices": + self.write("(set-option :yices-ef-max-iters 1000000000)") if self.produce_models: self.write("(set-option :produce-models true)") self.write("(set-logic %s)" % self.logic) + for stmt in self.info_stmts: + self.write(stmt) + def timestamp(self): secs = int(time() - self.start_time) return "## %3d:%02d:%02d " % (secs // (60*60), (secs // 60) % 60, secs % 60) |