python-sat 1.8.dev18__tar.gz → 1.8.dev20__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.
Files changed (99) hide show
  1. {python-sat-1.8.dev18/python_sat.egg-info → python_sat-1.8.dev20}/PKG-INFO +1 -1
  2. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/bica.py +5 -5
  3. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/__init__.py +1 -1
  4. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/_fileio.py +30 -14
  5. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/formula.py +201 -166
  6. {python-sat-1.8.dev18 → python_sat-1.8.dev20/python_sat.egg-info}/PKG-INFO +1 -1
  7. python_sat-1.8.dev20/tests/test_formula_unique.py +101 -0
  8. python-sat-1.8.dev18/tests/test_formula_unique.py +0 -38
  9. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/LICENSE.txt +0 -0
  10. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/MANIFEST.in +0 -0
  11. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/README.rst +0 -0
  12. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/__init__.py +0 -0
  13. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/approxmc.py +0 -0
  14. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/unigen.py +0 -0
  15. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/bitwise.hh +0 -0
  16. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/card.hh +0 -0
  17. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/clset.hh +0 -0
  18. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/common.hh +0 -0
  19. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/itot.hh +0 -0
  20. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/ladder.hh +0 -0
  21. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/mto.hh +0 -0
  22. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/pairwise.hh +0 -0
  23. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/ptypes.hh +0 -0
  24. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/pycard.cc +0 -0
  25. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/seqcounter.hh +0 -0
  26. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/sortcard.hh +0 -0
  27. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/utils.hh +0 -0
  28. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/__init__.py +0 -0
  29. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/fm.py +0 -0
  30. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/genhard.py +0 -0
  31. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/hitman.py +0 -0
  32. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/lbx.py +0 -0
  33. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/lsu.py +0 -0
  34. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/mcsls.py +0 -0
  35. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/models.py +0 -0
  36. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/musx.py +0 -0
  37. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/optux.py +0 -0
  38. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/primer.py +0 -0
  39. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/rc2.py +0 -0
  40. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/usage.py +0 -0
  41. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/_utils.py +0 -0
  42. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/card.py +0 -0
  43. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/engines.py +0 -0
  44. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/pb.py +0 -0
  45. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/process.py +0 -0
  46. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/solvers.py +0 -0
  47. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/SOURCES.txt +0 -0
  48. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/dependency_links.txt +0 -0
  49. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/requires.txt +0 -0
  50. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/top_level.txt +0 -0
  51. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/requirements.txt +0 -0
  52. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/setup.cfg +0 -0
  53. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/setup.py +0 -0
  54. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical103.tar.gz +0 -0
  55. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical153.tar.gz +0 -0
  56. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical170.tar.gz +0 -0
  57. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical195.tar.gz +0 -0
  58. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose30.tar.gz +0 -0
  59. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose41.tar.gz +0 -0
  60. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose421.tar.gz +0 -0
  61. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/lingeling.tar.gz +0 -0
  62. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplechrono.zip +0 -0
  63. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplecm.zip +0 -0
  64. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplesat.zip +0 -0
  65. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/mergesat3.tar.gz +0 -0
  66. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minicard.tar.gz +0 -0
  67. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minisat22.tar.gz +0 -0
  68. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minisatgh.zip +0 -0
  69. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical103.patch +0 -0
  70. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical153.patch +0 -0
  71. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical195.patch +0 -0
  72. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose30.patch +0 -0
  73. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose41.patch +0 -0
  74. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose421.patch +0 -0
  75. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/gluecard30.patch +0 -0
  76. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/gluecard41.patch +0 -0
  77. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/lingeling.patch +0 -0
  78. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplechrono.patch +0 -0
  79. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplecm.patch +0 -0
  80. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplesat.patch +0 -0
  81. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/mergesat3.patch +0 -0
  82. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minicard.patch +0 -0
  83. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minisat22.patch +0 -0
  84. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minisatgh.patch +0 -0
  85. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/prepare.py +0 -0
  86. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/pysolvers.cc +0 -0
  87. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_accum_stats.py +0 -0
  88. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmost.py +0 -0
  89. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmost1.py +0 -0
  90. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmostk.py +0 -0
  91. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_boolengine.py +0 -0
  92. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_clausification.py +0 -0
  93. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_cnf.py +0 -0
  94. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_equals1.py +0 -0
  95. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_process.py +0 -0
  96. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_propagate.py +0 -0
  97. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_unique_model.py +0 -0
  98. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_unique_mus.py +0 -0
  99. {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_warmstart.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-sat
3
- Version: 1.8.dev18
3
+ Version: 1.8.dev20
4
4
  Summary: A Python library for prototyping with SAT oracles
5
5
  Home-page: https://github.com/pysathq/pysat
6
6
  Author: Alexey Ignatiev, Joao Marques-Silva, Antonio Morgado
@@ -51,7 +51,7 @@
51
51
  navigation to determine the Southern Celestial Pole.)
52
52
 
53
53
  .. [1] Alexey Ignatiev, Alessandro Previti, Joao Marques-Silva.
54
- *SAT-Based Formula Simplification*. SAT 2015. pp.287-298
54
+ *SAT-Based Formula Simplification*. SAT 2015. pp. 287-298
55
55
 
56
56
  .. [2] Willard V. Quine. *The Problem of Simplifying Truth Functions*.
57
57
  American Mathematical Monthly 59(8). 1952. pp. 521-531
@@ -262,10 +262,10 @@ class Bica:
262
262
 
263
263
  """
264
264
 
265
- def __init__(self, formula, negated=None, target='cnf', psolver='g3',
265
+ def __init__(self, formula, negated=None, target='cnf', psolver='cd19',
266
266
  padapt=False, pdcalls=False, pexhaust=False, pminz=False,
267
267
  ppuresat=False, psearch='lin', punsorted=False, ptrim=False,
268
- osolver='g3', oadapt=False, odcalls=False, oexhaust=False,
268
+ osolver='mgh', oadapt=False, odcalls=False, oexhaust=False,
269
269
  ominz=False, onodisj=False, opuresat=False, ounsorted=False,
270
270
  otrim=False, weighted=False, verbose=0):
271
271
  """
@@ -538,7 +538,7 @@ def parse_options():
538
538
  ominz = False
539
539
  nodisj = False
540
540
  psolver = 'cd19'
541
- osolver = 'cd19'
541
+ osolver = 'mgh'
542
542
  ppuresat = False
543
543
  opuresat = False
544
544
  punsorted = False
@@ -638,7 +638,7 @@ def usage():
638
638
  print(' -s, --psolver SAT solver to use [Primer]')
639
639
  print(' Available values: cd, cd15, cd19, g3, g41, g42, lgl, mcb, mcm, mpl, m22, mc, mg3, mgh (default = cd19)')
640
640
  print(' -S, --osolver SAT solver to use [OptUx]')
641
- print(' Available values: cd, cd15, cd19, g3, g41, g42, lgl, mcb, mcm, mpl, m22, mc, mg3, mgh (default = cd19)')
641
+ print(' Available values: cd, cd15, cd19, g3, g41, g42, lgl, mcb, mcm, mpl, m22, mc, mg3, mgh (default = mgh)')
642
642
  print(' -t, --ptrim=<int> How many times to trim unsatisfiable cores [Primer]')
643
643
  print(' Available values: [0 .. INT_MAX] (default = 0)')
644
644
  print(' -T, --otrim=<int> How many times to trim unsatisfiable cores [OptUx]')
@@ -10,7 +10,7 @@
10
10
 
11
11
  # current version
12
12
  #==============================================================================
13
- VERSION = (1, 8, 'dev', 18)
13
+ VERSION = (1, 8, 'dev', 20)
14
14
 
15
15
 
16
16
  # PEP440 Format
@@ -22,11 +22,12 @@
22
22
  Module description
23
23
  ==================
24
24
 
25
- This simple module provides a basic interface to input/output operations on
26
- files. Its key design feature is the ability to work with both uncompressed
27
- and compressed files through a unified interface, thus, making it easier
28
- for a user to deal with various types of compressed files. The compression
29
- types supported include gzip, bzip2, and lzma (xz).
25
+ This simple module provides a basic interface to input/output operations
26
+ on files. Its key design feature is the ability to work with both
27
+ uncompressed and compressed files through a unified interface, thus,
28
+ making it easier for a user to deal with various types of compressed
29
+ files. The compression types supported include gzip, bzip2, lzma (xz), and
30
+ zstandard (zstd).
30
31
 
31
32
  The module is supposed to be mainly used by :mod:`pysat.formula`.
32
33
 
@@ -66,6 +67,13 @@ except ImportError:
66
67
  except ImportError: # for Python2 without lzma
67
68
  lzma_present = False
68
69
 
70
+ zstd_present = True
71
+ try:
72
+ from compression import zstd
73
+ except ImportError: # zstandard is introduced in Python 3.14
74
+ zstd_present = False
75
+
76
+
69
77
 
70
78
  #
71
79
  #==============================================================================
@@ -75,9 +83,10 @@ class FileObject(object):
75
83
  open files creating standard file pointers and closing them. The class
76
84
  is used when opening DIMACS files for reading and writing. Supports
77
85
  both uncompressed and compressed files. Compression algorithms
78
- supported are ``gzip``, ``bzip2``, and ``lzma``. Algorithm ``lzma`` can
79
- be used in Python 3 by default and also in Python 2 if the
80
- ``backports.lzma`` package is installed.
86
+ supported are ``gzip``, ``bzip2``, ``lzma``, and ``zstd``. Algorithm
87
+ ``lzma`` can be used in Python 3 by default and also in Python 2 if
88
+ the ``backports.lzma`` package is installed. Algorithm ``zstandard``
89
+ can be used in Python 3.14 and later.
81
90
 
82
91
  Note that the class opens a file in text mode.
83
92
 
@@ -90,8 +99,9 @@ class FileObject(object):
90
99
  :type compression: str
91
100
 
92
101
  Compression type can be ``None``, ``'gzip'``, ``'bzip2'``, ``'lzma'``,
93
- as well as ``'use_ext'``. If ``'use_ext'`` is specified, compression
94
- algorithm is defined by the extension of the given file name.
102
+ ``'zstd'``, as well as ``'use_ext'``. If ``'use_ext'`` is specified,
103
+ compression algorithm is defined by the extension of the given file
104
+ name.
95
105
  """
96
106
 
97
107
  def __init__(self, name, mode='r', compression=None):
@@ -109,9 +119,9 @@ class FileObject(object):
109
119
 
110
120
  def open(self, name, mode='r', compression=None):
111
121
  """
112
- Open a file pointer. Note that a file is *always* opened in text
113
- mode. The method inherits its input parameters from the constructor
114
- of :class:`FileObject`.
122
+ Open a file pointer. Note that a file is *always* opened in
123
+ text mode. The method inherits its input parameters from the
124
+ constructor of :class:`FileObject`.
115
125
  """
116
126
 
117
127
  if compression == 'use_ext':
@@ -138,11 +148,15 @@ class FileObject(object):
138
148
  self.fp = codecs.getreader('ascii')(self.fp_extra)
139
149
  else: # mode == 'w'
140
150
  self.fp = codecs.getwriter('ascii')(self.fp_extra)
141
- else: # self.ctype == 'lzma'
151
+ elif self.ctype == 'lzma':
142
152
  # LZMA is available in Python 2 only if backports.lzma is installed
143
153
  # Python 3 supports it by default
144
154
  assert lzma_present, 'LZMA compression is unavailable.'
145
155
  self.fp = lzma.open(name, mode=mode + 't')
156
+ else: # self.ctype == 'zstd'
157
+ # Zstandard is available only in Python 3.14 and later
158
+ assert zstd_present, 'Zstandard compression is unavailable.'
159
+ self.fp = zstd.open(name, mode=mode + 't')
146
160
 
147
161
  def close(self):
148
162
  """
@@ -175,6 +189,8 @@ class FileObject(object):
175
189
  self.ctype = 'bzip2'
176
190
  elif ext in ('.xz', '.lzma'):
177
191
  self.ctype = 'lzma'
192
+ elif ext == 'zst':
193
+ self.ctype = 'zstd'
178
194
  else:
179
195
  self.ctype = None
180
196