PySMT 0.9.7.dev390__py2.py3-none-any.whl → 0.9.7.dev397__py2.py3-none-any.whl

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/__init__.py CHANGED
@@ -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", 390)
22
+ VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 397)
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
pysmt/cmd/install.py CHANGED
@@ -43,7 +43,7 @@ INSTALLERS = [
43
43
  {"pypicosat_minor_version" : "1708010052"}),
44
44
  Installer(CuddInstaller, "2.0.3",
45
45
  {"git_version" : "ecb03d6d231273343178f566cc4d7258dcce52b4"}),
46
- Installer(OptiMSatInstaller, "1.7.3", {})
46
+ Installer(OptiMSatInstaller, "1.7.5", {})
47
47
  ]
48
48
 
49
49
 
@@ -24,18 +24,26 @@ class OptiMSatInstaller(SolverInstaller):
24
24
 
25
25
  def __init__(self, install_dir, bindings_dir, solver_version,
26
26
  mirror_link=None):
27
+
27
28
  # Getting the right archive name
28
- os_name = self.os_name
29
- arch = str(self.bits) + "-bit"
30
- ext = "tar.gz"
31
- if os_name == "windows":
32
- ext = "zip"
33
- arch += "-mingw"
34
- elif os_name == "darwin":
35
- os_name = "macos"
36
-
37
- archive_name = "optimathsat-%s-%s-%s.%s" % (solver_version, os_name,
38
- arch, ext)
29
+ archive_name_template = "optimathsat-{version}-{os}-{arch}.{ext}"
30
+ format = {
31
+ "version": solver_version,
32
+ "os" : self.os_name,
33
+ "arch": self.architecture,
34
+ "ext": "tar.gz"
35
+ }
36
+ if self.os_name in ["windows", "darwin"]:
37
+ # Since version 1.7.5 the architecture is not included in the
38
+ # pkg name for the OSX and Win release as it is considered a "universal binary"
39
+ archive_name_template = "optimathsat-{version}-{os}.{ext}"
40
+ if self.os_name == "windows":
41
+ format["ext"] = "zip"
42
+ format["os"] = "win64" if self.architecture == "x86_64" else "win32"
43
+ elif self.os_name == "darwin":
44
+ format["os"] = "osx"
45
+
46
+ archive_name = archive_name_template.format(**format)
39
47
 
40
48
  native_link = "https://optimathsat.disi.unitn.it/releases/optimathsat-%s/{archive_name}" % solver_version
41
49
 
@@ -144,9 +144,18 @@ class OptiMSATSolver(MathSAT5Solver, Optimizer):
144
144
  }
145
145
 
146
146
  while self.solve():
147
- if all(self._check_unsat_unbound_infinitesimal(mo) for mo in msat_objs.values()):
148
- model = self.get_model()
149
- yield model, [model.get_value(goal.term()) for goal in goals]
147
+ all_ok = True
148
+ costs = []
149
+ model = None
150
+ for goal in goals:
151
+ result = self._get_goal_value(msat_objs[goal], goal)
152
+ if result is None:
153
+ all_ok = False
154
+ break
155
+ model, cost = result
156
+ costs.append(cost)
157
+ if all_ok and model is not None:
158
+ yield model, costs
150
159
  else:
151
160
  break
152
161
  # set after the solve because the solve method has the clear_pending_pop decorator
@@ -242,9 +242,8 @@ def check_pareto(optimizer: Optimizer, goals: Sequence[Goal], goals_values: Sequ
242
242
  raised_class = _get_expected_raised_class(goals_values[0])
243
243
  assert raised_class is None or len(goals_values) == 1, "test: %s, goals_values: %s" % (test_id_str, str(goals_values))
244
244
  if raised_class is None:
245
- iterator_retval = optimizer.pareto_optimize(goals, **kwargs)
246
- assert iterator_retval is not None, test_id_str
247
- retval = list(iterator_retval)
245
+ retval = optimizer.pareto_optimize(goals, **kwargs)
246
+ assert retval is not None, test_id_str
248
247
 
249
248
  sorted_costs = sorted((costs for _, costs in retval), key=str)
250
249
  sorted_goals_values = sorted(goals_values, key=str)
@@ -257,7 +256,7 @@ def check_pareto(optimizer: Optimizer, goals: Sequence[Goal], goals_values: Sequ
257
256
  assert isinstance(goal_value, FNode)
258
257
  _check_oracle_goal(goal, goal_value, cost, test_id_str, **kwargs)
259
258
 
260
- return retval
259
+ return None
261
260
  elif not optimizer.can_diverge_for_unbounded_cases():
262
261
  with pytest.raises(raised_class):
263
262
  return list(optimizer.pareto_optimize(goals, **kwargs))
@@ -338,11 +338,8 @@ sat
338
338
  )
339
339
 
340
340
 
341
- test_to_skip = {
342
- ("QF_LRA - smtlib2_boxed.smt2", OptimizationTypes.LEXICOGRAPHIC, "optimsat"), # error return wrong maximization of z (should be 24, returns 0); seems like a bug in optimsat; have to try optimsat alone; with integers instead of reals it works
343
- ("QF_LIA - smtlib2_allsat.smt2", OptimizationTypes.PARETO, "optimsat"), # error that happens only if test_optimizing is done before this test
344
- ("QF_LIA - smtlib2_load_objective_model.smt2", OptimizationTypes.PARETO, "optimsat"), # error that happens only if test_optimizing is done before this test
345
- }
341
+ test_to_skip: dict = {}
342
+
346
343
  @pytest.mark.parametrize(
347
344
  "optimization_example, solver_name",
348
345
  generate_examples_with_solvers(omt_test_cases_from_smtlib_test_set()),
@@ -20,10 +20,7 @@ import pytest
20
20
  from pysmt.test.omt_examples import get_full_example_omt_formuale
21
21
  from pysmt.test.optimization_utils import generate_examples_with_solvers, solve_given_example, OptimizationTypes
22
22
 
23
- test_to_skip = {
24
- ("QF_LIA 2 int 2 bools multiple objective", OptimizationTypes.PARETO, "optimsat"), # weird error, this test fails only if executed test_omt_lib_solver (skipping ("QF_LIA - smtlib2_load_objective_model.smt2", OptimizationTypes.PARETO, "optimsat") this skip becomes necessary, otherwise not). The cost returned is 0 when it should be 1
25
- ("QF_LIA 2 variables multiple objective", OptimizationTypes.PARETO, "optimsat"), # weird error, this test fails only if executed after test_optimization, while it works on it's own
26
- }
23
+ test_to_skip: dict = {}
27
24
 
28
25
  @pytest.mark.parametrize(
29
26
  "optimization_example, solver_name",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySMT
3
- Version: 0.9.7.dev390
3
+ Version: 0.9.7.dev397
4
4
  Summary: A solver-agnostic library for SMT Formulae manipulation and solving
5
5
  Home-page: http://www.pysmt.org
6
6
  Author: PySMT Team
@@ -1,4 +1,4 @@
1
- pysmt/__init__.py,sha256=ZOa45GVVi-ZN7C5jsCYcoMFkenxL2Dd1SNBhqV9XH7E,1701
1
+ pysmt/__init__.py,sha256=ZgfSobTT7ZMC3GRVR4Lb68ibKWwJIMEG0t5vgn0efro,1701
2
2
  pysmt/__main__.py,sha256=rR-MV1QtLYqtVoJyY3m5B5Iz-lua0-5o6YSB0W4lKy8,1085
3
3
  pysmt/configuration.py,sha256=Iq_46QZ9z_jpBMk76euJWTqGEwHad2qyiEDPix5sXsA,4538
4
4
  pysmt/constants.py,sha256=pulb6NvROY_X8BePeyyX8T9MJLB79HZ_1FUYSlZ7Jfg,5769
@@ -22,7 +22,7 @@ pysmt/typing.py,sha256=aI8ZKEin4J2XLAHsY5fW1Pt4hZvlBlArxM4nrrmBas4,19550
22
22
  pysmt/utils.py,sha256=_dSgl45k-u9cMXSyR672GBJcKMKdtl6xSTjqXKTSfcs,2906
23
23
  pysmt/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  pysmt/cmd/check_version.py,sha256=DCS6pHVuQm9J_vfSSDDGxtvrV6P1mEhQK-IUjacDh3s,2895
25
- pysmt/cmd/install.py,sha256=DtxqsZRx_qcxLWYpCVfG-Alv774aQT0PbiXC0-aymOk,10468
25
+ pysmt/cmd/install.py,sha256=dz04Oi5S_SGVoxA_Ozzb0VEn4y8hYZ5-zkd3paYmnNQ,10468
26
26
  pysmt/cmd/shell.py,sha256=1H5NJ9St879-U3EDizq_5l34vKPUJr-wi3MyBy164Sc,6594
27
27
  pysmt/cmd/installers/__init__.py,sha256=fEAD4FUh0Hjv7u-o9dc5nYMjzPUAzR8bWo8DSgUQjq4,1438
28
28
  pysmt/cmd/installers/base.py,sha256=agHbXV4ILfW2my8bjFLoRPmK9Jq8fPz9aESPGbPLu-g,13201
@@ -31,7 +31,7 @@ pysmt/cmd/installers/btor.py,sha256=gUl_urKcWtbSYS_Vde_O7RJM0H-kRqh6hceTju-Sbcs,
31
31
  pysmt/cmd/installers/cvcfive.py,sha256=vWqAm5xF7IMY0JWEeyx3_ochCqyHx0dlcZBo9QcQ-uk,1460
32
32
  pysmt/cmd/installers/cvcfour.py,sha256=uBZkKIX4gZEMfjrhrparUSDydMcvGIGZM2Y8JYD0GzE,3916
33
33
  pysmt/cmd/installers/msat.py,sha256=PnHNSbMLB99SPCkv2cuK8LyWweJVa7cOOcGvsFTgzsU,5547
34
- pysmt/cmd/installers/optimsat.py,sha256=wktjIyM47noeT2A9yT1MnghDU4RiZVpVCYK3egWyLv4,3909
34
+ pysmt/cmd/installers/optimsat.py,sha256=E9W0mKtMdV_LsaywEM-baVzj_T70sNclqiFucqzWYCU,4359
35
35
  pysmt/cmd/installers/pico.py,sha256=U4sXr1oj4BJJpO5H7vB8WqJ6OEPazpYkmmXP1XWhvys,3027
36
36
  pysmt/cmd/installers/yices.py,sha256=M99P641jqGtAWOgQpAQzt4T1KwmSClw1VDEETzsSZe0,3010
37
37
  pysmt/cmd/installers/z3.py,sha256=5wP6O-a602-y1cuEyr22bkdWnOWHx8bIaPQ24xDtxX8,1386
@@ -39,7 +39,7 @@ pysmt/optimization/__init__.py,sha256=JXBHtcb4Lv-Sb8whc9JuGbRH2EBLWwtLUh3PL9HhNE
39
39
  pysmt/optimization/goal.py,sha256=OI4yQT2LRsYBujq4Hgl9SOVG9_S9bnPayWxh7Bg03cc,8661
40
40
  pysmt/optimization/msat.py,sha256=yj5-vqxQFJnK3zjVlYpxemZ2BWG-6IrCTDKvjl94xNY,937
41
41
  pysmt/optimization/optimizer.py,sha256=74bxQNXzzorIq39R1NxVwYoAwT-d5nX9-lHkOousJtA,29271
42
- pysmt/optimization/optimsat.py,sha256=ZOXkDCmlwUdUqHYuM8pEo8NkBJLKJYCuJgsKTfq7ttI,10831
42
+ pysmt/optimization/optimsat.py,sha256=hRqhPcssuUzXnTeEEv8taFcRI5nE7gU8drwDIC0NtFk,11040
43
43
  pysmt/optimization/yices.py,sha256=Ly48G5JpnOhJBkd25Vg21jGcCjLEeEQUrWsG2Xxl_KI,931
44
44
  pysmt/optimization/z3.py,sha256=qhSQ0wR487555yYW9vSvLaIMutKN05cczPPITK_O_u4,7270
45
45
  pysmt/smtlib/__init__.py,sha256=JXBHtcb4Lv-Sb8whc9JuGbRH2EBLWwtLUh3PL9HhNE8,650
@@ -71,7 +71,7 @@ pysmt/solvers/z3.py,sha256=b2y-Ai-rtoMqBTnVfbVdG5BrC_z3m1VY3KwSsQakR0Q,44094
71
71
  pysmt/test/__init__.py,sha256=LEFbVYw4X45sgEI4_ax55g-6G5Y7kj6CLaJr1TQr4ks,5750
72
72
  pysmt/test/examples.py,sha256=uMc4MzgFAPpu3eZF3ZdmHdyumt9SFWUy2GWTSzN8EN4,39703
73
73
  pysmt/test/omt_examples.py,sha256=LdL43fLaHiR72Cng_2st4UaYf2ueoZgStcvhccy-RdI,10338
74
- pysmt/test/optimization_utils.py,sha256=5uJD4lIIPCbKCbv4ZiEHcajSPy1fqDxNL_goZx44XL8,15724
74
+ pysmt/test/optimization_utils.py,sha256=zbj2bN-3uMaNexF7DSjuQAR0889IcMsCiE__tGtR6zM,15665
75
75
  pysmt/test/test_array.py,sha256=OypmqKf_ciigxK1X_W2b9sm0EWOA3wqH376QXt7oGCM,6237
76
76
  pysmt/test/test_back.py,sha256=3O7XTx4WfuizjT7-yueZq6oGG-uqovkie7R3A5GklTk,3372
77
77
  pysmt/test/test_bdd.py,sha256=CzOzP7CnTvhsg8KT5d8FPNSZ4uO9fI8deU1Xv8YUFIs,6194
@@ -97,7 +97,7 @@ pysmt/test/test_native_qe.py,sha256=RGZgwbpAkPBTjIqcCbOkZ_nQXIDZ4Fznrr7Ldx6oA38,
97
97
  pysmt/test/test_nia.py,sha256=x51d0X5jnZnxTPvPLrlD0WilunZ5uNrDU4vWY78_xpU,6640
98
98
  pysmt/test/test_nlira.py,sha256=_E1HeOarw4TN8AI1X7EQv-utjhwy8hJX3vx-05eHJk0,4969
99
99
  pysmt/test/test_optimization.py,sha256=xU0gJbD2SSn5_lA7wF7IKcR54KF6NU0g-2_dDEqXmqA,24358
100
- pysmt/test/test_optimizing.py,sha256=OetdtGabmFmXQxWzu3oqOWlokDw19GzxScbbxzeV0nI,2030
100
+ pysmt/test/test_optimizing.py,sha256=P-XnTPEPoEp5LvvZfZoiZziI4z3d_FfL7lFcEuI07bE,1512
101
101
  pysmt/test/test_oracles.py,sha256=cHBPTUoi9cPmIvR-DG4bbzohOaBdUJzpKLoQXImxS_c,5615
102
102
  pysmt/test/test_portfolio.py,sha256=k0Jdrdr-EX-BVCxqYNUS3YjC77aCpzzdhezjB8U3OCM,7125
103
103
  pysmt/test/test_printing.py,sha256=glsnaMRungLc31JIJTmHlT69JnTPsC5pnYn1rZriV2s,8765
@@ -123,7 +123,7 @@ pysmt/test/smtlib/test_fuzzed.py,sha256=pNKXmb57NO8hvBwo1yc1FbzATmgS0efaRTkEJs-j
123
123
  pysmt/test/smtlib/test_generic_wrapper.py,sha256=UOVNZ8dWqUJNfNkFsXp0fz4CNMFvyblfPpUy1m2NQTk,7913
124
124
  pysmt/test/smtlib/test_griggio.py,sha256=W8C5SWABwUeAQdnslQoU_6pxFokaz2cT5sAfJLo1cKw,2959
125
125
  pysmt/test/smtlib/test_model_validation.py,sha256=xHHBkbANSNnxuc8HFUVcEANde0zsZZdTWPtIWVazw7c,3076
126
- pysmt/test/smtlib/test_omt_lib_solver.py,sha256=8MzMvOmPYXXiA8wSJE4ZdqmTvAu4_K7HkcMHjvvbkNM,8735
126
+ pysmt/test/smtlib/test_omt_lib_solver.py,sha256=xZZWDSB0eDBsmzu7R8AqRN0fSCvFRW6x4Cq9MmTAfos,8177
127
127
  pysmt/test/smtlib/test_parser_examples.py,sha256=5e0pNN5rjgi5cLAJl4ZZuUiifCUgVaD__JfBlVJgMR4,10100
128
128
  pysmt/test/smtlib/test_parser_extensibility.py,sha256=MgEVUU-icDEryKh54sW9VC59e8CuC6Q_5Sw65FtxBgo,3933
129
129
  pysmt/test/smtlib/test_parser_lra.py,sha256=N6HD1BqSb88FpOeaHsKME5IOok3Eu3YdpM55XgDFs3s,997
@@ -143,10 +143,10 @@ pysmt/walkers/dag.py,sha256=4CWSgoXm6nONhM-1znKRU4SBCb791OTS-M9QlQFhbs8,5751
143
143
  pysmt/walkers/generic.py,sha256=dmp47kJGtO6rhC2t07Mf_FsYN-lcy64LX-dZggNnWm4,5179
144
144
  pysmt/walkers/identitydag.py,sha256=DBPaDuIgvZZz1ohKyoWcDeQVa3RgMQDnqn4Jo7gwtNs,10782
145
145
  pysmt/walkers/tree.py,sha256=8oyDSXZtUsCdExcrwG3hKuEgARHgdW6fvz0LZJwjp-k,2983
146
- pysmt-0.9.7.dev390.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
- pysmt-0.9.7.dev390.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
- pysmt-0.9.7.dev390.dist-info/METADATA,sha256=TbTUsCRt68UxHtVegE_0rRG9jCn1y5V4GFkHsgjZM7o,1774
149
- pysmt-0.9.7.dev390.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
150
- pysmt-0.9.7.dev390.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
- pysmt-0.9.7.dev390.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
- pysmt-0.9.7.dev390.dist-info/RECORD,,
146
+ pysmt-0.9.7.dev397.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
+ pysmt-0.9.7.dev397.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
+ pysmt-0.9.7.dev397.dist-info/METADATA,sha256=jaHNVKmsXdhyf2fFPVj6VS4G30dPmvCIV5wBEoIxqGU,1774
149
+ pysmt-0.9.7.dev397.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
150
+ pysmt-0.9.7.dev397.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
+ pysmt-0.9.7.dev397.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
+ pysmt-0.9.7.dev397.dist-info/RECORD,,