python-sat 1.8.dev22__tar.gz → 1.8.dev23__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.dev22/python_sat.egg-info → python_sat-1.8.dev23}/PKG-INFO +1 -1
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/bbscan.py +33 -23
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/__init__.py +1 -1
- {python_sat-1.8.dev22 → python_sat-1.8.dev23/python_sat.egg-info}/PKG-INFO +1 -1
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/LICENSE.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/MANIFEST.in +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/README.rst +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/__init__.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/approxmc.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/unigen.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/bitwise.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/card.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/clset.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/common.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/itot.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/ladder.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/mto.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/pairwise.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/ptypes.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/pycard.cc +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/seqcounter.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/sortcard.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/utils.hh +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/__init__.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/bica.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/fm.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/genhard.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/hitman.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/lbx.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/lsu.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/mcsls.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/models.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/musx.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/optux.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/primer.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/rc2.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/usage.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/_fileio.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/_utils.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/card.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/engines.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/formula.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/pb.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/process.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/solvers.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/SOURCES.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/dependency_links.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/requires.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/top_level.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/requirements.txt +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/setup.cfg +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/setup.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical103.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical153.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical195.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose30.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose41.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose421.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/lingeling.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplechrono.zip +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplecm.zip +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplesat.zip +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/mergesat3.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minicard.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minisat22.tar.gz +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minisatgh.zip +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical103.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical153.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical195.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose30.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose41.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose421.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/gluecard30.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/gluecard41.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/lingeling.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplechrono.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplecm.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplesat.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/mergesat3.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minicard.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minisat22.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minisatgh.patch +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/prepare.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/pysolvers.cc +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_accum_stats.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmost.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmost1.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmostk.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_boolengine.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_clausification.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_cnf.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_equals1.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_formula_unique.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_process.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_propagate.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_unique_model.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_unique_mus.py +0 -0
- {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_warmstart.py +0 -0
|
@@ -204,13 +204,16 @@ class BBScan:
|
|
|
204
204
|
|
|
205
205
|
If the chunking algorithm is selected (either ``'chunk'`` or
|
|
206
206
|
``'corechunk'``), the user may specify the size of the chunk,
|
|
207
|
-
which is set to 100 by default.
|
|
207
|
+
which is set to 100 by default. Note that the chunk_size can be a
|
|
208
|
+
floating-point number in the interval (0, 1], which will set the
|
|
209
|
+
actual chunk_size relative to the total number of literals of
|
|
210
|
+
interest.
|
|
208
211
|
|
|
209
212
|
Finally, one may opt for computing backbone literals out of a
|
|
210
|
-
particular subset of literals
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
particular subset of literals, which may run faster than computing
|
|
214
|
+
the entire formula's backbone. To focus on a particular set of
|
|
215
|
+
literals, the user should use the parameter ``focus_on``, which is
|
|
216
|
+
set to ``None`` by default.
|
|
214
217
|
|
|
215
218
|
.. note::
|
|
216
219
|
|
|
@@ -222,7 +225,7 @@ class BBScan:
|
|
|
222
225
|
:param focus_on: a list of literals to focus on
|
|
223
226
|
|
|
224
227
|
:type algorithm: str
|
|
225
|
-
:type chunk_size: int
|
|
228
|
+
:type chunk_size: int or float
|
|
226
229
|
:type focus_on: iterable(int)
|
|
227
230
|
"""
|
|
228
231
|
|
|
@@ -236,6 +239,10 @@ class BBScan:
|
|
|
236
239
|
else:
|
|
237
240
|
raise ValueError('Unsatisfiable formula')
|
|
238
241
|
|
|
242
|
+
if isinstance(chunk_size, float):
|
|
243
|
+
assert 0 < chunk_size <= 1, f'Wrong chunk proportion {chunk_size}'
|
|
244
|
+
chunk_size = int(min(self.formula.nv, len(self.model)) * chunk_size)
|
|
245
|
+
|
|
239
246
|
if algorithm == 'enum':
|
|
240
247
|
result = self._compute_enum()
|
|
241
248
|
elif algorithm == 'iter':
|
|
@@ -315,10 +322,8 @@ class BBScan:
|
|
|
315
322
|
if not self.oracle.solve():
|
|
316
323
|
break
|
|
317
324
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
# self.model = self._get_implicant(self.model)
|
|
321
|
-
|
|
325
|
+
coex = set(self.oracle.get_model())
|
|
326
|
+
self.model = [l for l in bbone if l in coex]
|
|
322
327
|
self.model = self._process_model(self.model)
|
|
323
328
|
|
|
324
329
|
# updating backbone estimate - intersection
|
|
@@ -380,7 +385,8 @@ class BBScan:
|
|
|
380
385
|
if self.oracle.solve() == False:
|
|
381
386
|
break
|
|
382
387
|
else:
|
|
383
|
-
|
|
388
|
+
coex = set(self.oracle.get_model())
|
|
389
|
+
model = [l for l in bbone if l in coex]
|
|
384
390
|
model = self._process_model(model)
|
|
385
391
|
bbone &= set(model)
|
|
386
392
|
|
|
@@ -580,7 +586,11 @@ def parse_options():
|
|
|
580
586
|
algo = str(arg)
|
|
581
587
|
assert algo in ('enum', 'iter', 'compl', 'chunk', 'core', 'corechunk'), 'Unknown algorithm'
|
|
582
588
|
elif opt in ('-c', '--chunk'):
|
|
583
|
-
chunk =
|
|
589
|
+
chunk = float(arg)
|
|
590
|
+
if chunk.is_integer():
|
|
591
|
+
chunk = int(chunk)
|
|
592
|
+
else:
|
|
593
|
+
assert 0 < chunk <= 1, f'Wrong chunk proportion {chunk_size}'
|
|
584
594
|
elif opt in ('-h', '--help'):
|
|
585
595
|
usage()
|
|
586
596
|
sys.exit(0)
|
|
@@ -607,16 +617,16 @@ def usage():
|
|
|
607
617
|
|
|
608
618
|
print('Usage:', os.path.basename(sys.argv[0]), '[options] file')
|
|
609
619
|
print('Options:')
|
|
610
|
-
print(' -a, --algo=<string>
|
|
611
|
-
print('
|
|
612
|
-
print(' -c, --chunk=<int>
|
|
613
|
-
print('
|
|
614
|
-
print(' -h, --help
|
|
615
|
-
print(' -l, --lift
|
|
616
|
-
print(' -r, --rotate
|
|
617
|
-
print(' -s, --solver=<string>
|
|
618
|
-
print('
|
|
619
|
-
print(' -v, --verbose
|
|
620
|
+
print(' -a, --algo=<string> Algorithm to use')
|
|
621
|
+
print(' Available values: enum, iter, compl, chunk, core, corechunk (default: iter)')
|
|
622
|
+
print(' -c, --chunk=<int,float> Chunk size for chunking algorithms')
|
|
623
|
+
print(' Available values: [1 .. INT_MAX] or (0 .. 1] (default: 100)')
|
|
624
|
+
print(' -h, --help Show this message')
|
|
625
|
+
print(' -l, --lift Apply literal lifting for heuristic model reduction')
|
|
626
|
+
print(' -r, --rotate Heuristically filter out rotatable literals')
|
|
627
|
+
print(' -s, --solver=<string> SAT solver to use')
|
|
628
|
+
print(' Available values: cd15, cd19, g3, g4, lgl, mcb, mcm, mpl, m22, mc, mgh (default: g3)')
|
|
629
|
+
print(' -v, --verbose Be verbose (can be used multiple times)')
|
|
620
630
|
|
|
621
631
|
|
|
622
632
|
#
|
|
@@ -653,7 +663,7 @@ if __name__ == '__main__':
|
|
|
653
663
|
print('v 0')
|
|
654
664
|
|
|
655
665
|
if verbose > 1:
|
|
656
|
-
print('c filtered: {0}
|
|
666
|
+
print('c filtered: {0} ({1:.2f})'.format(bbscan.filtered, 100. * bbscan.filtered / formula.nv))
|
|
657
667
|
|
|
658
668
|
print('c oracle time: {0:.4f}'.format(bbscan.oracle_time()))
|
|
659
669
|
print('c oracle calls: {0}'.format(bbscan.calls))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|