PySMT 0.9.7.dev474__tar.gz → 0.9.7.dev479__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.dev474/PySMT.egg-info → pysmt-0.9.7.dev479}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479/PySMT.egg-info}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/CHANGES.rst +7 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/__init__.py +1 -1
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/parser/parser.py +4 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/msat.py +18 -4
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/z3.py +11 -3
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_model_validation.py +23 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_unsat_cores.py +20 -1
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/LICENSE +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/MANIFEST.in +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/NOTICE +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/PySMT.egg-info/SOURCES.txt +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/PySMT.egg-info/dependency_links.txt +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/PySMT.egg-info/entry_points.txt +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/PySMT.egg-info/top_level.txt +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/README.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/api_ref.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/development.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/getting_started.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/index.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/tutorials/boolean_logic.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/docs/tutorials.rst +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/__main__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/check_version.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/install.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/base.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/bdd.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/btor.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/msat.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/optimsat.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/pico.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/yices.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/installers/z3.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/cmd/shell.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/configuration.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/constants.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/decorators.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/environment.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/exceptions.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/factory.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/fnode.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/formula.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/logics.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/operators.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/goal.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/msat.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/optimizer.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/optimsat.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/yices.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/optimization/z3.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/oracles.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/parsing.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/printers.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/rewritings.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/shortcuts.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/simplifier.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/annotations.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/commands.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/parser/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/printers.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/script.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/solver.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/smtlib/utils.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/bdd.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/btor.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/dynmsat.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/eager.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/interpolation.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/options.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/pico.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/portfolio.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/qelim.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/smtlib.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/solver.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/solvers/yices.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/substituter.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/configs/config1.ini +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/configs/config_bad.ini +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/examples.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/omt_examples.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/optimization_utils.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/parser_utils.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_annotations.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_fuzzed.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_generic_wrapper.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_griggio.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_omt_lib_solver.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_examples.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_extensibility.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_lra.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_omt.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_arrays.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_lia.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_lira.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_lra.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_nia.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_nra.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_uf.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_qf_ufbv.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_parser_type_error.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/smtlib/test_smtlibscript.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_array.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_back.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_bdd.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_bv.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_bv_simplification.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_cnf.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_configuration.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_constants.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_cvc_quantifiers.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_dwf.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_eager_model.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_env.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_euf.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_formula.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_hr_parsing.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_imports.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_int.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_interpolation.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_lira.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_logics.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_models.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_native_qe.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_nia.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_nlira.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_optimization.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_optimizing.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_oracles.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_portfolio.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_printing.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_qe.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_regressions.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_rewritings.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_shannon_expansion.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_simplify.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_size.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_solving.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_sorts.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_string.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_typechecker.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_walker_ext.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/test/test_walkers.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/type_checker.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/typing.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/utils.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/walkers/__init__.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/walkers/dag.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/walkers/generic.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/walkers/identitydag.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/pysmt/walkers/tree.py +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/setup.cfg +0 -0
- {pysmt-0.9.7.dev474 → pysmt-0.9.7.dev479}/setup.py +0 -0
|
@@ -4,6 +4,13 @@ Change Log
|
|
|
4
4
|
(unreleased)
|
|
5
5
|
------------
|
|
6
6
|
|
|
7
|
+
* Fixed: MathSAT segfaulted in ``get_unsat_core()`` after solving under
|
|
8
|
+
a non-literal assumption, because reading the core popped the
|
|
9
|
+
assumption level and left MathSAT's core with dangling terms. Z3 did
|
|
10
|
+
not crash but reported an internal symbol in place of the assumption,
|
|
11
|
+
and raised on a second core request. Both now report the assumption
|
|
12
|
+
itself.
|
|
13
|
+
|
|
7
14
|
* Fixed: The assumptions passed to ``solve()`` were missing from the
|
|
8
15
|
unsat core. ``get_unsat_core()`` now reports them alongside the
|
|
9
16
|
assertions, in both the "all" and the "named" unsat cores mode
|
|
@@ -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", 479)
|
|
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
|
|
@@ -561,6 +561,10 @@ class SmtLibParser(object):
|
|
|
561
561
|
return res
|
|
562
562
|
stack[-1].append(handler)
|
|
563
563
|
else:
|
|
564
|
+
# pySMT binds one type per symbol name, but SMT-LIB model values
|
|
565
|
+
# reuse the same @name across sorts, so we qualify it with the sort
|
|
566
|
+
if what.startswith('@'):
|
|
567
|
+
what += "_" + str(ty)
|
|
564
568
|
def handler():
|
|
565
569
|
return self.env.formula_manager.Symbol(what, ty)
|
|
566
570
|
stack[-1].append(handler)
|
|
@@ -232,6 +232,7 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
232
232
|
self.intType = self._msat_lib.msat_get_integer_type(self.msat_env())
|
|
233
233
|
self.boolType = self._msat_lib.msat_get_bool_type(self.msat_env())
|
|
234
234
|
self.mgr = environment.formula_manager
|
|
235
|
+
self._assumption_keys: Dict[FNode, FNode] = {}
|
|
235
236
|
|
|
236
237
|
@clear_pending_pop
|
|
237
238
|
def _reset_assertions(self):
|
|
@@ -269,7 +270,9 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
269
270
|
|
|
270
271
|
def _named_assertions_map(self):
|
|
271
272
|
if self.options.unsat_cores_mode == "named":
|
|
272
|
-
|
|
273
|
+
# not self.assertions: popping the assumptions level would
|
|
274
|
+
# invalidate the unsat core in MathSAT (dangling terms, segfault)
|
|
275
|
+
return dict((t[0], (t[1],t[2])) for t in self._assertion_stack)
|
|
273
276
|
return None
|
|
274
277
|
|
|
275
278
|
@clear_pending_pop
|
|
@@ -277,6 +280,8 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
277
280
|
res = None
|
|
278
281
|
bool_ass = []
|
|
279
282
|
other_ass = []
|
|
283
|
+
# maps the fresh literal standing for each non-literal assumption to it
|
|
284
|
+
self._assumption_keys = {}
|
|
280
285
|
for x in assumptions if assumptions is not None else []:
|
|
281
286
|
if x.is_literal():
|
|
282
287
|
bool_ass.append(self.converter.convert(x))
|
|
@@ -284,8 +289,14 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
284
289
|
other_ass.append(x)
|
|
285
290
|
if len(other_ass) > 0:
|
|
286
291
|
self.push()
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
for x in other_ass:
|
|
293
|
+
key = self.mgr.FreshSymbol(template="_assumption_%d")
|
|
294
|
+
self._assumption_keys[key] = x
|
|
295
|
+
term = self.converter.convert(self.mgr.Implies(key, x))
|
|
296
|
+
if self._msat_lib.msat_assert_formula(self.msat_env(), term) != 0:
|
|
297
|
+
raise InternalSolverError(
|
|
298
|
+
self._msat_lib.msat_last_error_message(self.msat_env()))
|
|
299
|
+
bool_ass.append(self.converter.convert(key))
|
|
289
300
|
|
|
290
301
|
n_ass = self._named_assertions()
|
|
291
302
|
if n_ass is not None and len(n_ass) > 0:
|
|
@@ -319,6 +330,9 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
319
330
|
raise InternalSolverError(
|
|
320
331
|
self._msat_lib.msat_last_error_message(self.msat_env()))
|
|
321
332
|
res = set(self.converter.back(t) for t in terms)
|
|
333
|
+
# drop the Implies(key, x) encoding of non-literal assumptions
|
|
334
|
+
res = set(f for f in res
|
|
335
|
+
if not f.get_free_variables() & self._assumption_keys.keys())
|
|
322
336
|
return res | self._unsat_assumptions()
|
|
323
337
|
else:
|
|
324
338
|
return set(self.get_named_unsat_core().values()) | \
|
|
@@ -334,7 +348,7 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
|
|
|
334
348
|
if n_ass_map is not None:
|
|
335
349
|
# in named mode the named assertions are passed as assumptions too
|
|
336
350
|
res -= set(n_ass_map)
|
|
337
|
-
return res
|
|
351
|
+
return set(self._assumption_keys.get(f, f) for f in res)
|
|
338
352
|
|
|
339
353
|
def get_named_unsat_core(self):
|
|
340
354
|
"""After a call to solve() yielding UNSAT, returns the unsat core as a
|
|
@@ -177,6 +177,7 @@ class Z3Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolver):
|
|
|
177
177
|
self.mgr = environment.formula_manager
|
|
178
178
|
|
|
179
179
|
self._name_cnt = 0
|
|
180
|
+
self._assumption_keys: Dict[FNode, FNode] = {}
|
|
180
181
|
return
|
|
181
182
|
|
|
182
183
|
@clear_pending_pop
|
|
@@ -218,9 +219,15 @@ class Z3Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolver):
|
|
|
218
219
|
else:
|
|
219
220
|
other_ass.append(x)
|
|
220
221
|
|
|
222
|
+
# maps the fresh literal standing for each non-literal assumption to it
|
|
223
|
+
self._assumption_keys = {}
|
|
221
224
|
if len(other_ass) > 0:
|
|
222
225
|
self.push()
|
|
223
|
-
|
|
226
|
+
for x in other_ass:
|
|
227
|
+
key = self.mgr.FreshSymbol(template="_assumption_%d")
|
|
228
|
+
self._assumption_keys[key] = x
|
|
229
|
+
self.z3.add(self.converter.convert(self.mgr.Implies(key, x)))
|
|
230
|
+
bool_ass.append(self.converter.convert(key))
|
|
224
231
|
self.pending_pop = True
|
|
225
232
|
res = self.z3.check(*bool_ass)
|
|
226
233
|
else:
|
|
@@ -240,7 +247,8 @@ class Z3Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolver):
|
|
|
240
247
|
|
|
241
248
|
def _named_assertions_map(self):
|
|
242
249
|
if self.options.unsat_cores_mode is not None:
|
|
243
|
-
|
|
250
|
+
# not self.assertions: that would pop the assumptions level
|
|
251
|
+
return dict((t[0], (t[1],t[2])) for t in self._assertion_stack)
|
|
244
252
|
return None
|
|
245
253
|
|
|
246
254
|
def get_named_unsat_core(self):
|
|
@@ -279,7 +287,7 @@ class Z3Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolver):
|
|
|
279
287
|
cnt += 1
|
|
280
288
|
res[name] = formula
|
|
281
289
|
else:
|
|
282
|
-
core_assumptions.add(key)
|
|
290
|
+
core_assumptions.add(self._assumption_keys.get(key, key))
|
|
283
291
|
return res, core_assumptions
|
|
284
292
|
|
|
285
293
|
@clear_pending_pop
|
|
@@ -97,6 +97,29 @@ class TestModelValidation(TestCase):
|
|
|
97
97
|
simp = simplifier.simplify(formula.substitute(model, interpretations))
|
|
98
98
|
self.assertEqual(simp, self.fm.TRUE())
|
|
99
99
|
|
|
100
|
+
def test_same_value_name_different_sorts(self):
|
|
101
|
+
# SMT-COMP/postprocessors#10: solvers reuse @0 across sorts
|
|
102
|
+
model_source ="""\
|
|
103
|
+
(model
|
|
104
|
+
(define-fun a () U (as @0 U))
|
|
105
|
+
(define-fun c () U (as @1 U))
|
|
106
|
+
(define-fun b () V (as @0 V))
|
|
107
|
+
(define-fun d () V (as @0 V))
|
|
108
|
+
)
|
|
109
|
+
"""
|
|
110
|
+
U = self.tm.Type('U', 0)
|
|
111
|
+
V = self.tm.Type('V', 0)
|
|
112
|
+
a = self.fm.Symbol('a', U)
|
|
113
|
+
b = self.fm.Symbol('b', V)
|
|
114
|
+
c = self.fm.Symbol('c', U)
|
|
115
|
+
d = self.fm.Symbol('d', V)
|
|
116
|
+
formula = self.fm.And(self.fm.Not(self.fm.Equals(a, c)),
|
|
117
|
+
self.fm.Equals(b, d))
|
|
118
|
+
|
|
119
|
+
model, interpretations = SmtLibParser().parse_model(StringIO(model_source))
|
|
120
|
+
simp = SmtLibModelValidationSimplifier(self.env).simplify(
|
|
121
|
+
formula.substitute(model, interpretations))
|
|
122
|
+
self.assertEqual(simp, self.fm.TRUE())
|
|
100
123
|
|
|
101
124
|
|
|
102
125
|
if __name__ == '__main__':
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
from pysmt.test import (TestCase, skipIfSolverNotAvailable,
|
|
19
19
|
skipIfNoUnsatCoreSolverForLogic, main)
|
|
20
20
|
from pysmt.shortcuts import (get_unsat_core, And, Or, Not, Symbol, UnsatCoreSolver,
|
|
21
|
-
Solver, is_unsat, Int, GT, get_env)
|
|
21
|
+
Solver, is_unsat, Int, GT, GE, LE, get_env)
|
|
22
22
|
from pysmt.typing import INT
|
|
23
23
|
from pysmt.logics import QF_BOOL, QF_BV, QF_LIA
|
|
24
24
|
from pysmt.exceptions import (SolverStatusError, SolverReturnedUnknownResultError,
|
|
@@ -214,6 +214,25 @@ class TestUnsatCores(TestCase):
|
|
|
214
214
|
{"n1": Or(x, y)}, name)
|
|
215
215
|
|
|
216
216
|
|
|
217
|
+
@skipIfNoUnsatCoreSolverForLogic(QF_LIA)
|
|
218
|
+
def test_non_literal_assumptions_in_unsat_core(self):
|
|
219
|
+
a = Symbol("a", INT)
|
|
220
|
+
pos, neg = GE(a, Int(1)), LE(a, Int(0))
|
|
221
|
+
for name in get_env().factory.all_unsat_core_solvers(logic=QF_LIA):
|
|
222
|
+
for mode in ["all", "named"]:
|
|
223
|
+
with UnsatCoreSolver(name=name, logic=QF_LIA,
|
|
224
|
+
unsat_cores_mode=mode) as s:
|
|
225
|
+
s.add_assertion(pos, named="pos")
|
|
226
|
+
self.assertFalse(s.solve([neg]))
|
|
227
|
+
# twice: reading the core must not pop the assumptions level
|
|
228
|
+
for _ in range(2):
|
|
229
|
+
self.assertEqual(s.get_unsat_core(), {pos, neg},
|
|
230
|
+
(name, mode))
|
|
231
|
+
if mode == "named":
|
|
232
|
+
self.assertEqual(s.get_named_unsat_core(),
|
|
233
|
+
{"pos": pos}, (name, mode))
|
|
234
|
+
|
|
235
|
+
|
|
217
236
|
@skipIfNoUnsatCoreSolverForLogic(QF_BOOL)
|
|
218
237
|
def test_assumptions_as_iterator(self):
|
|
219
238
|
x, y = Symbol("x"), Symbol("y")
|
|
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
|