PySMT 0.9.7.dev397__tar.gz → 0.9.7.dev408__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.dev397/PySMT.egg-info → pysmt-0.9.7.dev408}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408/PySMT.egg-info}/PKG-INFO +1 -1
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/__init__.py +1 -1
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/parser/parser.py +31 -7
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/script.py +7 -1
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_omt.py +133 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/LICENSE +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/MANIFEST.in +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/NOTICE +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/PySMT.egg-info/SOURCES.txt +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/PySMT.egg-info/dependency_links.txt +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/PySMT.egg-info/entry_points.txt +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/PySMT.egg-info/top_level.txt +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/README.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/CHANGES.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/api_ref.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/development.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/getting_started.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/index.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/tutorials/boolean_logic.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/docs/tutorials.rst +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/__main__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/check_version.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/install.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/base.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/bdd.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/btor.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/msat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/optimsat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/pico.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/yices.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/installers/z3.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/cmd/shell.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/configuration.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/constants.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/decorators.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/environment.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/exceptions.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/factory.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/fnode.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/formula.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/logics.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/operators.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/goal.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/msat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/optimizer.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/optimsat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/yices.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/optimization/z3.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/oracles.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/parsing.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/printers.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/rewritings.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/shortcuts.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/simplifier.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/annotations.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/commands.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/parser/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/printers.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/solver.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/smtlib/utils.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/bdd.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/btor.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/cvcfive.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/cvcfour.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/dynmsat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/eager.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/interpolation.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/msat.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/options.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/pico.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/portfolio.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/qelim.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/smtlib.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/solver.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/yices.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/solvers/z3.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/substituter.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/configs/config1.ini +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/configs/config_bad.ini +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/examples.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/omt_examples.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/optimization_utils.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/parser_utils.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_annotations.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_fuzzed.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_generic_wrapper.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_griggio.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_model_validation.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_omt_lib_solver.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_examples.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_extensibility.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_lra.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_arrays.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_lia.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_lira.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_lra.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_nia.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_nra.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_uf.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_qf_ufbv.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_parser_type_error.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/smtlib/test_smtlibscript.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_array.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_back.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_bdd.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_bv.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_bv_simplification.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_cnf.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_configuration.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_constants.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_cvc_quantifiers.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_dwf.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_eager_model.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_env.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_euf.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_formula.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_hr_parsing.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_imports.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_int.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_interpolation.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_lira.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_logics.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_models.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_native_qe.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_nia.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_nlira.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_optimization.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_optimizing.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_oracles.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_portfolio.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_printing.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_qe.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_regressions.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_rewritings.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_shannon_expansion.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_simplify.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_size.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_solving.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_sorts.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_string.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_typechecker.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_unsat_cores.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_walker_ext.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/test/test_walkers.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/type_checker.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/typing.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/utils.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/walkers/__init__.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/walkers/dag.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/walkers/generic.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/walkers/identitydag.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/pysmt/walkers/tree.py +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/setup.cfg +0 -0
- {pysmt-0.9.7.dev397 → pysmt-0.9.7.dev408}/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", 408)
|
|
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
|
|
@@ -1312,15 +1312,39 @@ class SmtLibParser(object):
|
|
|
1312
1312
|
|
|
1313
1313
|
def _cmd_minmax_maxmin_obj(self, current: str, tokens: Tokenizer) -> SmtLibCommand:
|
|
1314
1314
|
"""(minmax | maxmin <term>+ )"""
|
|
1315
|
-
|
|
1316
|
-
|
|
1315
|
+
params: List[Tuple[str, Union[str, bool]]] = []
|
|
1316
|
+
terms = []
|
|
1317
|
+
signed = False
|
|
1318
|
+
options = False
|
|
1319
|
+
|
|
1317
1320
|
while True:
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
params.append(c)
|
|
1321
|
-
except PysmtSyntaxError:
|
|
1321
|
+
token = tokens.consume()
|
|
1322
|
+
if token == ")":
|
|
1322
1323
|
break
|
|
1323
|
-
|
|
1324
|
+
if token.startswith(":"):
|
|
1325
|
+
options = True
|
|
1326
|
+
if token == ":id":
|
|
1327
|
+
identifier = self.parse_atom(tokens, "maxmin/minmax")
|
|
1328
|
+
params.append((token, identifier))
|
|
1329
|
+
elif token == ":signed":
|
|
1330
|
+
signed = True
|
|
1331
|
+
params.append((token, signed))
|
|
1332
|
+
else:
|
|
1333
|
+
raise PysmtSyntaxError(
|
|
1334
|
+
"Incorrect option in the '%s' command" % token,
|
|
1335
|
+
tokens.pos_info)
|
|
1336
|
+
else:
|
|
1337
|
+
if options:
|
|
1338
|
+
raise PysmtSyntaxError(
|
|
1339
|
+
"Unexpected token '%s' after options in the '%s' command" % (token, current),
|
|
1340
|
+
tokens.pos_info)
|
|
1341
|
+
tokens.add_extra_token(token)
|
|
1342
|
+
terms.append(self.get_expression(tokens))
|
|
1343
|
+
|
|
1344
|
+
if not any(option[0] == ":signed" for option in params):
|
|
1345
|
+
params.append((":signed", False))
|
|
1346
|
+
|
|
1347
|
+
return SmtLibCommand(current, [terms, params])
|
|
1324
1348
|
|
|
1325
1349
|
def _cmd_objective(self, current: str, tokens: Tokenizer) -> SmtLibCommand:
|
|
1326
1350
|
"""(maximize | minimize <term>"""
|
|
@@ -122,9 +122,15 @@ class SmtLibCommand(namedtuple('SmtLibCommand', ['name', 'args'])):
|
|
|
122
122
|
|
|
123
123
|
elif self.name in [smtcmd.MINMAX, smtcmd.MAXMIN]:
|
|
124
124
|
outstream.write("(%s" % self.name)
|
|
125
|
-
for a in self.args:
|
|
125
|
+
for a in self.args[0]:
|
|
126
126
|
outstream.write(" ")
|
|
127
127
|
printer.printer(a)
|
|
128
|
+
for option_name, value in self.args[1] or []:
|
|
129
|
+
if option_name == ":signed":
|
|
130
|
+
if value:
|
|
131
|
+
outstream.write(" %s" % option_name)
|
|
132
|
+
else:
|
|
133
|
+
outstream.write(" %s %s" % (option_name, value))
|
|
128
134
|
outstream.write(")")
|
|
129
135
|
|
|
130
136
|
elif self.name == smtcmd.CHECK_ALLSAT:
|
|
@@ -63,6 +63,139 @@ class TestSmtLibParserOMT(TestCase):
|
|
|
63
63
|
self.assertEqual(cmd.name, command)
|
|
64
64
|
self.assertEqual(len(cmd.args), len_args)
|
|
65
65
|
|
|
66
|
+
def test_parse_minmax_maxmin_with_options(self):
|
|
67
|
+
parser = SmtLibParser()
|
|
68
|
+
|
|
69
|
+
script = parser.get_script(StringIO(
|
|
70
|
+
"(declare-fun x () Real)\n"
|
|
71
|
+
"(declare-fun y () Real)\n"
|
|
72
|
+
"(minmax x y :id g1 :signed)\n"
|
|
73
|
+
))
|
|
74
|
+
cmd = script.commands[-1]
|
|
75
|
+
self.assertEqual(cmd.name, "minmax")
|
|
76
|
+
self.assertEqual(cmd.args[1], [(':id', 'g1'), (':signed', True)])
|
|
77
|
+
|
|
78
|
+
buf = StringIO()
|
|
79
|
+
script.serialize(buf)
|
|
80
|
+
self.assertIn("(minmax x y :id g1 :signed)", buf.getvalue())
|
|
81
|
+
|
|
82
|
+
script = parser.get_script(StringIO(
|
|
83
|
+
"(declare-fun x () Real)\n"
|
|
84
|
+
"(declare-fun y () Real)\n"
|
|
85
|
+
"(maxmin x y :id g2)\n"
|
|
86
|
+
))
|
|
87
|
+
cmd = script.commands[-1]
|
|
88
|
+
self.assertEqual(cmd.name, "maxmin")
|
|
89
|
+
self.assertEqual(cmd.args[1], [(':id', 'g2'), (':signed', False)])
|
|
90
|
+
|
|
91
|
+
def test_parse_minmax_maxmin_signed_only(self):
|
|
92
|
+
parser = SmtLibParser()
|
|
93
|
+
|
|
94
|
+
script = parser.get_script(StringIO(
|
|
95
|
+
"(declare-fun x () Real)\n"
|
|
96
|
+
"(declare-fun y () Real)\n"
|
|
97
|
+
"(maxmin x y :signed)\n"
|
|
98
|
+
))
|
|
99
|
+
cmd = script.commands[-1]
|
|
100
|
+
self.assertEqual(cmd.name, "maxmin")
|
|
101
|
+
self.assertEqual(cmd.args[1], [(':signed', True)])
|
|
102
|
+
|
|
103
|
+
buf = StringIO()
|
|
104
|
+
script.serialize(buf)
|
|
105
|
+
self.assertIn("(maxmin x y :signed)", buf.getvalue())
|
|
106
|
+
|
|
107
|
+
def test_parse_minmax_maxmin_invalid_option(self):
|
|
108
|
+
parser = SmtLibParser()
|
|
109
|
+
with self.assertRaises(PysmtSyntaxError):
|
|
110
|
+
parser.get_script(StringIO(
|
|
111
|
+
"(declare-fun x () Real)\n"
|
|
112
|
+
"(declare-fun y () Real)\n"
|
|
113
|
+
"(minmax x y :foo 1)\n"
|
|
114
|
+
))
|
|
115
|
+
|
|
116
|
+
def test_parse_minmax_multiple_terms_with_options(self):
|
|
117
|
+
parser = SmtLibParser()
|
|
118
|
+
|
|
119
|
+
script = parser.get_script(StringIO(
|
|
120
|
+
"(declare-fun x () Real)\n"
|
|
121
|
+
"(declare-fun y () Real)\n"
|
|
122
|
+
"(declare-fun z () Real)\n"
|
|
123
|
+
"(minmax x y z :id g1 :signed)\n"
|
|
124
|
+
))
|
|
125
|
+
cmd = script.commands[-1]
|
|
126
|
+
self.assertEqual(cmd.name, "minmax")
|
|
127
|
+
self.assertEqual([term.symbol_name() for term in cmd.args[0]], ['x', 'y', 'z'])
|
|
128
|
+
self.assertEqual(cmd.args[1], [(':id', 'g1'), (':signed', True)])
|
|
129
|
+
|
|
130
|
+
buf = StringIO()
|
|
131
|
+
script.serialize(buf)
|
|
132
|
+
self.assertIn("(minmax x y z :id g1 :signed)", buf.getvalue())
|
|
133
|
+
|
|
134
|
+
def test_parse_minmax_option_order(self):
|
|
135
|
+
parser = SmtLibParser()
|
|
136
|
+
|
|
137
|
+
script = parser.get_script(StringIO(
|
|
138
|
+
"(declare-fun x () Real)\n"
|
|
139
|
+
"(declare-fun y () Real)\n"
|
|
140
|
+
"(maxmin x y :signed :id g2)\n"
|
|
141
|
+
))
|
|
142
|
+
cmd = script.commands[-1]
|
|
143
|
+
self.assertEqual(cmd.name, "maxmin")
|
|
144
|
+
self.assertEqual(cmd.args[1], [(':signed', True), (':id', 'g2')])
|
|
145
|
+
|
|
146
|
+
buf = StringIO()
|
|
147
|
+
script.serialize(buf)
|
|
148
|
+
self.assertIn("(maxmin x y :signed :id g2)", buf.getvalue())
|
|
149
|
+
|
|
150
|
+
def test_parse_minmax_reverse_option_order(self):
|
|
151
|
+
parser = SmtLibParser()
|
|
152
|
+
|
|
153
|
+
script = parser.get_script(StringIO(
|
|
154
|
+
"(declare-fun x () Real)\n"
|
|
155
|
+
"(declare-fun y () Real)\n"
|
|
156
|
+
"(minmax x y :signed :id g1)\n"
|
|
157
|
+
))
|
|
158
|
+
cmd = script.commands[-1]
|
|
159
|
+
self.assertEqual(cmd.name, "minmax")
|
|
160
|
+
self.assertEqual(cmd.args[1], [(':signed', True), (':id', 'g1')])
|
|
161
|
+
|
|
162
|
+
buf = StringIO()
|
|
163
|
+
script.serialize(buf)
|
|
164
|
+
self.assertIn("(minmax x y :signed :id g1)", buf.getvalue())
|
|
165
|
+
|
|
166
|
+
def test_parse_minmax_maxmin_syntax_errors(self):
|
|
167
|
+
parser = SmtLibParser()
|
|
168
|
+
with self.assertRaises(PysmtSyntaxError):
|
|
169
|
+
parser.get_script(StringIO(
|
|
170
|
+
"(declare-fun x () Real)\n"
|
|
171
|
+
"(declare-fun y () Real)\n"
|
|
172
|
+
"(minmax x y :id)\n"
|
|
173
|
+
))
|
|
174
|
+
with self.assertRaises(PysmtSyntaxError):
|
|
175
|
+
parser.get_script(StringIO(
|
|
176
|
+
"(declare-fun x () Real)\n"
|
|
177
|
+
"(declare-fun y () Real)\n"
|
|
178
|
+
"(maxmin x y :signed true)\n"
|
|
179
|
+
))
|
|
180
|
+
|
|
181
|
+
def test_parse_minmax_maxmin_round_trip(self):
|
|
182
|
+
parser = SmtLibParser()
|
|
183
|
+
txt = """(declare-fun x () Real)
|
|
184
|
+
(declare-fun y () Real)
|
|
185
|
+
(minmax x y :id g1 :signed)
|
|
186
|
+
(maxmin x y :signed :id g2)
|
|
187
|
+
"""
|
|
188
|
+
script = parser.get_script(StringIO(txt))
|
|
189
|
+
|
|
190
|
+
buf = StringIO()
|
|
191
|
+
script.serialize(buf)
|
|
192
|
+
new_script = parser.get_script(StringIO(buf.getvalue()))
|
|
193
|
+
|
|
194
|
+
self.assertEqual(script.commands[-2].name, new_script.commands[-2].name)
|
|
195
|
+
self.assertEqual(script.commands[-2].args[1], new_script.commands[-2].args[1])
|
|
196
|
+
self.assertEqual(script.commands[-1].name, new_script.commands[-1].name)
|
|
197
|
+
self.assertEqual(script.commands[-1].args[1], new_script.commands[-1].args[1])
|
|
198
|
+
|
|
66
199
|
def parse_from_file(self, file_id: int) -> SmtLibScript:
|
|
67
200
|
fname = OMT_FILE_PATTERN % file_id
|
|
68
201
|
reset_env()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|