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.
Files changed (98) hide show
  1. {python_sat-1.8.dev22/python_sat.egg-info → python_sat-1.8.dev23}/PKG-INFO +1 -1
  2. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/bbscan.py +33 -23
  3. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/__init__.py +1 -1
  4. {python_sat-1.8.dev22 → python_sat-1.8.dev23/python_sat.egg-info}/PKG-INFO +1 -1
  5. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/LICENSE.txt +0 -0
  6. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/MANIFEST.in +0 -0
  7. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/README.rst +0 -0
  8. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/__init__.py +0 -0
  9. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/approxmc.py +0 -0
  10. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/allies/unigen.py +0 -0
  11. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/bitwise.hh +0 -0
  12. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/card.hh +0 -0
  13. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/clset.hh +0 -0
  14. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/common.hh +0 -0
  15. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/itot.hh +0 -0
  16. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/ladder.hh +0 -0
  17. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/mto.hh +0 -0
  18. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/pairwise.hh +0 -0
  19. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/ptypes.hh +0 -0
  20. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/pycard.cc +0 -0
  21. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/seqcounter.hh +0 -0
  22. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/sortcard.hh +0 -0
  23. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/cardenc/utils.hh +0 -0
  24. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/__init__.py +0 -0
  25. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/bica.py +0 -0
  26. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/fm.py +0 -0
  27. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/genhard.py +0 -0
  28. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/hitman.py +0 -0
  29. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/lbx.py +0 -0
  30. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/lsu.py +0 -0
  31. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/mcsls.py +0 -0
  32. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/models.py +0 -0
  33. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/musx.py +0 -0
  34. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/optux.py +0 -0
  35. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/primer.py +0 -0
  36. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/rc2.py +0 -0
  37. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/examples/usage.py +0 -0
  38. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/_fileio.py +0 -0
  39. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/_utils.py +0 -0
  40. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/card.py +0 -0
  41. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/engines.py +0 -0
  42. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/formula.py +0 -0
  43. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/pb.py +0 -0
  44. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/process.py +0 -0
  45. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/pysat/solvers.py +0 -0
  46. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/SOURCES.txt +0 -0
  47. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/dependency_links.txt +0 -0
  48. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/requires.txt +0 -0
  49. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/python_sat.egg-info/top_level.txt +0 -0
  50. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/requirements.txt +0 -0
  51. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/setup.cfg +0 -0
  52. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/setup.py +0 -0
  53. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical103.tar.gz +0 -0
  54. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical153.tar.gz +0 -0
  55. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/cadical195.tar.gz +0 -0
  56. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose30.tar.gz +0 -0
  57. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose41.tar.gz +0 -0
  58. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/glucose421.tar.gz +0 -0
  59. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/lingeling.tar.gz +0 -0
  60. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplechrono.zip +0 -0
  61. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplecm.zip +0 -0
  62. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/maplesat.zip +0 -0
  63. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/mergesat3.tar.gz +0 -0
  64. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minicard.tar.gz +0 -0
  65. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minisat22.tar.gz +0 -0
  66. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/minisatgh.zip +0 -0
  67. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical103.patch +0 -0
  68. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical153.patch +0 -0
  69. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/cadical195.patch +0 -0
  70. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose30.patch +0 -0
  71. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose41.patch +0 -0
  72. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/glucose421.patch +0 -0
  73. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/gluecard30.patch +0 -0
  74. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/gluecard41.patch +0 -0
  75. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/lingeling.patch +0 -0
  76. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplechrono.patch +0 -0
  77. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplecm.patch +0 -0
  78. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/maplesat.patch +0 -0
  79. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/mergesat3.patch +0 -0
  80. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minicard.patch +0 -0
  81. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minisat22.patch +0 -0
  82. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/patches/minisatgh.patch +0 -0
  83. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/prepare.py +0 -0
  84. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/solvers/pysolvers.cc +0 -0
  85. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_accum_stats.py +0 -0
  86. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmost.py +0 -0
  87. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmost1.py +0 -0
  88. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_atmostk.py +0 -0
  89. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_boolengine.py +0 -0
  90. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_clausification.py +0 -0
  91. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_cnf.py +0 -0
  92. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_equals1.py +0 -0
  93. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_formula_unique.py +0 -0
  94. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_process.py +0 -0
  95. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_propagate.py +0 -0
  96. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_unique_model.py +0 -0
  97. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_unique_mus.py +0 -0
  98. {python_sat-1.8.dev22 → python_sat-1.8.dev23}/tests/test_warmstart.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sat
3
- Version: 1.8.dev22
3
+ Version: 1.8.dev23
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
@@ -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 / variables, which may run faster
211
- than computing the entire formula's backbone. To focus on a
212
- particular set of variables / literals, the user should use the
213
- parameter ``focus_on``, which is set to ``None`` by default.
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
- self.model = self.oracle.get_model()
319
- # if self.lift:
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
- model = self._process_model(self.oracle.get_model())
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 = int(arg)
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> Algorithm to use')
611
- print(' Available values: enum, iter, compl, chunk, core, corechunk (default: iter)')
612
- print(' -c, --chunk=<int> Chunk size for chunking algorithms')
613
- print(' Available values: [1 .. INT_MAX] (default: 100)')
614
- print(' -h, --help Show this message')
615
- print(' -l, --lift Apply literal lifting for heuristic model reduction')
616
- print(' -r, --rotate Heuristically filter out rotatable literals')
617
- print(' -s, --solver=<string> SAT solver to use')
618
- print(' Available values: cd15, cd19, g3, g4, lgl, mcb, mcm, mpl, m22, mc, mgh (default: g3)')
619
- print(' -v, --verbose Be verbose (can be used multiple times)')
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}; ({1:.2f})'.format(bbscan.filtered, 100. * bbscan.filtered / formula.nv))
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))
@@ -10,7 +10,7 @@
10
10
 
11
11
  # current version
12
12
  #==============================================================================
13
- VERSION = (1, 8, 'dev', 22)
13
+ VERSION = (1, 8, 'dev', 23)
14
14
 
15
15
 
16
16
  # PEP440 Format
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-sat
3
- Version: 1.8.dev22
3
+ Version: 1.8.dev23
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
File without changes
File without changes