PySMT 0.9.7.dev426__py2.py3-none-any.whl → 0.9.7.dev431__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", 426)
22
+ VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 431)
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/solvers/msat.py CHANGED
@@ -322,7 +322,7 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
322
322
  def all_sat(self, important, callback):
323
323
  self.push()
324
324
  self._msat_lib.msat_all_sat(self.msat_env(),
325
- [self._var2term(x) for x in important],
325
+ [self.converter.convert(x) for x in important],
326
326
  callback)
327
327
  self.pop()
328
328
 
@@ -336,11 +336,6 @@ class MathSAT5Solver(IncrementalTrackingSolver, UnsatCoreSolver, SmtLibBasicSolv
336
336
  for _ in range(levels):
337
337
  self._msat_lib.msat_pop_backtrack_point(self.msat_env())
338
338
 
339
- def _var2term(self, var):
340
- decl = self._msat_lib.msat_find_decl(self.msat_env(), var.symbol_name())
341
- titem = self._msat_lib.msat_make_term(self.msat_env(), decl, [])
342
- return titem
343
-
344
339
  def set_preferred_var(self, var, val=None):
345
340
  tvar = self.converter.convert(var)
346
341
  mval = self._msat_lib.MSAT_UNDEF
@@ -574,6 +574,40 @@ class TestRegressions(TestCase):
574
574
  s.add_assertion(f)
575
575
  self.assertFalse(s.solve())
576
576
 
577
+ @skipIfSolverNotAvailable("msat")
578
+ def test_msat_all_sat_theory_atoms(self):
579
+ # Regression test: MathSAT5Solver.all_sat must accept arbitrary
580
+ # SMT-atoms as "important" terms, not only Boolean symbols.
581
+ # Previously the "important" terms were converted with a helper
582
+ # (_var2term) that assumed each term was a declared symbol, so
583
+ # passing a theory atom raised an AssertionError.
584
+ x = Symbol("x", INT)
585
+ f = And(LE(Int(0), x), LE(x, Int(5)))
586
+ atom = LE(x, Int(2)) # a theory atom, not a Boolean symbol
587
+
588
+ result = []
589
+
590
+ def callback(model, converter, res):
591
+ res.append(And(converter.back(v) for v in model))
592
+ return 1 # continue enumeration
593
+
594
+ with Solver(name="msat",
595
+ solver_options={
596
+ "dpll.allsat_minimize_model": "false",
597
+ "dpll.allsat_allow_duplicates": "false",
598
+ "preprocessor.toplevel_propagation": "false",
599
+ "preprocessor.simplification": "0",
600
+ }) as msat:
601
+ msat.add_assertion(f)
602
+ # This call used to raise AssertionError on a theory atom.
603
+ msat.all_sat([atom], lambda m: callback(m, msat.converter, result))
604
+
605
+ # The atom can be both true (x in [0,2]) and false (x in [3,5]),
606
+ # so we expect exactly the two disjoint total assignments.
607
+ self.assertEqual(len(result), 2, result)
608
+ self.assertIn(atom, result)
609
+ self.assertIn(Not(atom), result)
610
+
577
611
 
578
612
  if __name__ == "__main__":
579
613
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySMT
3
- Version: 0.9.7.dev426
3
+ Version: 0.9.7.dev431
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=ByC9yo7DDZWxOBKWGjb8mbHUyTnTcsmIxrjjEfDVLO4,1701
1
+ pysmt/__init__.py,sha256=i5sG2soSbeXz4N7EIPPiKx_K1yNeoxD603-viPBU7Hk,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
@@ -59,7 +59,7 @@ pysmt/solvers/cvcfour.py,sha256=iMMpFRxr7EoNjZnO64q7R1rIodQqw71Cv1JiIdj6kzE,2447
59
59
  pysmt/solvers/dynmsat.py,sha256=bJokwHoxKWmQGqw9nQerRDb33d5c66Sa91jUYiZXwY0,2124
60
60
  pysmt/solvers/eager.py,sha256=ZvtXsD-4QAhjd8gRNb_CrosjSLEJn07YEwVEMKTnHAg,3634
61
61
  pysmt/solvers/interpolation.py,sha256=6AO1wMkEKSkptuC4aXlNEO8Be1K2oW3W_er2XGc_aEA,2066
62
- pysmt/solvers/msat.py,sha256=2tsJ_VjyoTBGopgrDjxsYjMih5Pql52dqtQ_DMGiiyY,60313
62
+ pysmt/solvers/msat.py,sha256=FNsufZycnGjbjIdMRnupSSQKo3J4KtlhSRKmSIHWzRU,60115
63
63
  pysmt/solvers/options.py,sha256=DRNUMb5Tlhai4keQkF7Kg34tf3AGbBUd45mqzjsS69c,4036
64
64
  pysmt/solvers/pico.py,sha256=1fN9hy22ym0FYbLYhSoADx1StQBxwd60Kx_RqcUtXdA,10653
65
65
  pysmt/solvers/portfolio.py,sha256=v2OvmQdh84YlXKZQgc_cx3UQ7MPL8l5heOV6WHEyXnU,9809
@@ -102,7 +102,7 @@ pysmt/test/test_oracles.py,sha256=cHBPTUoi9cPmIvR-DG4bbzohOaBdUJzpKLoQXImxS_c,56
102
102
  pysmt/test/test_portfolio.py,sha256=k0Jdrdr-EX-BVCxqYNUS3YjC77aCpzzdhezjB8U3OCM,7125
103
103
  pysmt/test/test_printing.py,sha256=glsnaMRungLc31JIJTmHlT69JnTPsC5pnYn1rZriV2s,8765
104
104
  pysmt/test/test_qe.py,sha256=k8zYX-lcij0ua9yuRXl7wErUklEgLSEh68QDpV8J9xs,7157
105
- pysmt/test/test_regressions.py,sha256=wBenKzS3z88CptS0fFlMkRMSefV5AFt8g0KJdrB_Co4,20421
105
+ pysmt/test/test_regressions.py,sha256=Wuah55f5rROEkhTho_zl-uwaMDzc4LPeP3lfQ6nzS8k,21977
106
106
  pysmt/test/test_rewritings.py,sha256=1eeseDwZyQD2VrOFBABXHTYJFJOXszP4olbCNeLcwfA,15607
107
107
  pysmt/test/test_shannon_expansion.py,sha256=yaiZuB24wj1Zi-KdzRTmWuzAVaF9bQ603uto7zi6XBs,3082
108
108
  pysmt/test/test_simplify.py,sha256=ckQn_DUxVvGspaRNZmSPHkudhpUlG5K2w6C0wDqhL1w,7620
@@ -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.dev426.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
- pysmt-0.9.7.dev426.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
- pysmt-0.9.7.dev426.dist-info/METADATA,sha256=OBbT-BiX18TyB_eexcDHtuGdpORrCGriNPasJSpnt0s,1774
149
- pysmt-0.9.7.dev426.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
150
- pysmt-0.9.7.dev426.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
- pysmt-0.9.7.dev426.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
- pysmt-0.9.7.dev426.dist-info/RECORD,,
146
+ pysmt-0.9.7.dev431.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
147
+ pysmt-0.9.7.dev431.dist-info/licenses/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
148
+ pysmt-0.9.7.dev431.dist-info/METADATA,sha256=QcXLPhcitd6QBScf86ZsMC2LPFvJ5M5qgagPBxj-bkk,1774
149
+ pysmt-0.9.7.dev431.dist-info/WHEEL,sha256=TdQ5LtNwLuxTCjgxN51AgdU5w-KkB9ttmLbzjTH02pg,109
150
+ pysmt-0.9.7.dev431.dist-info/entry_points.txt,sha256=gDc1XM0xTJJMDGC_nXd0kfbX-Omjke9Dn9F3awMLYIU,57
151
+ pysmt-0.9.7.dev431.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
152
+ pysmt-0.9.7.dev431.dist-info/RECORD,,