PySMT 0.9.7.dev423__tar.gz → 0.9.7.dev431__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pysmt-0.9.7.dev423/PySMT.egg-info → pysmt-0.9.7.dev431}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431/PySMT.egg-info}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/__init__.py +1 -1
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/msat.py +1 -6
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/z3.py +8 -5
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_back.py +29 -3
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_regressions.py +34 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/LICENSE +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/MANIFEST.in +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/NOTICE +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/PySMT.egg-info/SOURCES.txt +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/PySMT.egg-info/dependency_links.txt +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/PySMT.egg-info/entry_points.txt +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/PySMT.egg-info/top_level.txt +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/README.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/CHANGES.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/api_ref.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/development.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/getting_started.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/index.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/tutorials/boolean_logic.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/docs/tutorials.rst +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/__main__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/check_version.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/install.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/base.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/bdd.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/btor.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/msat.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/optimsat.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/pico.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/yices.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/installers/z3.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/cmd/shell.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/configuration.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/constants.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/decorators.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/environment.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/exceptions.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/factory.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/fnode.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/formula.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/logics.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/operators.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/goal.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/msat.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/optimizer.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/optimsat.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/yices.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/optimization/z3.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/oracles.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/parsing.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/printers.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/rewritings.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/shortcuts.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/simplifier.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/annotations.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/commands.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/parser/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/parser/parser.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/printers.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/script.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/solver.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/smtlib/utils.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/bdd.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/btor.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/dynmsat.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/eager.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/interpolation.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/options.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/pico.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/portfolio.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/qelim.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/smtlib.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/solver.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/solvers/yices.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/substituter.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/configs/config1.ini +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/configs/config_bad.ini +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/examples.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/omt_examples.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/optimization_utils.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/parser_utils.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_annotations.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_fuzzed.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_generic_wrapper.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_griggio.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_model_validation.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_omt_lib_solver.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_examples.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_extensibility.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_lra.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_omt.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_arrays.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_lia.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_lira.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_lra.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_nia.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_nra.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_uf.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_qf_ufbv.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_parser_type_error.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/smtlib/test_smtlibscript.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_array.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_bdd.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_bv.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_bv_simplification.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_cnf.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_configuration.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_constants.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_cvc_quantifiers.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_dwf.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_eager_model.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_env.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_euf.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_formula.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_hr_parsing.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_imports.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_int.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_interpolation.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_lira.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_logics.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_models.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_native_qe.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_nia.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_nlira.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_optimization.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_optimizing.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_oracles.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_portfolio.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_printing.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_qe.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_rewritings.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_shannon_expansion.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_simplify.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_size.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_solving.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_sorts.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_string.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_typechecker.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_unsat_cores.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_walker_ext.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/test/test_walkers.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/type_checker.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/typing.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/utils.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/walkers/__init__.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/walkers/dag.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/walkers/generic.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/walkers/identitydag.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/pysmt/walkers/tree.py +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/setup.cfg +0 -0
- {pysmt-0.9.7.dev423 → pysmt-0.9.7.dev431}/setup.py +0 -0
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
from typing import Tuple, Union
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev",
|
|
22
|
+
VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 431)
|
|
23
23
|
|
|
24
24
|
# Try to provide human-readable version of latest commit for dev versions
|
|
25
25
|
# E.g. v0.5.1-4-g49a49f2-wip
|
|
@@ -322,7 +322,7 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
322
322
|
def all_sat(self, important, callback):
|
|
323
323
|
self.push()
|
|
324
324
|
self._msat_lib.msat_all_sat(self.msat_env(),
|
|
325
|
-
[self.
|
|
325
|
+
[self.converter.convert(x) for x in important],
|
|
326
326
|
callback)
|
|
327
327
|
self.pop()
|
|
328
328
|
|
|
@@ -336,11 +336,6 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
336
336
|
for _ in range(levels):
|
|
337
337
|
self._msat_lib.msat_pop_backtrack_point(self.msat_env())
|
|
338
338
|
|
|
339
|
-
def _var2term(self, var):
|
|
340
|
-
decl = self._msat_lib.msat_find_decl(self.msat_env(), var.symbol_name())
|
|
341
|
-
titem = self._msat_lib.msat_make_term(self.msat_env(), decl, [])
|
|
342
|
-
return titem
|
|
343
|
-
|
|
344
339
|
def set_preferred_var(self, var, val=None):
|
|
345
340
|
tvar = self.converter.convert(var)
|
|
346
341
|
mval = self._msat_lib.MSAT_UNDEF
|
|
@@ -340,12 +340,12 @@ class Z3Converter(Converter, DagWalker):
|
|
|
340
340
|
z3.Z3_OP_IMPLIES: lambda args, expr: self.mgr.Implies(args[0], args[1]),
|
|
341
341
|
z3.Z3_OP_ITE: lambda args, expr: self.mgr.Ite(args[0], args[1], args[2]),
|
|
342
342
|
z3.Z3_OP_TO_REAL: lambda args, expr: self.mgr.ToReal(args[0]),
|
|
343
|
-
z3.Z3_OP_BAND : lambda args, expr: self.mgr.BVAnd(args
|
|
344
|
-
z3.Z3_OP_BOR : lambda args, expr: self.mgr.BVOr(args
|
|
343
|
+
z3.Z3_OP_BAND : lambda args, expr: self.mgr.BVAnd(args),
|
|
344
|
+
z3.Z3_OP_BOR : lambda args, expr: self.mgr.BVOr(args),
|
|
345
345
|
z3.Z3_OP_BXOR : lambda args, expr: self.mgr.BVXor(args[0], args[1]),
|
|
346
346
|
z3.Z3_OP_BNOT : lambda args, expr: self.mgr.BVNot(args[0]),
|
|
347
347
|
z3.Z3_OP_BNEG : lambda args, expr: self.mgr.BVNeg(args[0]),
|
|
348
|
-
z3.Z3_OP_CONCAT : lambda args, expr: self.mgr.BVConcat(args
|
|
348
|
+
z3.Z3_OP_CONCAT : lambda args, expr: self.mgr.BVConcat(args),
|
|
349
349
|
z3.Z3_OP_ULT : lambda args, expr: self.mgr.BVULT(args[0], args[1]),
|
|
350
350
|
z3.Z3_OP_ULEQ : lambda args, expr: self.mgr.BVULE(args[0], args[1]),
|
|
351
351
|
z3.Z3_OP_SLT : lambda args, expr: self.mgr.BVSLT(args[0], args[1]),
|
|
@@ -354,8 +354,8 @@ class Z3Converter(Converter, DagWalker):
|
|
|
354
354
|
z3.Z3_OP_UGEQ : lambda args, expr: self.mgr.BVUGE(args[0], args[1]),
|
|
355
355
|
z3.Z3_OP_SGT : lambda args, expr: self.mgr.BVSGT(args[0], args[1]),
|
|
356
356
|
z3.Z3_OP_SGEQ : lambda args, expr: self.mgr.BVSGE(args[0], args[1]),
|
|
357
|
-
z3.Z3_OP_BADD : lambda args, expr: self.mgr.BVAdd(args
|
|
358
|
-
z3.Z3_OP_BMUL : lambda args, expr: self.mgr.BVMul(args
|
|
357
|
+
z3.Z3_OP_BADD : lambda args, expr: self.mgr.BVAdd(args),
|
|
358
|
+
z3.Z3_OP_BMUL : lambda args, expr: self.mgr.BVMul(args),
|
|
359
359
|
z3.Z3_OP_BUDIV : lambda args, expr: self.mgr.BVUDiv(args[0], args[1]),
|
|
360
360
|
z3.Z3_OP_BSDIV : lambda args, expr: self.mgr.BVSDiv(args[0], args[1]),
|
|
361
361
|
z3.Z3_OP_BUREM : lambda args, expr: self.mgr.BVURem(args[0], args[1]),
|
|
@@ -513,6 +513,9 @@ class Z3Converter(Converter, DagWalker):
|
|
|
513
513
|
assert not len(args) > 2 or \
|
|
514
514
|
(z3.is_and(expr) or z3.is_or(expr) or
|
|
515
515
|
z3.is_add(expr) or z3.is_mul(expr) or
|
|
516
|
+
z3.is_app_of(expr, z3.Z3_OP_BAND) or z3.is_app_of(expr, z3.Z3_OP_BOR) or
|
|
517
|
+
z3.is_app_of(expr, z3.Z3_OP_BADD) or z3.is_app_of(expr, z3.Z3_OP_BMUL) or
|
|
518
|
+
z3.is_app_of(expr, z3.Z3_OP_CONCAT) or
|
|
516
519
|
(len(args) == 3 and (z3.is_ite(expr) or z3.is_array_store(expr)))),\
|
|
517
520
|
"Unexpected n-ary term: %s" % expr
|
|
518
521
|
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
18
|
from pysmt.shortcuts import FreshSymbol, GT, And, Plus, Real, Int, LE, Iff
|
|
19
|
-
from pysmt.shortcuts import Solver
|
|
20
|
-
from pysmt.
|
|
19
|
+
from pysmt.shortcuts import Solver, Symbol, EqualsOrIff
|
|
20
|
+
from pysmt.shortcuts import BVAdd, BVMul, BVAnd, BVOr, BVConcat
|
|
21
|
+
from pysmt.typing import REAL, INT, BVType
|
|
21
22
|
from pysmt.test import TestCase, skipIfSolverNotAvailable, main
|
|
22
23
|
from pysmt.test.examples import get_example_formulae
|
|
23
|
-
from pysmt.logics import QF_UFLIRA
|
|
24
|
+
from pysmt.logics import QF_UFLIRA, QF_BV
|
|
24
25
|
from pysmt.exceptions import NoSolverAvailableError
|
|
25
26
|
|
|
26
27
|
|
|
@@ -87,6 +88,31 @@ class TestBasic(TestCase):
|
|
|
87
88
|
self.do_back("z3", via_smtlib=True)
|
|
88
89
|
self.do_back("z3", via_smtlib=False)
|
|
89
90
|
|
|
91
|
+
@skipIfSolverNotAvailable("z3")
|
|
92
|
+
def test_z3_back_nary_bv(self):
|
|
93
|
+
# Z3 simplification can produce n-ary (more than two arguments)
|
|
94
|
+
# bit-vector operations. Back-converting them used to fail because
|
|
95
|
+
# only the binary case was handled (unlike the integer operations).
|
|
96
|
+
import z3 # type: ignore[import]
|
|
97
|
+
|
|
98
|
+
s = Solver(name="z3", logic=QF_BV)
|
|
99
|
+
conv = s.converter
|
|
100
|
+
a = Symbol("a", BVType(8))
|
|
101
|
+
b = Symbol("b", BVType(8))
|
|
102
|
+
c = Symbol("c", BVType(8))
|
|
103
|
+
|
|
104
|
+
for f in (BVAdd(BVAdd(a, b), c),
|
|
105
|
+
BVMul(BVMul(a, b), c),
|
|
106
|
+
BVAnd(BVAnd(a, b), c),
|
|
107
|
+
BVOr(BVOr(a, b), c),
|
|
108
|
+
BVConcat(BVConcat(a, b), c)):
|
|
109
|
+
# Simplify in Z3 to flatten the associative operators into a
|
|
110
|
+
# single n-ary application before converting back.
|
|
111
|
+
simplified = z3.simplify(conv.convert(f))
|
|
112
|
+
res = conv.back(simplified)
|
|
113
|
+
self.assertValid(EqualsOrIff(f, res), logic=QF_BV,
|
|
114
|
+
solver_name="z3")
|
|
115
|
+
|
|
90
116
|
|
|
91
117
|
if __name__ == '__main__':
|
|
92
118
|
main()
|
|
@@ -574,6 +574,40 @@ class TestRegressions(TestCase):
|
|
|
574
574
|
s.add_assertion(f)
|
|
575
575
|
self.assertFalse(s.solve())
|
|
576
576
|
|
|
577
|
+
@skipIfSolverNotAvailable("msat")
|
|
578
|
+
def test_msat_all_sat_theory_atoms(self):
|
|
579
|
+
# Regression test: MathSAT5Solver.all_sat must accept arbitrary
|
|
580
|
+
# SMT-atoms as "important" terms, not only Boolean symbols.
|
|
581
|
+
# Previously the "important" terms were converted with a helper
|
|
582
|
+
# (_var2term) that assumed each term was a declared symbol, so
|
|
583
|
+
# passing a theory atom raised an AssertionError.
|
|
584
|
+
x = Symbol("x", INT)
|
|
585
|
+
f = And(LE(Int(0), x), LE(x, Int(5)))
|
|
586
|
+
atom = LE(x, Int(2)) # a theory atom, not a Boolean symbol
|
|
587
|
+
|
|
588
|
+
result = []
|
|
589
|
+
|
|
590
|
+
def callback(model, converter, res):
|
|
591
|
+
res.append(And(converter.back(v) for v in model))
|
|
592
|
+
return 1 # continue enumeration
|
|
593
|
+
|
|
594
|
+
with Solver(name="msat",
|
|
595
|
+
solver_options={
|
|
596
|
+
"dpll.allsat_minimize_model": "false",
|
|
597
|
+
"dpll.allsat_allow_duplicates": "false",
|
|
598
|
+
"preprocessor.toplevel_propagation": "false",
|
|
599
|
+
"preprocessor.simplification": "0",
|
|
600
|
+
}) as msat:
|
|
601
|
+
msat.add_assertion(f)
|
|
602
|
+
# This call used to raise AssertionError on a theory atom.
|
|
603
|
+
msat.all_sat([atom], lambda m: callback(m, msat.converter, result))
|
|
604
|
+
|
|
605
|
+
# The atom can be both true (x in [0,2]) and false (x in [3,5]),
|
|
606
|
+
# so we expect exactly the two disjoint total assignments.
|
|
607
|
+
self.assertEqual(len(result), 2, result)
|
|
608
|
+
self.assertIn(atom, result)
|
|
609
|
+
self.assertIn(Not(atom), result)
|
|
610
|
+
|
|
577
611
|
|
|
578
612
|
if __name__ == "__main__":
|
|
579
613
|
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|