PySMT 0.9.7.dev441__tar.gz → 0.9.7.dev444__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.dev441/PySMT.egg-info → pysmt-0.9.7.dev444}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444/PySMT.egg-info}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/__init__.py +1 -1
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/cvcfour.py +34 -7
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_array.py +21 -2
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_solving.py +16 -1
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/LICENSE +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/MANIFEST.in +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/NOTICE +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/PySMT.egg-info/SOURCES.txt +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/PySMT.egg-info/dependency_links.txt +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/PySMT.egg-info/entry_points.txt +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/PySMT.egg-info/top_level.txt +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/README.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/CHANGES.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/api_ref.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/development.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/getting_started.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/index.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/tutorials/boolean_logic.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/docs/tutorials.rst +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/__main__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/check_version.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/install.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/base.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/bdd.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/btor.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/msat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/optimsat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/pico.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/yices.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/installers/z3.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/cmd/shell.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/configuration.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/constants.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/decorators.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/environment.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/exceptions.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/factory.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/fnode.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/formula.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/logics.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/operators.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/goal.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/msat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/optimizer.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/optimsat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/yices.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/optimization/z3.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/oracles.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/parsing.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/printers.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/rewritings.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/shortcuts.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/simplifier.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/annotations.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/commands.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/parser/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/parser/parser.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/printers.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/script.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/solver.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/smtlib/utils.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/bdd.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/btor.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/dynmsat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/eager.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/interpolation.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/msat.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/options.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/pico.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/portfolio.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/qelim.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/smtlib.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/solver.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/yices.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/solvers/z3.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/substituter.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/configs/config1.ini +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/configs/config_bad.ini +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/examples.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/omt_examples.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/optimization_utils.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/parser_utils.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_annotations.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_fuzzed.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_generic_wrapper.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_griggio.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_model_validation.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_omt_lib_solver.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_examples.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_extensibility.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_lra.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_omt.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_arrays.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_lia.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_lira.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_lra.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_nia.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_nra.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_uf.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_qf_ufbv.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_parser_type_error.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/smtlib/test_smtlibscript.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_back.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_bdd.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_bv.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_bv_simplification.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_cnf.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_configuration.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_constants.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_cvc_quantifiers.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_dwf.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_eager_model.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_env.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_euf.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_formula.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_hr_parsing.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_imports.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_int.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_interpolation.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_lira.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_logics.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_models.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_native_qe.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_nia.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_nlira.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_optimization.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_optimizing.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_oracles.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_portfolio.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_printing.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_qe.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_regressions.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_rewritings.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_shannon_expansion.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_simplify.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_size.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_sorts.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_string.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_typechecker.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_unsat_cores.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_walker_ext.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/test/test_walkers.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/type_checker.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/typing.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/utils.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/walkers/__init__.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/walkers/dag.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/walkers/generic.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/walkers/identitydag.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/pysmt/walkers/tree.py +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/setup.cfg +0 -0
- {pysmt-0.9.7.dev441 → pysmt-0.9.7.dev444}/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", 444)
|
|
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
|
|
@@ -25,7 +25,7 @@ except ImportError:
|
|
|
25
25
|
raise SolverAPINotFound
|
|
26
26
|
|
|
27
27
|
import pysmt.typing as types
|
|
28
|
-
from pysmt.logics import PYSMT_LOGICS
|
|
28
|
+
from pysmt.logics import PYSMT_LOGICS
|
|
29
29
|
|
|
30
30
|
from pysmt.solvers.solver import Solver, Converter, SolverOptions
|
|
31
31
|
from pysmt.exceptions import (SolverReturnedUnknownResultError,
|
|
@@ -77,7 +77,6 @@ class CVC4Options(SolverOptions):
|
|
|
77
77
|
class CVC4Solver(SmtLibBasicSolver):
|
|
78
78
|
|
|
79
79
|
LOGICS = PYSMT_LOGICS -\
|
|
80
|
-
ARRAYS_CONST_LOGICS -\
|
|
81
80
|
set(l for l in PYSMT_LOGICS if not l.theory.linear)
|
|
82
81
|
|
|
83
82
|
OptionsClass = CVC4Options
|
|
@@ -92,6 +91,9 @@ class CVC4Solver(SmtLibBasicSolver):
|
|
|
92
91
|
self.cvc4 = None
|
|
93
92
|
self.declarations = None
|
|
94
93
|
self.logic_name = str(logic)
|
|
94
|
+
if self.logic_name.endswith("*"):
|
|
95
|
+
# Const-array extension (pySMT-internal suffix)
|
|
96
|
+
self.logic_name = self.logic_name[:-1]
|
|
95
97
|
if "t" in self.logic_name:
|
|
96
98
|
# Custom Type extension
|
|
97
99
|
self.logic_name = self.logic_name.replace("t","")
|
|
@@ -247,11 +249,7 @@ class CVC4Converter(Converter, DagWalker):
|
|
|
247
249
|
v = expr.getConstString()
|
|
248
250
|
res = self.mgr.String(v.toString())
|
|
249
251
|
elif expr.getType().isArray():
|
|
250
|
-
|
|
251
|
-
array_type = self._cvc4_type_to_type(const_.getType())
|
|
252
|
-
base_value = self.back(const_.getExpr())
|
|
253
|
-
res = self.mgr.Array(array_type.index_type,
|
|
254
|
-
base_value)
|
|
252
|
+
res = self._back_array(expr)
|
|
255
253
|
else:
|
|
256
254
|
raise PysmtTypeError("Unsupported constant type:",
|
|
257
255
|
expr.getType().toString())
|
|
@@ -260,6 +258,26 @@ class CVC4Converter(Converter, DagWalker):
|
|
|
260
258
|
|
|
261
259
|
return res
|
|
262
260
|
|
|
261
|
+
def _back_array(self, expr):
|
|
262
|
+
"""Converts a CVC4 array value into a pySMT Array.
|
|
263
|
+
|
|
264
|
+
CVC4 represents an array value as a (possibly empty) sequence of
|
|
265
|
+
STOREs on top of a STORE_ALL node, which holds the default value.
|
|
266
|
+
"""
|
|
267
|
+
assert expr.getType().isArray(), "Expecting a CVC4 array"
|
|
268
|
+
stores = []
|
|
269
|
+
while expr.getNumChildren() == 3:
|
|
270
|
+
# STORE(array, index, value)
|
|
271
|
+
array, index, value = expr.getChildren()
|
|
272
|
+
stores.append((self.back(index), self.back(value)))
|
|
273
|
+
expr = array
|
|
274
|
+
const_ = expr.getConstArrayStoreAll()
|
|
275
|
+
array_type = self._cvc4_type_to_type(const_.getType())
|
|
276
|
+
res = self.mgr.Array(array_type.index_type, self.back(const_.getExpr()))
|
|
277
|
+
for index, value in reversed(stores):
|
|
278
|
+
res = self.mgr.Store(res, index, value)
|
|
279
|
+
return res
|
|
280
|
+
|
|
263
281
|
@catch_conversion_error
|
|
264
282
|
def convert(self, formula):
|
|
265
283
|
return self.walk(formula)
|
|
@@ -334,6 +352,15 @@ class CVC4Converter(Converter, DagWalker):
|
|
|
334
352
|
def walk_array_select(self, formula, args, **kwargs):
|
|
335
353
|
return self.mkExpr(CVC4.SELECT, args[0], args[1])
|
|
336
354
|
|
|
355
|
+
def walk_array_value(self, formula, args, **kwargs):
|
|
356
|
+
arr_type = self.env.stc.get_type(formula)
|
|
357
|
+
rval = self.mkConst(CVC4.ArrayStoreAll(self._type_to_cvc4(arr_type),
|
|
358
|
+
args[0]))
|
|
359
|
+
# The remaining args are (index, value) pairs
|
|
360
|
+
for i in range(1, len(args), 2):
|
|
361
|
+
rval = self.mkExpr(CVC4.STORE, rval, args[i], args[i+1])
|
|
362
|
+
return rval
|
|
363
|
+
|
|
337
364
|
def walk_minus(self, formula, args, **kwargs):
|
|
338
365
|
return self.mkExpr(CVC4.MINUS, args[0], args[1])
|
|
339
366
|
|
|
@@ -18,14 +18,17 @@
|
|
|
18
18
|
|
|
19
19
|
from pysmt.test import TestCase, main
|
|
20
20
|
from pysmt.test import skipIfNoSolverForLogic, skipIfSolverNotAvailable
|
|
21
|
-
from pysmt.logics import QF_AUFLIA, QF_AUFBV
|
|
21
|
+
from pysmt.logics import QF_AUFLIA, QF_AUFBV, get_logic_by_name
|
|
22
22
|
from pysmt.typing import ARRAY_INT_INT, ArrayType, INT, REAL, BV8, BOOL
|
|
23
|
-
from pysmt.shortcuts import (Solver,
|
|
23
|
+
from pysmt.shortcuts import (Solver, get_env, simplify,
|
|
24
24
|
Symbol, Not, Equals, Int, BV, Real, FreshSymbol,
|
|
25
25
|
Select, Store, Array, TRUE)
|
|
26
26
|
from pysmt.exceptions import ConvertExpressionError, PysmtTypeError, PysmtValueError
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
QF_ALIA_CONST = get_logic_by_name("QF_ALIA*")
|
|
30
|
+
|
|
31
|
+
|
|
29
32
|
class TestArray(TestCase):
|
|
30
33
|
|
|
31
34
|
def test_array_type(self):
|
|
@@ -92,6 +95,22 @@ class TestArray(TestCase):
|
|
|
92
95
|
formula = Equals(Array(BV8, TRUE()), FreshSymbol(ArrayType(BV8, BOOL)))
|
|
93
96
|
self.assertSat(formula, logic=QF_AUFBV, solver_name="btor")
|
|
94
97
|
|
|
98
|
+
@skipIfNoSolverForLogic(QF_ALIA_CONST)
|
|
99
|
+
def test_const_array_model(self):
|
|
100
|
+
"""Constant arrays round-trip through every solver supporting them."""
|
|
101
|
+
a = Symbol("a", ARRAY_INT_INT)
|
|
102
|
+
value = Store(Store(Array(INT, Int(0)), Int(1), Int(5)), Int(2), Int(7))
|
|
103
|
+
formula = Equals(a, value)
|
|
104
|
+
for name in get_env().factory.all_solvers(logic=QF_ALIA_CONST):
|
|
105
|
+
with Solver(name=name, logic=QF_ALIA_CONST) as s:
|
|
106
|
+
s.add_assertion(formula)
|
|
107
|
+
self.assertTrue(s.solve(), name)
|
|
108
|
+
model = s.get_value(a)
|
|
109
|
+
for idx, expected in [(Int(1), Int(5)), (Int(2), Int(7)),
|
|
110
|
+
(Int(42), Int(0))]:
|
|
111
|
+
self.assertEqual(simplify(Select(model, idx)), expected,
|
|
112
|
+
(name, model))
|
|
113
|
+
|
|
95
114
|
def test_complex_types(self):
|
|
96
115
|
with self.assertRaises(PysmtTypeError):
|
|
97
116
|
# Not(Store(Array<Real,BV8>(8d_0), 1.0, 8d_5) =
|
|
@@ -209,7 +209,6 @@ class TestBasic(TestCase):
|
|
|
209
209
|
@skipIfSolverNotAvailable("cvc5")
|
|
210
210
|
def test_examples_cvc(self):
|
|
211
211
|
for (f, validity, satisfiability, logic) in get_example_formulae():
|
|
212
|
-
if logic.theory.arrays_const: continue
|
|
213
212
|
try:
|
|
214
213
|
v = is_valid(f, solver_name='cvc5', logic=logic)
|
|
215
214
|
s = is_sat(f, solver_name='cvc5', logic=logic)
|
|
@@ -222,6 +221,22 @@ class TestBasic(TestCase):
|
|
|
222
221
|
# Logic is not supported by CVC
|
|
223
222
|
pass
|
|
224
223
|
|
|
224
|
+
@skipIfSolverNotAvailable("cvc4")
|
|
225
|
+
def test_examples_cvc4(self):
|
|
226
|
+
for (f, validity, satisfiability, logic) in get_example_formulae():
|
|
227
|
+
if not logic.theory.linear: continue
|
|
228
|
+
try:
|
|
229
|
+
v = is_valid(f, solver_name='cvc4', logic=logic)
|
|
230
|
+
s = is_sat(f, solver_name='cvc4', logic=logic)
|
|
231
|
+
self.assertEqual(validity, v, f)
|
|
232
|
+
self.assertEqual(satisfiability, s, f)
|
|
233
|
+
except SolverReturnedUnknownResultError:
|
|
234
|
+
# CVC does not handle quantifiers in a complete way
|
|
235
|
+
self.assertFalse(logic.quantifier_free)
|
|
236
|
+
except NoSolverAvailableError:
|
|
237
|
+
# Logic is not supported by CVC
|
|
238
|
+
pass
|
|
239
|
+
|
|
225
240
|
@skipIfSolverNotAvailable("yices")
|
|
226
241
|
def test_examples_yices(self):
|
|
227
242
|
for (f, validity, satisfiability, logic) in get_example_formulae():
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|