python-sat 1.8.dev25__cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.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.

Potentially problematic release.


This version of python-sat might be problematic. Click here for more details.

Files changed (48) hide show
  1. pycard.cpython-314-x86_64-linux-gnu.so +0 -0
  2. pysat/__init__.py +24 -0
  3. pysat/_fileio.py +209 -0
  4. pysat/_utils.py +58 -0
  5. pysat/allies/__init__.py +0 -0
  6. pysat/allies/approxmc.py +385 -0
  7. pysat/allies/unigen.py +435 -0
  8. pysat/card.py +802 -0
  9. pysat/engines.py +1302 -0
  10. pysat/examples/__init__.py +0 -0
  11. pysat/examples/bbscan.py +663 -0
  12. pysat/examples/bica.py +691 -0
  13. pysat/examples/fm.py +527 -0
  14. pysat/examples/genhard.py +516 -0
  15. pysat/examples/hitman.py +653 -0
  16. pysat/examples/lbx.py +638 -0
  17. pysat/examples/lsu.py +496 -0
  18. pysat/examples/mcsls.py +610 -0
  19. pysat/examples/models.py +189 -0
  20. pysat/examples/musx.py +344 -0
  21. pysat/examples/optux.py +710 -0
  22. pysat/examples/primer.py +620 -0
  23. pysat/examples/rc2.py +1858 -0
  24. pysat/examples/usage.py +63 -0
  25. pysat/formula.py +5619 -0
  26. pysat/pb.py +463 -0
  27. pysat/process.py +363 -0
  28. pysat/solvers.py +7591 -0
  29. pysolvers.cpython-314-x86_64-linux-gnu.so +0 -0
  30. python_sat-1.8.dev25.data/scripts/approxmc.py +385 -0
  31. python_sat-1.8.dev25.data/scripts/bbscan.py +663 -0
  32. python_sat-1.8.dev25.data/scripts/bica.py +691 -0
  33. python_sat-1.8.dev25.data/scripts/fm.py +527 -0
  34. python_sat-1.8.dev25.data/scripts/genhard.py +516 -0
  35. python_sat-1.8.dev25.data/scripts/lbx.py +638 -0
  36. python_sat-1.8.dev25.data/scripts/lsu.py +496 -0
  37. python_sat-1.8.dev25.data/scripts/mcsls.py +610 -0
  38. python_sat-1.8.dev25.data/scripts/models.py +189 -0
  39. python_sat-1.8.dev25.data/scripts/musx.py +344 -0
  40. python_sat-1.8.dev25.data/scripts/optux.py +710 -0
  41. python_sat-1.8.dev25.data/scripts/primer.py +620 -0
  42. python_sat-1.8.dev25.data/scripts/rc2.py +1858 -0
  43. python_sat-1.8.dev25.data/scripts/unigen.py +435 -0
  44. python_sat-1.8.dev25.dist-info/METADATA +45 -0
  45. python_sat-1.8.dev25.dist-info/RECORD +48 -0
  46. python_sat-1.8.dev25.dist-info/WHEEL +6 -0
  47. python_sat-1.8.dev25.dist-info/licenses/LICENSE.txt +21 -0
  48. python_sat-1.8.dev25.dist-info/top_level.txt +3 -0
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python
2
+ #-*- coding:utf-8 -*-
3
+ ##
4
+ ## usage.py
5
+ ##
6
+ ## Created on: Nov 27, 2016
7
+ ## Author: Alexey S. Ignatiev
8
+ ## E-mail: aignatiev@ciencias.ulisboa.pt
9
+ ##
10
+
11
+ #
12
+ #==============================================================================
13
+ from __future__ import print_function
14
+ from pysat.solvers import Solver # standard way to import the library
15
+ from pysat.solvers import Minisat22, Glucose3 # more direct way
16
+
17
+ #
18
+ #==============================================================================
19
+ if __name__ == '__main__':
20
+ print('simple infrastructure (add_clause, solve):')
21
+ s1 = Solver(name='g3')
22
+ s1.add_clause([-1, 2])
23
+ s1.add_clause([-2, 3])
24
+ s1.add_clause([-3, 4])
25
+
26
+ if s1.solve() == True:
27
+ print(s1.get_model())
28
+
29
+ print('blocking models:')
30
+ m = s1.get_model()
31
+ s1.add_clause([-l for l in m]) # actual blocking
32
+
33
+ if s1.solve() == True:
34
+ print(s1.get_model()) # should compute another model
35
+ s1.delete() # this is needed if used not within the 'with' context
36
+
37
+ print('model enumeration + bootstrapping the solver:')
38
+ s2 = Minisat22(bootstrap_with=[[-1, 2], [-2, 3], [-3, 4]]) # also working with MiniSat22 directly
39
+ for m in s2.enum_models(): # implemented as a generator
40
+ print(m)
41
+ s2.delete()
42
+
43
+ print('\'with\' constructor + assumptions:')
44
+ with Solver(name='mgh', bootstrap_with=[[-1, 2], [-2, 3], [-3, 4]]) as s3:
45
+ for m in s3.enum_models(assumptions=[5]):
46
+ print(m)
47
+
48
+ # no s3.delete() is needed -- it is called automatically if used in the 'with' environment
49
+
50
+ print('appending formula and extracting an unsat core:')
51
+ with Glucose3(bootstrap_with=[[-1, 2], [-2, 3]]) as s4:
52
+ s4.append_formula([[-3, 4], [-4, 5]])
53
+
54
+ if s4.solve(assumptions=[1, -5]) == False:
55
+ print(s4.get_core())
56
+
57
+ # no s4.delete() is needed -- it is called automatically if used in the 'with' environment
58
+
59
+ print('extracting a proof:') # supported by glucose and lingeling only
60
+ with Glucose3(bootstrap_with=[[-1, 2], [1, -2], [-1, -2], [1, 2]], with_proof=True) as s5:
61
+
62
+ if s5.solve() == False:
63
+ print(s5.get_proof())