PySMT 0.9.7.dev446__py2.py3-none-any.whl → 0.9.7.dev452__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", 446)
22
+ VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 452)
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
@@ -232,7 +232,13 @@ def _run_solver(idx, solver, logic, options, formula, signaling_queue, ctrl_pipe
232
232
  """
233
233
  from pysmt.environment import get_env
234
234
 
235
- Solver = get_env().factory.Solver
235
+ env = get_env()
236
+ # The formula is pickled across the process boundary, so its FNodes
237
+ # belong to no FormulaManager here (this is always the case with the
238
+ # 'spawn'/'forkserver' start methods). Contextualize it in our own env.
239
+ formula = env.formula_manager.normalize(formula)
240
+
241
+ Solver = env.factory.Solver
236
242
  with Solver(name=solver, logic=logic, **options) as s:
237
243
  s.add_assertion(formula)
238
244
  try:
@@ -258,7 +264,7 @@ def _run_solver(idx, solver, logic, options, formula, signaling_queue, ctrl_pipe
258
264
  model = list(s.get_model())
259
265
  ctrl_pipe.send(model)
260
266
  elif cmd == "get_value":
261
- args = get_env().formula_manager.normalize(args)
267
+ args = env.formula_manager.normalize(args)
262
268
  ctrl_pipe.send(s.get_value(args))
263
269
  else:
264
270
  raise ValueError("Unknown command '%s'" % cmd)
@@ -25,11 +25,26 @@ from pysmt.solvers.portfolio import Portfolio
25
25
  from pysmt.smtlib.parser import get_formula_fname
26
26
  from pysmt.shortcuts import TRUE, Implies, Equals, Symbol, FALSE
27
27
  from pysmt.shortcuts import reset_env, is_sat
28
- from pysmt.typing import REAL
28
+ from pysmt.typing import REAL, BOOL
29
29
 
30
30
 
31
31
  class PortfolioTestCase(TestCase):
32
32
 
33
+ @skipIfSolverNotAvailable("z3")
34
+ def test_basic_z3(self):
35
+ mgr = self.env.formula_manager
36
+ x = mgr.Symbol('x', BOOL)
37
+ y = mgr.Symbol('y', BOOL)
38
+ formula = mgr.And(x, y)
39
+ with Portfolio(["z3"],
40
+ environment=self.env,
41
+ logic=QF_LRA) as solver:
42
+ res = solver.is_sat(formula)
43
+ self.assertTrue(res)
44
+ model = solver.get_model()
45
+ formula_val_term = model.get_value(formula)
46
+ self.assertTrue(formula_val_term.is_true())
47
+
33
48
  @skipIfSolverNotAvailable("z3")
34
49
  @skipIfSolverNotAvailable("msat")
35
50
  @skipIfSolverNotAvailable("cvc5")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySMT
3
- Version: 0.9.7.dev446
3
+ Version: 0.9.7.dev452
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=5kJqOv_zBP-riTMt_fqKHt6vfxtVf0Y892c-MSYnt5Y,1701
1
+ pysmt/__init__.py,sha256=H1RSyIhE62I8bMHuJMFdulWPhnFnfJ5WhtMApT7Oz-8,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
@@ -62,7 +62,7 @@ pysmt/solvers/interpolation.py,sha256=6AO1wMkEKSkptuC4aXlNEO8Be1K2oW3W_er2XGc_aE
62
62
  pysmt/solvers/msat.py,sha256=feT1NYkc6cSCvKVtKIk_fPmo_mOIpyKWCrJEMQS9G4s,60568
63
63
  pysmt/solvers/options.py,sha256=DRNUMb5Tlhai4keQkF7Kg34tf3AGbBUd45mqzjsS69c,4036
64
64
  pysmt/solvers/pico.py,sha256=y31QT7ZQVMeKjXc7g4DZrpc1LTzbhCLyE0zyOLd-BsE,10680
65
- pysmt/solvers/portfolio.py,sha256=v2OvmQdh84YlXKZQgc_cx3UQ7MPL8l5heOV6WHEyXnU,9809
65
+ pysmt/solvers/portfolio.py,sha256=GFKR2S8FoANzZJWUkYVqWEJG7sw04RYgSnwaKJNWuUs,10092
66
66
  pysmt/solvers/qelim.py,sha256=iEQ9PE9IPFA6dxqSMHFp3aIyDCTiZyIlSAduh0txrAg,5451
67
67
  pysmt/solvers/smtlib.py,sha256=daJkKBtTMHLIoQt77dhT8Qh8P6eFBO9mF4C6tialtBc,9924
68
68
  pysmt/solvers/solver.py,sha256=AqmWoDPKLpjpb0RlyUS-qYGCqPRetZKbiTIT-usczjA,19467
@@ -99,7 +99,7 @@ pysmt/test/test_nlira.py,sha256=_E1HeOarw4TN8AI1X7EQv-utjhwy8hJX3vx-05eHJk0,4969
99
99
  pysmt/test/test_optimization.py,sha256=xU0gJbD2SSn5_lA7wF7IKcR54KF6NU0g-2_dDEqXmqA,24358
100
100
  pysmt/test/test_optimizing.py,sha256=P-XnTPEPoEp5LvvZfZoiZziI4z3d_FfL7lFcEuI07bE,1512
101
101
  pysmt/test/test_oracles.py,sha256=cHBPTUoi9cPmIvR-DG4bbzohOaBdUJzpKLoQXImxS_c,5615
102
- pysmt/test/test_portfolio.py,sha256=k0Jdrdr-EX-BVCxqYNUS3YjC77aCpzzdhezjB8U3OCM,7125
102
+ pysmt/test/test_portfolio.py,sha256=MIlXPyvBHxXnV5V-4PQ1WTTwVIgrR_CUvq-PYUajaiM,7685
103
103
  pysmt/test/test_printing.py,sha256=MwxLcmpwN0DYLlqGNrOZM4U1RPdTM1k75_IMKWQFLts,9064
104
104
  pysmt/test/test_qe.py,sha256=k8zYX-lcij0ua9yuRXl7wErUklEgLSEh68QDpV8J9xs,7157
105
105
  pysmt/test/test_regressions.py,sha256=Wuah55f5rROEkhTho_zl-uwaMDzc4LPeP3lfQ6nzS8k,21977
@@ -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=EAxSneEW91Z8GphlkbMPsPdlac7_FDcVj-_6_aunU2s,10902
145
145
  pysmt/walkers/tree.py,sha256=8oyDSXZtUsCdExcrwG3hKuEgARHgdW6fvz0LZJwjp-k,2983
146
- pysmt-0.9.7.dev446.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
- pysmt-0.9.7.dev446.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
- pysmt-0.9.7.dev446.dist-info/METADATA,sha256=MFt6QHqHsJb9VP0TrTS4mMiCmy5tPWEtn0Js7dCPf38,1774
149
- pysmt-0.9.7.dev446.dist-info/WHEEL,sha256=4YBfCYNH4wlLpv3pzq1hbEuIlXA4WJabKLFurZ7eTL0,109
150
- pysmt-0.9.7.dev446.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
- pysmt-0.9.7.dev446.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
- pysmt-0.9.7.dev446.dist-info/RECORD,,
146
+ pysmt-0.9.7.dev452.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
+ pysmt-0.9.7.dev452.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
+ pysmt-0.9.7.dev452.dist-info/METADATA,sha256=7YalyJRjNuUsu3qa8tLhqU498-dd5f4EfE8o_bPpV7w,1774
149
+ pysmt-0.9.7.dev452.dist-info/WHEEL,sha256=4YBfCYNH4wlLpv3pzq1hbEuIlXA4WJabKLFurZ7eTL0,109
150
+ pysmt-0.9.7.dev452.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
+ pysmt-0.9.7.dev452.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
+ pysmt-0.9.7.dev452.dist-info/RECORD,,