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.
- {python-sat-1.8.dev18/python_sat.egg-info → python_sat-1.8.dev20}/PKG-INFO +1 -1
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/bica.py +5 -5
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/__init__.py +1 -1
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/_fileio.py +30 -14
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/formula.py +201 -166
- {python-sat-1.8.dev18 → python_sat-1.8.dev20/python_sat.egg-info}/PKG-INFO +1 -1
- python_sat-1.8.dev20/tests/test_formula_unique.py +101 -0
- python-sat-1.8.dev18/tests/test_formula_unique.py +0 -38
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/LICENSE.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/MANIFEST.in +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/README.rst +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/__init__.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/approxmc.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/allies/unigen.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/bitwise.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/card.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/clset.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/common.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/itot.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/ladder.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/mto.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/pairwise.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/ptypes.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/pycard.cc +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/seqcounter.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/sortcard.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/cardenc/utils.hh +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/__init__.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/fm.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/genhard.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/hitman.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/lbx.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/lsu.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/mcsls.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/models.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/musx.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/optux.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/primer.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/rc2.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/examples/usage.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/_utils.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/card.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/engines.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/pb.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/process.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/pysat/solvers.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/SOURCES.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/dependency_links.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/requires.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/python_sat.egg-info/top_level.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/requirements.txt +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/setup.cfg +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/setup.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical103.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical153.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical170.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/cadical195.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose30.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose41.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/glucose421.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/lingeling.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplechrono.zip +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplecm.zip +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/maplesat.zip +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/mergesat3.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minicard.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minisat22.tar.gz +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/minisatgh.zip +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical103.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical153.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/cadical195.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose30.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose41.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/glucose421.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/gluecard30.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/gluecard41.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/lingeling.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplechrono.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplecm.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/maplesat.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/mergesat3.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minicard.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minisat22.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/patches/minisatgh.patch +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/prepare.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/solvers/pysolvers.cc +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_accum_stats.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmost.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmost1.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_atmostk.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_boolengine.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_clausification.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_cnf.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_equals1.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_process.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_propagate.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_unique_model.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_unique_mus.py +0 -0
- {python-sat-1.8.dev18 → python_sat-1.8.dev20}/tests/test_warmstart.py +0 -0
|
@@ -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.
|
|
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='
|
|
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='
|
|
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 = '
|
|
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 =
|
|
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]')
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
Module description
|
|
23
23
|
==================
|
|
24
24
|
|
|
25
|
-
This simple module provides a basic interface to input/output operations
|
|
26
|
-
files. Its key design feature is the ability to work with both
|
|
27
|
-
and compressed files through a unified interface, thus,
|
|
28
|
-
for a user to deal with various types of compressed
|
|
29
|
-
types supported include gzip, bzip2,
|
|
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 ``
|
|
79
|
-
be used in Python 3 by default and also in Python 2 if
|
|
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,
|
|
94
|
-
algorithm is defined by the extension of the given file
|
|
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
|
|
113
|
-
mode. The method inherits its input parameters from the
|
|
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
|
-
|
|
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
|
|