PySMT 0.9.6.dev34__py2.py3-none-any.whl → 0.9.6.dev40__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySMT
3
- Version: 0.9.6.dev34
3
+ Version: 0.9.6.dev40
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=yCrn4aHymc9pXCM6jfGn11U_zPMRl_jAFIlOY61Z1Js,1597
1
+ pysmt/__init__.py,sha256=hWqpn82Tx9kQPH1zudmTNCAjXEazGw3_4_5UHcbJnMw,1597
2
2
  pysmt/__main__.py,sha256=rR-MV1QtLYqtVoJyY3m5B5Iz-lua0-5o6YSB0W4lKy8,1085
3
3
  pysmt/configuration.py,sha256=MUIhnwCs-R8BIEPAu80GKlnX70RZLsyYvkIcnQFJAWU,4539
4
4
  pysmt/constants.py,sha256=l5obyz_O3gGbTaGaNWXgxNKuCobZNkHFrWTHWrr-qMw,4844
@@ -7,8 +7,8 @@ pysmt/environment.py,sha256=rdaxQ0uwmMPmcW4d5WnTYAyHNSCpRTgzRLaXQccG5-4,6522
7
7
  pysmt/exceptions.py,sha256=uG3FochPO1Y18cv1lXUjQtNbW-qZKd68zqs8oo2OEF4,4420
8
8
  pysmt/factory.py,sha256=iNag-fUAdm6lA4f_3Z6IKhV1FG-9MnPD47HPAlBMoxQ,23923
9
9
  pysmt/fnode.py,sha256=zKZP4yda8JxK6AXW3vCasRLYsLH5NzK_2Bjiy5ogtqo,33256
10
- pysmt/formula.py,sha256=bN7uLC3JMKgnmYrCBTe1iv29iysFeVEYL18k4CXz8NE,43317
11
- pysmt/logics.py,sha256=jQVLfCAaohyrMJhPcwj9-TA4tV_bOgTKiJXQBtlbrXY,28067
10
+ pysmt/formula.py,sha256=baexe5-GgrG7z_qH3Wb9s8XQqFcBgyLXnv8Rik5t2YY,43318
11
+ pysmt/logics.py,sha256=yJ1Yv24dVj4LlpnbspgcRT1t5e65RmvGas_bdHOGCAA,28774
12
12
  pysmt/operators.py,sha256=RU4H9E5eVjPgAar_9hIoCexq-Yc5v0xdHAMM69FcYX8,8132
13
13
  pysmt/oracles.py,sha256=lfRbPoiX4SXuJZktwmKUqA1FJ-7lRyP49LRIH8C7VoQ,19461
14
14
  pysmt/parsing.py,sha256=a3RY-ogJUSCx1BwePHL51AoD4jGjap1_6ML7S18hzuc,20786
@@ -78,7 +78,7 @@ pysmt/test/test_imports.py,sha256=micwbKICxYXjEcKgc3eBEsnTKFRiLSBaso2l2cX0GDw,15
78
78
  pysmt/test/test_int.py,sha256=dk72Q6viqRUs9XiPB40n6RrwiqsV6GbbKuSlYaQMU9k,1980
79
79
  pysmt/test/test_interpolation.py,sha256=WTodZtnxH5slIvUWbHbjjnI2o0naXgZwZawTGhh3E0o,3941
80
80
  pysmt/test/test_lira.py,sha256=1B4y1y2U-5CttF6h22tniJkAedUDIwjp1Ad0_Ha_s-8,2175
81
- pysmt/test/test_logics.py,sha256=zHDuqccNLC1XM77JWfya47cM-tshC_k2-NL1EYqOBnI,6734
81
+ pysmt/test/test_logics.py,sha256=Nppv0G7z0XIE8wHyWI3F04Vy1PY2iMVwvjyDcYBeS8A,6980
82
82
  pysmt/test/test_models.py,sha256=npqGoF-3DgAw0DTx6se32ZEZRFBJDcnkppzgyjLDbps,2748
83
83
  pysmt/test/test_native_qe.py,sha256=RGZgwbpAkPBTjIqcCbOkZ_nQXIDZ4Fznrr7Ldx6oA38,3439
84
84
  pysmt/test/test_nia.py,sha256=bYi1P3IVDPpsAKqMyV90wP-73lb_TgJCpOAj9RY2B_g,6500
@@ -126,10 +126,10 @@ pysmt/walkers/dag.py,sha256=pUdVTZx7CQyjrAb6jMfmsqS07J4kiDqHU8R4_9UvwkQ,5352
126
126
  pysmt/walkers/generic.py,sha256=q1j1T2RvCeJn1PM0H5d8vNV4FTYAEQgT7h8X5DJhDf8,4534
127
127
  pysmt/walkers/identitydag.py,sha256=f_D5qA198ayd3QO4u59fBX1RS_UiSBnPeV9O3ULvQv0,8737
128
128
  pysmt/walkers/tree.py,sha256=WIWN9IM0riWkaD40iP4Tt3BCN21iSdE1S7gRZqy56SU,2846
129
- PySMT-0.9.6.dev34.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
130
- PySMT-0.9.6.dev34.dist-info/METADATA,sha256=z2vwos4Vu3lgUKoQoBF77toQW5gvIdy2jkM1Pjb9mAs,1620
131
- PySMT-0.9.6.dev34.dist-info/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
132
- PySMT-0.9.6.dev34.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
133
- PySMT-0.9.6.dev34.dist-info/entry_points.txt,sha256=si0hIk-v3V35G3p8QGINoQ4QW-v4RYDRqj-asgyCgeM,58
134
- PySMT-0.9.6.dev34.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
135
- PySMT-0.9.6.dev34.dist-info/RECORD,,
129
+ PySMT-0.9.6.dev40.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
130
+ PySMT-0.9.6.dev40.dist-info/METADATA,sha256=wAHWMf8-ndKXmxy7AqhWWcqFpfaBUy6Hdb7lZcf3l9M,1620
131
+ PySMT-0.9.6.dev40.dist-info/NOTICE,sha256=Ns-Jsa6nbqZUiTEEAM6HqioSZIxQ2RCJzxoBlWQaUfc,601
132
+ PySMT-0.9.6.dev40.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
133
+ PySMT-0.9.6.dev40.dist-info/entry_points.txt,sha256=si0hIk-v3V35G3p8QGINoQ4QW-v4RYDRqj-asgyCgeM,58
134
+ PySMT-0.9.6.dev40.dist-info/top_level.txt,sha256=NwHQbpTaZMEvjIUdC0bvvj-WUyULe-nt-opK3YQNRMk,6
135
+ PySMT-0.9.6.dev40.dist-info/RECORD,,
pysmt/__init__.py CHANGED
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- VERSION = (0, 9, 6, "dev", 34)
19
+ VERSION = (0, 9, 6, "dev", 40)
20
20
 
21
21
  # Try to provide human-readable version of latest commit for dev versions
22
22
  # E.g. v0.5.1-4-g49a49f2-wip
pysmt/formula.py CHANGED
@@ -780,7 +780,7 @@ class FormulaManager(object):
780
780
  payload=(left.bv_width(),))
781
781
 
782
782
  def BVURem(self, left, right):
783
- """Returns the reminder of the two BV."""
783
+ """Returns the remainder of the two BV."""
784
784
  return self.create_node(node_type=op.BV_UREM,
785
785
  args=(left, right),
786
786
  payload=(left.bv_width(),))
pysmt/logics.py CHANGED
@@ -480,6 +480,14 @@ variables.""",
480
480
  quantifier_free=True,
481
481
  real_arithmetic=True)
482
482
 
483
+ QF_LIRA = Logic(name="QF_LIRA",
484
+ description=\
485
+ """Unquantified linear integer and real arithmetic""",
486
+ integer_arithmetic=True,
487
+ real_arithmetic=True,
488
+ linear=True,
489
+ quantifier_free=True)
490
+
483
491
  QF_NIA = Logic(name="QF_NIA",
484
492
  description=\
485
493
  """Quantifier-free integer arithmetic.""",
@@ -667,7 +675,7 @@ QF_LOGICS = frozenset(_l for _l in LOGICS if _l.quantifier_free)
667
675
  # This is the set of logics supported by the current version of pySMT
668
676
  #
669
677
  PYSMT_LOGICS = frozenset([QF_BOOL, QF_IDL, QF_LIA, QF_LRA, QF_RDL, QF_UF, QF_UFIDL,
670
- QF_UFLIA, QF_UFLRA, QF_UFLIRA,
678
+ QF_UFLIA, QF_UFLRA, QF_UFLIRA, QF_LIRA,
671
679
  BOOL, LRA, LIA, UFLIRA, UFLRA,
672
680
  QF_BV, QF_UFBV,
673
681
  QF_SLIA,
@@ -795,10 +803,17 @@ def get_closer_logic(supported_logics, logic):
795
803
  does not support the given logic.
796
804
 
797
805
  """
798
- res = [l for l in supported_logics if logic <= l]
799
- if len(res) == 0:
806
+ candidates = [l for l in supported_logics if logic <= l]
807
+ if len(candidates) == 0:
800
808
  raise NoLogicAvailableError("Logic %s is not supported" % logic)
801
- return min(res)
809
+
810
+ # We remove from the candidates, the logics that subsume another candidate
811
+ # (i.e. that are more general) because we are looking for the closer logic
812
+ res = [l for l in candidates if not any(l != k and k <= l for k in candidates)]
813
+
814
+ # There might be multiple incomparable logics that are closer, we
815
+ # deterministically select the one having a lexicographically smaller name
816
+ return sorted(res, key=lambda x:str(x))[0]
802
817
 
803
818
 
804
819
  def get_closer_pysmt_logic(target_logic):
pysmt/test/test_logics.py CHANGED
@@ -16,9 +16,9 @@
16
16
  # limitations under the License.
17
17
  #
18
18
  import pysmt.logics
19
- from pysmt.logics import get_logic_by_name, get_logic, most_generic_logic
19
+ from pysmt.logics import get_closer_logic, get_logic_by_name, get_logic, most_generic_logic
20
20
  from pysmt.logics import PYSMT_LOGICS
21
- from pysmt.logics import QF_LIA, LIA, UFLIRA, LRA, QF_UFLIRA, QF_BV, NRA, QF_IDL, QF_BOOL
21
+ from pysmt.logics import QF_LIA, LIA, UFLIRA, LRA, QF_UFLIRA, QF_BV, NRA, QF_IDL, QF_BOOL, QF_NIRA, QF_LIRA
22
22
  from pysmt.logics import Theory
23
23
  from pysmt.exceptions import (UndefinedLogicError, NoSolverAvailableError,
24
24
  NoLogicAvailableError)
@@ -142,5 +142,10 @@ class TestLogic(TestCase):
142
142
  integer_arithmetic=True)
143
143
  self.assertIsNotNone(t)
144
144
 
145
+ def test_get_closer_logic_is_deterministic(self):
146
+ l1 = get_closer_logic([QF_UFLIRA, QF_NIRA], QF_LIRA)
147
+ l2 = get_closer_logic([QF_NIRA, QF_UFLIRA], QF_LIRA)
148
+ self.assertEqual(l1, l2)
149
+
145
150
  if __name__ == "__main__":
146
151
  main()