python-sat 1.9.dev23__cp315-cp315-win_amd64.whl → 1.9.dev24__cp315-cp315-win_amd64.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.
- pycard.cp315-win_amd64.pyd +0 -0
- pyformula.cp315-win_amd64.pyd +0 -0
- pysat/__init__.py +1 -1
- pysat/examples/models.py +13 -6
- pysat/solvers.py +69 -364
- pysolvers.cp315-win_amd64.pyd +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/models.py +13 -6
- python_sat-1.9.dev24.dist-info/DELVEWHEEL +2 -0
- {python_sat-1.9.dev23.dist-info → python_sat-1.9.dev24.dist-info}/METADATA +1 -1
- {python_sat-1.9.dev23.dist-info → python_sat-1.9.dev24.dist-info}/RECORD +27 -27
- python_sat-1.9.dev23.dist-info/DELVEWHEEL +0 -2
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/platlib/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/approxmc.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/bbscan.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/bica.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/fm.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/genhard.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/lbx.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/lsu.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/mcsls.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/musx.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/optux.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/primer.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/rc2.py +0 -0
- {python_sat-1.9.dev23.data → python_sat-1.9.dev24.data}/scripts/unigen.py +0 -0
- {python_sat-1.9.dev23.dist-info → python_sat-1.9.dev24.dist-info}/WHEEL +0 -0
- {python_sat-1.9.dev23.dist-info → python_sat-1.9.dev24.dist-info}/licenses/LICENSE.txt +0 -0
- {python_sat-1.9.dev23.dist-info → python_sat-1.9.dev24.dist-info}/top_level.txt +0 -0
pycard.cp315-win_amd64.pyd
CHANGED
|
Binary file
|
pyformula.cp315-win_amd64.pyd
CHANGED
|
Binary file
|
pysat/__init__.py
CHANGED
pysat/examples/models.py
CHANGED
|
@@ -66,7 +66,7 @@ import sys
|
|
|
66
66
|
|
|
67
67
|
#
|
|
68
68
|
#==============================================================================
|
|
69
|
-
def enumerate_models(formula, to_enum, solver, warm=False):
|
|
69
|
+
def enumerate_models(formula, to_enum, solver, warm=False, projection=[]):
|
|
70
70
|
"""
|
|
71
71
|
Enumeration procedure. It represents a loop iterating over satisfying
|
|
72
72
|
assignment for a given formula until either all or a given number of
|
|
@@ -76,11 +76,13 @@ def enumerate_models(formula, to_enum, solver, warm=False):
|
|
|
76
76
|
:param to_enum: number of models to compute
|
|
77
77
|
:param solver: name of SAT solver
|
|
78
78
|
:param warm: warm start flag
|
|
79
|
+
:param projection: optional variable IDs to enumerate
|
|
79
80
|
|
|
80
81
|
:type formula: :class:`.CNFPlus`
|
|
81
82
|
:type to_enum: int or 'all'
|
|
82
83
|
:type solver: str
|
|
83
84
|
:type warm: bool
|
|
85
|
+
:type projection: list(int)
|
|
84
86
|
"""
|
|
85
87
|
|
|
86
88
|
with Solver(name=solver, bootstrap_with=formula.clauses,
|
|
@@ -99,7 +101,7 @@ def enumerate_models(formula, to_enum, solver, warm=False):
|
|
|
99
101
|
|
|
100
102
|
# model enumeration and printing is done here
|
|
101
103
|
computed = 0
|
|
102
|
-
for i, model in enumerate(s.enum_models(), 1):
|
|
104
|
+
for i, model in enumerate(s.enum_models(projection=projection), 1):
|
|
103
105
|
print('v {0} 0'.format(' '.join(['{0}{1}'.format('+' if v > 0 else '', v) for v in model])))
|
|
104
106
|
|
|
105
107
|
computed = i
|
|
@@ -123,9 +125,10 @@ def parse_options():
|
|
|
123
125
|
|
|
124
126
|
try:
|
|
125
127
|
opts, args = getopt.getopt(sys.argv[1:],
|
|
126
|
-
'e:
|
|
128
|
+
'e:hp:s:w',
|
|
127
129
|
['enum=',
|
|
128
130
|
'help',
|
|
131
|
+
'project=',
|
|
129
132
|
'solver=',
|
|
130
133
|
'warm'])
|
|
131
134
|
except getopt.GetoptError as err:
|
|
@@ -136,6 +139,7 @@ def parse_options():
|
|
|
136
139
|
to_enum = 1
|
|
137
140
|
solver = 'g3'
|
|
138
141
|
warm = False
|
|
142
|
+
projection = []
|
|
139
143
|
|
|
140
144
|
for opt, arg in opts:
|
|
141
145
|
if opt in ('-e', '--enum'):
|
|
@@ -147,6 +151,8 @@ def parse_options():
|
|
|
147
151
|
elif opt in ('-h', '--help'):
|
|
148
152
|
usage()
|
|
149
153
|
sys.exit(0)
|
|
154
|
+
elif opt in ('-p', '--project'):
|
|
155
|
+
projection = [int(v) for v in arg.split(',')] if arg else []
|
|
150
156
|
elif opt in ('-s', '--solver'):
|
|
151
157
|
solver = str(arg)
|
|
152
158
|
elif opt in ('-w', '--warm'):
|
|
@@ -154,7 +160,7 @@ def parse_options():
|
|
|
154
160
|
else:
|
|
155
161
|
assert False, 'Unhandled option: {0} {1}'.format(opt, arg)
|
|
156
162
|
|
|
157
|
-
return to_enum, solver, warm, args
|
|
163
|
+
return to_enum, solver, warm, projection, args
|
|
158
164
|
|
|
159
165
|
|
|
160
166
|
#
|
|
@@ -169,6 +175,7 @@ def usage():
|
|
|
169
175
|
print(' -e, --enum=<int> Compute at most this number of models')
|
|
170
176
|
print(' Available values: [1 .. INT_MAX], all (default: 1)')
|
|
171
177
|
print(' -h, --help Show this message')
|
|
178
|
+
print(' -p, --project=<csv> Restrict models to these variables only (given as comma-separated integers)')
|
|
172
179
|
print(' -s, --solver=<string> SAT solver to use')
|
|
173
180
|
print(' Available values: cd, g3, g4, lgl, mcb, mcm, mpl, m22, mc, mgh (default = g3)')
|
|
174
181
|
print(' -w, --warm Use solver\'s warm start mode')
|
|
@@ -178,7 +185,7 @@ def usage():
|
|
|
178
185
|
#==============================================================================
|
|
179
186
|
if __name__ == '__main__':
|
|
180
187
|
# parsing command-line options
|
|
181
|
-
to_enum, solver, warm, files = parse_options()
|
|
188
|
+
to_enum, solver, warm, projection, files = parse_options()
|
|
182
189
|
|
|
183
190
|
# reading an input formula either from a file or from stdin
|
|
184
191
|
if files:
|
|
@@ -186,4 +193,4 @@ if __name__ == '__main__':
|
|
|
186
193
|
else:
|
|
187
194
|
formula = CNFPlus(from_fp=sys.stdin)
|
|
188
195
|
|
|
189
|
-
enumerate_models(formula, to_enum, solver, warm)
|
|
196
|
+
enumerate_models(formula, to_enum, solver, warm, projection)
|
pysat/solvers.py
CHANGED
|
@@ -1591,7 +1591,7 @@ class Solver(object):
|
|
|
1591
1591
|
if self.solver:
|
|
1592
1592
|
return self.solver.nof_clauses()
|
|
1593
1593
|
|
|
1594
|
-
def enum_models(self, assumptions=[]):
|
|
1594
|
+
def enum_models(self, assumptions=[], projection=[]):
|
|
1595
1595
|
"""
|
|
1596
1596
|
This method can be used to enumerate models of a CNF formula and
|
|
1597
1597
|
it performs as a standard Python iterator. The method can be
|
|
@@ -1612,8 +1612,18 @@ class Solver(object):
|
|
|
1612
1612
|
*blocks* each previously computed model by adding a new
|
|
1613
1613
|
clause until no more models of the formula exist.
|
|
1614
1614
|
|
|
1615
|
+
.. note::
|
|
1616
|
+
|
|
1617
|
+
If a non-empty ``projection`` is given, all computed models
|
|
1618
|
+
will be projected on the given set of variables. Integers
|
|
1619
|
+
included in the list ``projection`` are to be positive,
|
|
1620
|
+
distinct, and no larger than the largest variable ID known to
|
|
1621
|
+
the solver.
|
|
1622
|
+
|
|
1615
1623
|
:param assumptions: a list of assumption literals.
|
|
1624
|
+
:param projection: optional iterable of distinct variable IDs.
|
|
1616
1625
|
:type assumptions: iterable(int)
|
|
1626
|
+
:type projection: iterable(int)
|
|
1617
1627
|
|
|
1618
1628
|
:rtype: list(int).
|
|
1619
1629
|
|
|
@@ -1636,7 +1646,7 @@ class Solver(object):
|
|
|
1636
1646
|
"""
|
|
1637
1647
|
|
|
1638
1648
|
if self.solver:
|
|
1639
|
-
return self.solver.enum_models(assumptions)
|
|
1649
|
+
return self.solver.enum_models(assumptions, projection)
|
|
1640
1650
|
|
|
1641
1651
|
def add_clause(self, clause, no_return=True):
|
|
1642
1652
|
"""
|
|
@@ -1850,7 +1860,42 @@ class Solver(object):
|
|
|
1850
1860
|
|
|
1851
1861
|
#
|
|
1852
1862
|
#==============================================================================
|
|
1853
|
-
class
|
|
1863
|
+
class _SolverBackend(object):
|
|
1864
|
+
"""
|
|
1865
|
+
Functionality shared by all the solver backends below.
|
|
1866
|
+
"""
|
|
1867
|
+
|
|
1868
|
+
def enum_models(self, assumptions=[], projection=[]):
|
|
1869
|
+
"""
|
|
1870
|
+
Iterate over models of the internal formula, optionally projected
|
|
1871
|
+
onto the given variables. See :meth:`Solver.enum_models`.
|
|
1872
|
+
"""
|
|
1873
|
+
|
|
1874
|
+
assumptions = list(assumptions)
|
|
1875
|
+
projection = list(projection)
|
|
1876
|
+
|
|
1877
|
+
if projection:
|
|
1878
|
+
if any(v <= 0 for v in projection) or len(set(projection)) != len(projection):
|
|
1879
|
+
raise ValueError('Projection must contain distinct positive variable IDs.')
|
|
1880
|
+
|
|
1881
|
+
largest = max(projection)
|
|
1882
|
+
|
|
1883
|
+
while self.solve(assumptions=assumptions):
|
|
1884
|
+
model = self.get_model()
|
|
1885
|
+
|
|
1886
|
+
if projection:
|
|
1887
|
+
if largest > len(model):
|
|
1888
|
+
raise ValueError('Projection contains a variable outside the model.')
|
|
1889
|
+
|
|
1890
|
+
model = [model[v - 1] for v in projection]
|
|
1891
|
+
|
|
1892
|
+
self.add_clause([-l for l in model]) # blocking model
|
|
1893
|
+
yield model
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
#
|
|
1897
|
+
#==============================================================================
|
|
1898
|
+
class Cadical103(_SolverBackend):
|
|
1854
1899
|
"""
|
|
1855
1900
|
CaDiCaL 1.0.3 SAT solver.
|
|
1856
1901
|
"""
|
|
@@ -2108,23 +2153,6 @@ class Cadical103(object):
|
|
|
2108
2153
|
if self.cadical:
|
|
2109
2154
|
return pysolvers.cadical103_acc_stats(self.cadical)
|
|
2110
2155
|
|
|
2111
|
-
def enum_models(self, assumptions=[]):
|
|
2112
|
-
"""
|
|
2113
|
-
Iterate over models of the internal formula.
|
|
2114
|
-
"""
|
|
2115
|
-
|
|
2116
|
-
if self.cadical:
|
|
2117
|
-
done = False
|
|
2118
|
-
while not done:
|
|
2119
|
-
self.status = self.solve(assumptions=assumptions)
|
|
2120
|
-
model = self.get_model()
|
|
2121
|
-
|
|
2122
|
-
if model is not None:
|
|
2123
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
2124
|
-
yield model
|
|
2125
|
-
else:
|
|
2126
|
-
done = True
|
|
2127
|
-
|
|
2128
2156
|
def add_clause(self, clause, no_return=True):
|
|
2129
2157
|
"""
|
|
2130
2158
|
Add a new clause to solver's internal formula.
|
|
@@ -2184,7 +2212,7 @@ class Cadical103(object):
|
|
|
2184
2212
|
|
|
2185
2213
|
#
|
|
2186
2214
|
#==============================================================================
|
|
2187
|
-
class Cadical153(
|
|
2215
|
+
class Cadical153(_SolverBackend):
|
|
2188
2216
|
"""
|
|
2189
2217
|
CaDiCaL 1.5.3 SAT solver.
|
|
2190
2218
|
"""
|
|
@@ -2506,23 +2534,6 @@ class Cadical153(object):
|
|
|
2506
2534
|
if self.cadical:
|
|
2507
2535
|
return pysolvers.cadical153_acc_stats(self.cadical)
|
|
2508
2536
|
|
|
2509
|
-
def enum_models(self, assumptions=[]):
|
|
2510
|
-
"""
|
|
2511
|
-
Iterate over models of the internal formula.
|
|
2512
|
-
"""
|
|
2513
|
-
|
|
2514
|
-
if self.cadical:
|
|
2515
|
-
done = False
|
|
2516
|
-
while not done:
|
|
2517
|
-
self.status = self.solve(assumptions=assumptions)
|
|
2518
|
-
model = self.get_model()
|
|
2519
|
-
|
|
2520
|
-
if model is not None:
|
|
2521
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
2522
|
-
yield model
|
|
2523
|
-
else:
|
|
2524
|
-
done = True
|
|
2525
|
-
|
|
2526
2537
|
def add_clause(self, clause, no_return=True):
|
|
2527
2538
|
"""
|
|
2528
2539
|
Add a new clause to solver's internal formula.
|
|
@@ -2582,7 +2593,7 @@ class Cadical153(object):
|
|
|
2582
2593
|
|
|
2583
2594
|
#
|
|
2584
2595
|
#==============================================================================
|
|
2585
|
-
class Cadical195(
|
|
2596
|
+
class Cadical195(_SolverBackend):
|
|
2586
2597
|
"""
|
|
2587
2598
|
CaDiCaL 1.9.5 SAT solver.
|
|
2588
2599
|
"""
|
|
@@ -2942,23 +2953,6 @@ class Cadical195(object):
|
|
|
2942
2953
|
if self.cadical:
|
|
2943
2954
|
return pysolvers.cadical195_acc_stats(self.cadical)
|
|
2944
2955
|
|
|
2945
|
-
def enum_models(self, assumptions=[]):
|
|
2946
|
-
"""
|
|
2947
|
-
Iterate over models of the internal formula.
|
|
2948
|
-
"""
|
|
2949
|
-
|
|
2950
|
-
if self.cadical:
|
|
2951
|
-
done = False
|
|
2952
|
-
while not done:
|
|
2953
|
-
self.status = self.solve(assumptions=assumptions)
|
|
2954
|
-
model = self.get_model()
|
|
2955
|
-
|
|
2956
|
-
if model is not None:
|
|
2957
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
2958
|
-
yield model
|
|
2959
|
-
else:
|
|
2960
|
-
done = True
|
|
2961
|
-
|
|
2962
2956
|
def add_clause(self, clause, no_return=True):
|
|
2963
2957
|
"""
|
|
2964
2958
|
Add a new clause to solver's internal formula.
|
|
@@ -3106,7 +3100,7 @@ class Cadical195(object):
|
|
|
3106
3100
|
|
|
3107
3101
|
#
|
|
3108
3102
|
#==============================================================================
|
|
3109
|
-
class Cadical300(
|
|
3103
|
+
class Cadical300(_SolverBackend):
|
|
3110
3104
|
"""
|
|
3111
3105
|
CaDiCaL 3.0.0 SAT solver.
|
|
3112
3106
|
"""
|
|
@@ -3566,23 +3560,6 @@ class Cadical300(object):
|
|
|
3566
3560
|
if self.cadical:
|
|
3567
3561
|
return pysolvers.cadical300_acc_stats(self.cadical)
|
|
3568
3562
|
|
|
3569
|
-
def enum_models(self, assumptions=[]):
|
|
3570
|
-
"""
|
|
3571
|
-
Iterate over models of the internal formula.
|
|
3572
|
-
"""
|
|
3573
|
-
|
|
3574
|
-
if self.cadical:
|
|
3575
|
-
done = False
|
|
3576
|
-
while not done:
|
|
3577
|
-
self.status = self.solve(assumptions=assumptions)
|
|
3578
|
-
model = self.get_model()
|
|
3579
|
-
|
|
3580
|
-
if model is not None:
|
|
3581
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
3582
|
-
yield model
|
|
3583
|
-
else:
|
|
3584
|
-
done = True
|
|
3585
|
-
|
|
3586
3563
|
def add_clause(self, clause, no_return=True):
|
|
3587
3564
|
"""
|
|
3588
3565
|
Add a new clause to solver's internal formula.
|
|
@@ -3730,7 +3707,7 @@ class Cadical300(object):
|
|
|
3730
3707
|
|
|
3731
3708
|
#
|
|
3732
3709
|
#==============================================================================
|
|
3733
|
-
class Ergo(
|
|
3710
|
+
class Ergo(_SolverBackend):
|
|
3734
3711
|
"""
|
|
3735
3712
|
Ergo SAT solver.
|
|
3736
3713
|
"""
|
|
@@ -4159,23 +4136,6 @@ class Ergo(object):
|
|
|
4159
4136
|
if self.ergo:
|
|
4160
4137
|
return pysolvers.ergo_acc_stats(self.ergo)
|
|
4161
4138
|
|
|
4162
|
-
def enum_models(self, assumptions=[]):
|
|
4163
|
-
"""
|
|
4164
|
-
Iterate over models of the internal formula.
|
|
4165
|
-
"""
|
|
4166
|
-
|
|
4167
|
-
if self.ergo:
|
|
4168
|
-
done = False
|
|
4169
|
-
while not done:
|
|
4170
|
-
self.status = self.solve(assumptions=assumptions)
|
|
4171
|
-
model = self.get_model()
|
|
4172
|
-
|
|
4173
|
-
if model is not None:
|
|
4174
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
4175
|
-
yield model
|
|
4176
|
-
else:
|
|
4177
|
-
done = True
|
|
4178
|
-
|
|
4179
4139
|
def add_clause(self, clause, no_return=True):
|
|
4180
4140
|
"""
|
|
4181
4141
|
Add a new clause to solver's internal formula.
|
|
@@ -4346,7 +4306,7 @@ class Ergo(object):
|
|
|
4346
4306
|
|
|
4347
4307
|
#
|
|
4348
4308
|
#==============================================================================
|
|
4349
|
-
class Gluecard3(
|
|
4309
|
+
class Gluecard3(_SolverBackend):
|
|
4350
4310
|
"""
|
|
4351
4311
|
Gluecard 3 SAT solver.
|
|
4352
4312
|
"""
|
|
@@ -4637,23 +4597,6 @@ class Gluecard3(object):
|
|
|
4637
4597
|
if self.gluecard:
|
|
4638
4598
|
return pysolvers.gluecard3_acc_stats(self.gluecard)
|
|
4639
4599
|
|
|
4640
|
-
def enum_models(self, assumptions=[]):
|
|
4641
|
-
"""
|
|
4642
|
-
Iterate over models of the internal formula.
|
|
4643
|
-
"""
|
|
4644
|
-
|
|
4645
|
-
if self.gluecard:
|
|
4646
|
-
done = False
|
|
4647
|
-
while not done:
|
|
4648
|
-
self.status = self.solve(assumptions=assumptions)
|
|
4649
|
-
model = self.get_model()
|
|
4650
|
-
|
|
4651
|
-
if model is not None:
|
|
4652
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
4653
|
-
yield model
|
|
4654
|
-
else:
|
|
4655
|
-
done = True
|
|
4656
|
-
|
|
4657
4600
|
def add_clause(self, clause, no_return=True):
|
|
4658
4601
|
"""
|
|
4659
4602
|
Add a new clause to solver's internal formula.
|
|
@@ -4725,7 +4668,7 @@ class Gluecard3(object):
|
|
|
4725
4668
|
|
|
4726
4669
|
#
|
|
4727
4670
|
#==============================================================================
|
|
4728
|
-
class Gluecard4(
|
|
4671
|
+
class Gluecard4(_SolverBackend):
|
|
4729
4672
|
"""
|
|
4730
4673
|
Gluecard 4 SAT solver.
|
|
4731
4674
|
"""
|
|
@@ -5016,23 +4959,6 @@ class Gluecard4(object):
|
|
|
5016
4959
|
if self.gluecard:
|
|
5017
4960
|
return pysolvers.gluecard41_acc_stats(self.gluecard)
|
|
5018
4961
|
|
|
5019
|
-
def enum_models(self, assumptions=[]):
|
|
5020
|
-
"""
|
|
5021
|
-
Iterate over models of the internal formula.
|
|
5022
|
-
"""
|
|
5023
|
-
|
|
5024
|
-
if self.gluecard:
|
|
5025
|
-
done = False
|
|
5026
|
-
while not done:
|
|
5027
|
-
self.status = self.solve(assumptions=assumptions)
|
|
5028
|
-
model = self.get_model()
|
|
5029
|
-
|
|
5030
|
-
if model is not None:
|
|
5031
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
5032
|
-
yield model
|
|
5033
|
-
else:
|
|
5034
|
-
done = True
|
|
5035
|
-
|
|
5036
4962
|
def add_clause(self, clause, no_return=True):
|
|
5037
4963
|
"""
|
|
5038
4964
|
Add a new clause to solver's internal formula.
|
|
@@ -5104,7 +5030,7 @@ class Gluecard4(object):
|
|
|
5104
5030
|
|
|
5105
5031
|
#
|
|
5106
5032
|
#==============================================================================
|
|
5107
|
-
class Glucose3(
|
|
5033
|
+
class Glucose3(_SolverBackend):
|
|
5108
5034
|
"""
|
|
5109
5035
|
Glucose 3 SAT solver.
|
|
5110
5036
|
"""
|
|
@@ -5393,23 +5319,6 @@ class Glucose3(object):
|
|
|
5393
5319
|
if self.glucose:
|
|
5394
5320
|
return pysolvers.glucose3_acc_stats(self.glucose)
|
|
5395
5321
|
|
|
5396
|
-
def enum_models(self, assumptions=[]):
|
|
5397
|
-
"""
|
|
5398
|
-
Iterate over models of the internal formula.
|
|
5399
|
-
"""
|
|
5400
|
-
|
|
5401
|
-
if self.glucose:
|
|
5402
|
-
done = False
|
|
5403
|
-
while not done:
|
|
5404
|
-
self.status = self.solve(assumptions=assumptions)
|
|
5405
|
-
model = self.get_model()
|
|
5406
|
-
|
|
5407
|
-
if model is not None:
|
|
5408
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
5409
|
-
yield model
|
|
5410
|
-
else:
|
|
5411
|
-
done = True
|
|
5412
|
-
|
|
5413
5322
|
def add_clause(self, clause, no_return=True):
|
|
5414
5323
|
"""
|
|
5415
5324
|
Add a new clause to solver's internal formula.
|
|
@@ -5469,7 +5378,7 @@ class Glucose3(object):
|
|
|
5469
5378
|
|
|
5470
5379
|
#
|
|
5471
5380
|
#==============================================================================
|
|
5472
|
-
class Glucose4(
|
|
5381
|
+
class Glucose4(_SolverBackend):
|
|
5473
5382
|
"""
|
|
5474
5383
|
Glucose 4.1 SAT solver.
|
|
5475
5384
|
"""
|
|
@@ -5758,23 +5667,6 @@ class Glucose4(object):
|
|
|
5758
5667
|
if self.glucose:
|
|
5759
5668
|
return pysolvers.glucose41_acc_stats(self.glucose)
|
|
5760
5669
|
|
|
5761
|
-
def enum_models(self, assumptions=[]):
|
|
5762
|
-
"""
|
|
5763
|
-
Iterate over models of the internal formula.
|
|
5764
|
-
"""
|
|
5765
|
-
|
|
5766
|
-
if self.glucose:
|
|
5767
|
-
done = False
|
|
5768
|
-
while not done:
|
|
5769
|
-
self.status = self.solve(assumptions=assumptions)
|
|
5770
|
-
model = self.get_model()
|
|
5771
|
-
|
|
5772
|
-
if model is not None:
|
|
5773
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
5774
|
-
yield model
|
|
5775
|
-
else:
|
|
5776
|
-
done = True
|
|
5777
|
-
|
|
5778
5670
|
def add_clause(self, clause, no_return=True):
|
|
5779
5671
|
"""
|
|
5780
5672
|
Add a new clause to solver's internal formula.
|
|
@@ -5834,7 +5726,7 @@ class Glucose4(object):
|
|
|
5834
5726
|
|
|
5835
5727
|
#
|
|
5836
5728
|
#==============================================================================
|
|
5837
|
-
class Glucose42(
|
|
5729
|
+
class Glucose42(_SolverBackend):
|
|
5838
5730
|
"""
|
|
5839
5731
|
Glucose 4.2.1 SAT solver.
|
|
5840
5732
|
"""
|
|
@@ -6211,23 +6103,6 @@ class Glucose42(object):
|
|
|
6211
6103
|
if self.glucose:
|
|
6212
6104
|
return pysolvers.glucose421_acc_stats(self.glucose)
|
|
6213
6105
|
|
|
6214
|
-
def enum_models(self, assumptions=[]):
|
|
6215
|
-
"""
|
|
6216
|
-
Iterate over models of the internal formula.
|
|
6217
|
-
"""
|
|
6218
|
-
|
|
6219
|
-
if self.glucose:
|
|
6220
|
-
done = False
|
|
6221
|
-
while not done:
|
|
6222
|
-
self.status = self.solve(assumptions=assumptions)
|
|
6223
|
-
model = self.get_model()
|
|
6224
|
-
|
|
6225
|
-
if model is not None:
|
|
6226
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
6227
|
-
yield model
|
|
6228
|
-
else:
|
|
6229
|
-
done = True
|
|
6230
|
-
|
|
6231
6106
|
def add_clause(self, clause, no_return=True):
|
|
6232
6107
|
"""
|
|
6233
6108
|
Add a new clause to solver's internal formula.
|
|
@@ -6288,7 +6163,7 @@ class Glucose42(object):
|
|
|
6288
6163
|
|
|
6289
6164
|
#
|
|
6290
6165
|
#==============================================================================
|
|
6291
|
-
class Lingeling(
|
|
6166
|
+
class Lingeling(_SolverBackend):
|
|
6292
6167
|
"""
|
|
6293
6168
|
Lingeling SAT solver.
|
|
6294
6169
|
"""
|
|
@@ -6529,23 +6404,6 @@ class Lingeling(object):
|
|
|
6529
6404
|
if self.lingeling:
|
|
6530
6405
|
return pysolvers.lingeling_acc_stats(self.lingeling)
|
|
6531
6406
|
|
|
6532
|
-
def enum_models(self, assumptions=[]):
|
|
6533
|
-
"""
|
|
6534
|
-
Iterate over models of the internal formula.
|
|
6535
|
-
"""
|
|
6536
|
-
|
|
6537
|
-
if self.lingeling:
|
|
6538
|
-
done = False
|
|
6539
|
-
while not done:
|
|
6540
|
-
self.status = self.solve(assumptions=assumptions)
|
|
6541
|
-
model = self.get_model()
|
|
6542
|
-
|
|
6543
|
-
if model is not None:
|
|
6544
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
6545
|
-
yield model
|
|
6546
|
-
else:
|
|
6547
|
-
done = True
|
|
6548
|
-
|
|
6549
6407
|
def add_clause(self, clause, no_return=True):
|
|
6550
6408
|
"""
|
|
6551
6409
|
Add a new clause to solver's internal formula.
|
|
@@ -6591,7 +6449,7 @@ class Lingeling(object):
|
|
|
6591
6449
|
|
|
6592
6450
|
#
|
|
6593
6451
|
#==============================================================================
|
|
6594
|
-
class MapleChrono(
|
|
6452
|
+
class MapleChrono(_SolverBackend):
|
|
6595
6453
|
"""
|
|
6596
6454
|
MapleLCMDistChronoBT SAT solver.
|
|
6597
6455
|
"""
|
|
@@ -6857,23 +6715,6 @@ class MapleChrono(object):
|
|
|
6857
6715
|
if self.maplesat:
|
|
6858
6716
|
return pysolvers.maplechrono_acc_stats(self.maplesat)
|
|
6859
6717
|
|
|
6860
|
-
def enum_models(self, assumptions=[]):
|
|
6861
|
-
"""
|
|
6862
|
-
Iterate over models of the internal formula.
|
|
6863
|
-
"""
|
|
6864
|
-
|
|
6865
|
-
if self.maplesat:
|
|
6866
|
-
done = False
|
|
6867
|
-
while not done:
|
|
6868
|
-
self.status = self.solve(assumptions=assumptions)
|
|
6869
|
-
model = self.get_model()
|
|
6870
|
-
|
|
6871
|
-
if model is not None:
|
|
6872
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
6873
|
-
yield model
|
|
6874
|
-
else:
|
|
6875
|
-
done = True
|
|
6876
|
-
|
|
6877
6718
|
def add_clause(self, clause, no_return=True):
|
|
6878
6719
|
"""
|
|
6879
6720
|
Add a new clause to solver's internal formula.
|
|
@@ -6933,7 +6774,7 @@ class MapleChrono(object):
|
|
|
6933
6774
|
|
|
6934
6775
|
#
|
|
6935
6776
|
#==============================================================================
|
|
6936
|
-
class MapleCM(
|
|
6777
|
+
class MapleCM(_SolverBackend):
|
|
6937
6778
|
"""
|
|
6938
6779
|
MapleCM SAT solver.
|
|
6939
6780
|
"""
|
|
@@ -7201,23 +7042,6 @@ class MapleCM(object):
|
|
|
7201
7042
|
if self.maplesat:
|
|
7202
7043
|
return pysolvers.maplecm_acc_stats(self.maplesat)
|
|
7203
7044
|
|
|
7204
|
-
def enum_models(self, assumptions=[]):
|
|
7205
|
-
"""
|
|
7206
|
-
Iterate over models of the internal formula.
|
|
7207
|
-
"""
|
|
7208
|
-
|
|
7209
|
-
if self.maplesat:
|
|
7210
|
-
done = False
|
|
7211
|
-
while not done:
|
|
7212
|
-
self.status = self.solve(assumptions=assumptions)
|
|
7213
|
-
model = self.get_model()
|
|
7214
|
-
|
|
7215
|
-
if model is not None:
|
|
7216
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
7217
|
-
yield model
|
|
7218
|
-
else:
|
|
7219
|
-
done = True
|
|
7220
|
-
|
|
7221
7045
|
def add_clause(self, clause, no_return=True):
|
|
7222
7046
|
"""
|
|
7223
7047
|
Add a new clause to solver's internal formula.
|
|
@@ -7277,7 +7101,7 @@ class MapleCM(object):
|
|
|
7277
7101
|
|
|
7278
7102
|
#
|
|
7279
7103
|
#==============================================================================
|
|
7280
|
-
class Maplesat(
|
|
7104
|
+
class Maplesat(_SolverBackend):
|
|
7281
7105
|
"""
|
|
7282
7106
|
MapleCOMSPS_LRB SAT solver.
|
|
7283
7107
|
"""
|
|
@@ -7545,23 +7369,6 @@ class Maplesat(object):
|
|
|
7545
7369
|
if self.maplesat:
|
|
7546
7370
|
return pysolvers.maplesat_acc_stats(self.maplesat)
|
|
7547
7371
|
|
|
7548
|
-
def enum_models(self, assumptions=[]):
|
|
7549
|
-
"""
|
|
7550
|
-
Iterate over models of the internal formula.
|
|
7551
|
-
"""
|
|
7552
|
-
|
|
7553
|
-
if self.maplesat:
|
|
7554
|
-
done = False
|
|
7555
|
-
while not done:
|
|
7556
|
-
self.status = self.solve(assumptions=assumptions)
|
|
7557
|
-
model = self.get_model()
|
|
7558
|
-
|
|
7559
|
-
if model is not None:
|
|
7560
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
7561
|
-
yield model
|
|
7562
|
-
else:
|
|
7563
|
-
done = True
|
|
7564
|
-
|
|
7565
7372
|
def add_clause(self, clause, no_return=True):
|
|
7566
7373
|
"""
|
|
7567
7374
|
Add a new clause to solver's internal formula.
|
|
@@ -7621,7 +7428,7 @@ class Maplesat(object):
|
|
|
7621
7428
|
|
|
7622
7429
|
#
|
|
7623
7430
|
#==============================================================================
|
|
7624
|
-
class Mergesat3(
|
|
7431
|
+
class Mergesat3(_SolverBackend):
|
|
7625
7432
|
"""
|
|
7626
7433
|
MergeSat 3 SAT solver.
|
|
7627
7434
|
"""
|
|
@@ -7868,23 +7675,6 @@ class Mergesat3(object):
|
|
|
7868
7675
|
if self.mergesat:
|
|
7869
7676
|
return pysolvers.mergesat3_acc_stats(self.mergesat)
|
|
7870
7677
|
|
|
7871
|
-
def enum_models(self, assumptions=[]):
|
|
7872
|
-
"""
|
|
7873
|
-
Iterate over models of the internal formula.
|
|
7874
|
-
"""
|
|
7875
|
-
|
|
7876
|
-
if self.mergesat:
|
|
7877
|
-
done = False
|
|
7878
|
-
while not done:
|
|
7879
|
-
self.status = self.solve(assumptions=assumptions)
|
|
7880
|
-
model = self.get_model()
|
|
7881
|
-
|
|
7882
|
-
if model is not None:
|
|
7883
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
7884
|
-
yield model
|
|
7885
|
-
else:
|
|
7886
|
-
done = True
|
|
7887
|
-
|
|
7888
7678
|
def add_clause(self, clause, no_return=True):
|
|
7889
7679
|
"""
|
|
7890
7680
|
Add a new clause to solver's internal formula.
|
|
@@ -7944,7 +7734,7 @@ class Mergesat3(object):
|
|
|
7944
7734
|
|
|
7945
7735
|
#
|
|
7946
7736
|
#==============================================================================
|
|
7947
|
-
class Minicard(
|
|
7737
|
+
class Minicard(_SolverBackend):
|
|
7948
7738
|
"""
|
|
7949
7739
|
Minicard SAT solver.
|
|
7950
7740
|
"""
|
|
@@ -8223,23 +8013,6 @@ class Minicard(object):
|
|
|
8223
8013
|
if self.minicard:
|
|
8224
8014
|
return pysolvers.minicard_acc_stats(self.minicard)
|
|
8225
8015
|
|
|
8226
|
-
def enum_models(self, assumptions=[]):
|
|
8227
|
-
"""
|
|
8228
|
-
Iterate over models of the internal formula.
|
|
8229
|
-
"""
|
|
8230
|
-
|
|
8231
|
-
if self.minicard:
|
|
8232
|
-
done = False
|
|
8233
|
-
while not done:
|
|
8234
|
-
self.status = self.solve(assumptions=assumptions)
|
|
8235
|
-
model = self.get_model()
|
|
8236
|
-
|
|
8237
|
-
if model is not None:
|
|
8238
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
8239
|
-
yield model
|
|
8240
|
-
else:
|
|
8241
|
-
done = True
|
|
8242
|
-
|
|
8243
8016
|
def add_clause(self, clause, no_return=True):
|
|
8244
8017
|
"""
|
|
8245
8018
|
Add a new clause to solver's internal formula.
|
|
@@ -8311,7 +8084,7 @@ class Minicard(object):
|
|
|
8311
8084
|
|
|
8312
8085
|
#
|
|
8313
8086
|
#==============================================================================
|
|
8314
|
-
class Minisat22(
|
|
8087
|
+
class Minisat22(_SolverBackend):
|
|
8315
8088
|
"""
|
|
8316
8089
|
MiniSat 2.2 SAT solver.
|
|
8317
8090
|
"""
|
|
@@ -8588,23 +8361,6 @@ class Minisat22(object):
|
|
|
8588
8361
|
if self.minisat:
|
|
8589
8362
|
return pysolvers.minisat22_acc_stats(self.minisat)
|
|
8590
8363
|
|
|
8591
|
-
def enum_models(self, assumptions=[]):
|
|
8592
|
-
"""
|
|
8593
|
-
Iterate over models of the internal formula.
|
|
8594
|
-
"""
|
|
8595
|
-
|
|
8596
|
-
if self.minisat:
|
|
8597
|
-
done = False
|
|
8598
|
-
while not done:
|
|
8599
|
-
self.status = self.solve(assumptions=assumptions)
|
|
8600
|
-
model = self.get_model()
|
|
8601
|
-
|
|
8602
|
-
if model is not None:
|
|
8603
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
8604
|
-
yield model
|
|
8605
|
-
else:
|
|
8606
|
-
done = True
|
|
8607
|
-
|
|
8608
8364
|
def add_clause(self, clause, no_return=True):
|
|
8609
8365
|
"""
|
|
8610
8366
|
Add a new clause to solver's internal formula.
|
|
@@ -8664,7 +8420,7 @@ class Minisat22(object):
|
|
|
8664
8420
|
|
|
8665
8421
|
#
|
|
8666
8422
|
#==============================================================================
|
|
8667
|
-
class MinisatGH(
|
|
8423
|
+
class MinisatGH(_SolverBackend):
|
|
8668
8424
|
"""
|
|
8669
8425
|
MiniSat SAT solver (version from github).
|
|
8670
8426
|
"""
|
|
@@ -8941,23 +8697,6 @@ class MinisatGH(object):
|
|
|
8941
8697
|
if self.minisat:
|
|
8942
8698
|
return pysolvers.minisatgh_acc_stats(self.minisat)
|
|
8943
8699
|
|
|
8944
|
-
def enum_models(self, assumptions=[]):
|
|
8945
|
-
"""
|
|
8946
|
-
Iterate over models of the internal formula.
|
|
8947
|
-
"""
|
|
8948
|
-
|
|
8949
|
-
if self.minisat:
|
|
8950
|
-
done = False
|
|
8951
|
-
while not done:
|
|
8952
|
-
self.status = self.solve(assumptions=assumptions)
|
|
8953
|
-
model = self.get_model()
|
|
8954
|
-
|
|
8955
|
-
if model is not None:
|
|
8956
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
8957
|
-
yield model
|
|
8958
|
-
else:
|
|
8959
|
-
done = True
|
|
8960
|
-
|
|
8961
8700
|
def add_clause(self, clause, no_return=True):
|
|
8962
8701
|
"""
|
|
8963
8702
|
Add a new clause to solver's internal formula.
|
|
@@ -9017,7 +8756,7 @@ class MinisatGH(object):
|
|
|
9017
8756
|
|
|
9018
8757
|
#
|
|
9019
8758
|
#==============================================================================
|
|
9020
|
-
class MinisatEP(
|
|
8759
|
+
class MinisatEP(_SolverBackend):
|
|
9021
8760
|
"""
|
|
9022
8761
|
MiniSat SAT solver (with IPASIR-UP support). This class provides
|
|
9023
8762
|
access to the MiniSat 2.2 solver with support for external
|
|
@@ -9339,23 +9078,6 @@ class MinisatEP(object):
|
|
|
9339
9078
|
if self.minisat:
|
|
9340
9079
|
return pysolvers.minisatep_acc_stats(self.minisat)
|
|
9341
9080
|
|
|
9342
|
-
def enum_models(self, assumptions=[]):
|
|
9343
|
-
"""
|
|
9344
|
-
Iterate over models of the internal formula.
|
|
9345
|
-
"""
|
|
9346
|
-
|
|
9347
|
-
if self.minisat:
|
|
9348
|
-
done = False
|
|
9349
|
-
while not done:
|
|
9350
|
-
self.status = self.solve(assumptions=assumptions)
|
|
9351
|
-
model = self.get_model()
|
|
9352
|
-
|
|
9353
|
-
if model is not None:
|
|
9354
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
9355
|
-
yield model
|
|
9356
|
-
else:
|
|
9357
|
-
done = True
|
|
9358
|
-
|
|
9359
9081
|
def add_clause(self, clause, no_return=True):
|
|
9360
9082
|
"""
|
|
9361
9083
|
Add a new clause to solver's internal formula.
|
|
@@ -9511,7 +9233,7 @@ class MinisatEP(object):
|
|
|
9511
9233
|
|
|
9512
9234
|
#
|
|
9513
9235
|
#==============================================================================
|
|
9514
|
-
class CryptoMinisat(
|
|
9236
|
+
class CryptoMinisat(_SolverBackend):
|
|
9515
9237
|
"""
|
|
9516
9238
|
CryptoMinisat solver accessed through ``pycryptosat`` package.
|
|
9517
9239
|
"""
|
|
@@ -9759,23 +9481,6 @@ class CryptoMinisat(object):
|
|
|
9759
9481
|
|
|
9760
9482
|
raise NotImplementedError('Accumulated statistics is not supported by CryptoMinisat.')
|
|
9761
9483
|
|
|
9762
|
-
def enum_models(self, assumptions=[]):
|
|
9763
|
-
"""
|
|
9764
|
-
Iterate over models of the internal formula.
|
|
9765
|
-
"""
|
|
9766
|
-
|
|
9767
|
-
if self.cryptosat:
|
|
9768
|
-
done = False
|
|
9769
|
-
while not done:
|
|
9770
|
-
self.status = self.solve(assumptions=assumptions)
|
|
9771
|
-
model = self.get_model()
|
|
9772
|
-
|
|
9773
|
-
if model is not None:
|
|
9774
|
-
self.add_clause([-l for l in model]) # blocking model
|
|
9775
|
-
yield model
|
|
9776
|
-
else:
|
|
9777
|
-
done = True
|
|
9778
|
-
|
|
9779
9484
|
def add_clause(self, clause, dummy_no_return=True):
|
|
9780
9485
|
"""
|
|
9781
9486
|
Add a new clause to solver's internal formula.
|
|
@@ -9824,7 +9529,7 @@ class CryptoMinisat(object):
|
|
|
9824
9529
|
|
|
9825
9530
|
#
|
|
9826
9531
|
#==============================================================================
|
|
9827
|
-
class Kissat404(
|
|
9532
|
+
class Kissat404(_SolverBackend):
|
|
9828
9533
|
"""
|
|
9829
9534
|
Kissat 4.0.4 SAT solver.
|
|
9830
9535
|
|
|
@@ -10114,7 +9819,7 @@ class Kissat404(object):
|
|
|
10114
9819
|
|
|
10115
9820
|
raise NotImplementedError('Statistics are not exposed by Kissat in PySAT.')
|
|
10116
9821
|
|
|
10117
|
-
def enum_models(self, assumptions=[]):
|
|
9822
|
+
def enum_models(self, assumptions=[], projection=[]):
|
|
10118
9823
|
"""
|
|
10119
9824
|
Iterate over models of the internal formula.
|
|
10120
9825
|
|
pysolvers.cp315-win_amd64.pyd
CHANGED
|
Binary file
|
|
@@ -66,7 +66,7 @@ import sys
|
|
|
66
66
|
|
|
67
67
|
#
|
|
68
68
|
#==============================================================================
|
|
69
|
-
def enumerate_models(formula, to_enum, solver, warm=False):
|
|
69
|
+
def enumerate_models(formula, to_enum, solver, warm=False, projection=[]):
|
|
70
70
|
"""
|
|
71
71
|
Enumeration procedure. It represents a loop iterating over satisfying
|
|
72
72
|
assignment for a given formula until either all or a given number of
|
|
@@ -76,11 +76,13 @@ def enumerate_models(formula, to_enum, solver, warm=False):
|
|
|
76
76
|
:param to_enum: number of models to compute
|
|
77
77
|
:param solver: name of SAT solver
|
|
78
78
|
:param warm: warm start flag
|
|
79
|
+
:param projection: optional variable IDs to enumerate
|
|
79
80
|
|
|
80
81
|
:type formula: :class:`.CNFPlus`
|
|
81
82
|
:type to_enum: int or 'all'
|
|
82
83
|
:type solver: str
|
|
83
84
|
:type warm: bool
|
|
85
|
+
:type projection: list(int)
|
|
84
86
|
"""
|
|
85
87
|
|
|
86
88
|
with Solver(name=solver, bootstrap_with=formula.clauses,
|
|
@@ -99,7 +101,7 @@ def enumerate_models(formula, to_enum, solver, warm=False):
|
|
|
99
101
|
|
|
100
102
|
# model enumeration and printing is done here
|
|
101
103
|
computed = 0
|
|
102
|
-
for i, model in enumerate(s.enum_models(), 1):
|
|
104
|
+
for i, model in enumerate(s.enum_models(projection=projection), 1):
|
|
103
105
|
print('v {0} 0'.format(' '.join(['{0}{1}'.format('+' if v > 0 else '', v) for v in model])))
|
|
104
106
|
|
|
105
107
|
computed = i
|
|
@@ -123,9 +125,10 @@ def parse_options():
|
|
|
123
125
|
|
|
124
126
|
try:
|
|
125
127
|
opts, args = getopt.getopt(sys.argv[1:],
|
|
126
|
-
'e:
|
|
128
|
+
'e:hp:s:w',
|
|
127
129
|
['enum=',
|
|
128
130
|
'help',
|
|
131
|
+
'project=',
|
|
129
132
|
'solver=',
|
|
130
133
|
'warm'])
|
|
131
134
|
except getopt.GetoptError as err:
|
|
@@ -136,6 +139,7 @@ def parse_options():
|
|
|
136
139
|
to_enum = 1
|
|
137
140
|
solver = 'g3'
|
|
138
141
|
warm = False
|
|
142
|
+
projection = []
|
|
139
143
|
|
|
140
144
|
for opt, arg in opts:
|
|
141
145
|
if opt in ('-e', '--enum'):
|
|
@@ -147,6 +151,8 @@ def parse_options():
|
|
|
147
151
|
elif opt in ('-h', '--help'):
|
|
148
152
|
usage()
|
|
149
153
|
sys.exit(0)
|
|
154
|
+
elif opt in ('-p', '--project'):
|
|
155
|
+
projection = [int(v) for v in arg.split(',')] if arg else []
|
|
150
156
|
elif opt in ('-s', '--solver'):
|
|
151
157
|
solver = str(arg)
|
|
152
158
|
elif opt in ('-w', '--warm'):
|
|
@@ -154,7 +160,7 @@ def parse_options():
|
|
|
154
160
|
else:
|
|
155
161
|
assert False, 'Unhandled option: {0} {1}'.format(opt, arg)
|
|
156
162
|
|
|
157
|
-
return to_enum, solver, warm, args
|
|
163
|
+
return to_enum, solver, warm, projection, args
|
|
158
164
|
|
|
159
165
|
|
|
160
166
|
#
|
|
@@ -169,6 +175,7 @@ def usage():
|
|
|
169
175
|
print(' -e, --enum=<int> Compute at most this number of models')
|
|
170
176
|
print(' Available values: [1 .. INT_MAX], all (default: 1)')
|
|
171
177
|
print(' -h, --help Show this message')
|
|
178
|
+
print(' -p, --project=<csv> Restrict models to these variables only (given as comma-separated integers)')
|
|
172
179
|
print(' -s, --solver=<string> SAT solver to use')
|
|
173
180
|
print(' Available values: cd, g3, g4, lgl, mcb, mcm, mpl, m22, mc, mgh (default = g3)')
|
|
174
181
|
print(' -w, --warm Use solver\'s warm start mode')
|
|
@@ -178,7 +185,7 @@ def usage():
|
|
|
178
185
|
#==============================================================================
|
|
179
186
|
if __name__ == '__main__':
|
|
180
187
|
# parsing command-line options
|
|
181
|
-
to_enum, solver, warm, files = parse_options()
|
|
188
|
+
to_enum, solver, warm, projection, files = parse_options()
|
|
182
189
|
|
|
183
190
|
# reading an input formula either from a file or from stdin
|
|
184
191
|
if files:
|
|
@@ -186,4 +193,4 @@ if __name__ == '__main__':
|
|
|
186
193
|
else:
|
|
187
194
|
formula = CNFPlus(from_fp=sys.stdin)
|
|
188
195
|
|
|
189
|
-
enumerate_models(formula, to_enum, solver, warm)
|
|
196
|
+
enumerate_models(formula, to_enum, solver, warm, projection)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Version: 1.13.2
|
|
2
|
+
Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-213qap_b\\cp315-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-213qap_b\\cp315-win_amd64\\repaired_wheel', '-v', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-213qap_b\\cp315-win_amd64\\built_wheel\\python_sat-1.9.dev24-cp315-cp315-win_amd64.whl']
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
pycard.cp315-win_amd64.pyd,sha256=
|
|
2
|
-
pyformula.cp315-win_amd64.pyd,sha256=
|
|
3
|
-
pysolvers.cp315-win_amd64.pyd,sha256=
|
|
1
|
+
pycard.cp315-win_amd64.pyd,sha256=HBnQvt_x779UE1wY122dhrfqH1pQJAkQfGDZNOxPvMI,77312
|
|
2
|
+
pyformula.cp315-win_amd64.pyd,sha256=1zowGdlZwN4_wsbn2dzYwVMRA7WMfeVYnFCRnzvT_9c,33792
|
|
3
|
+
pysolvers.cp315-win_amd64.pyd,sha256=mVXf4ADhizuZpPF6rtZT1smNy-Hwg2ELuEoqFZWkReM,3689472
|
|
4
4
|
pysat/card.py,sha256=JufbOKVdVrxABb3oKci3869eQytso58gLTqISac4H58,39252
|
|
5
5
|
pysat/engines.py,sha256=G3hAOFuqc_GGf8ow5gKRLvNh48jiLInnQtIZSRwYuhs,48202
|
|
6
6
|
pysat/formula.py,sha256=GCTvBA9TI7Q2klIaa6R1Suz2IwilNK4-31o8ADLXJaE,221485
|
|
7
7
|
pysat/integer.py,sha256=McihZOmelBRKfw6Ng0A86_D_vLbXSvxla05tVWNyowk,99859
|
|
8
8
|
pysat/pb.py,sha256=DjsHXwu5TG1FSbHg11DOV7kyZvtXHxknwHIL-z7udxQ,17974
|
|
9
9
|
pysat/process.py,sha256=W0_Sm5rqas0SwZd5KgTuB35j2dA-WCg1Y4yqmIwLA9U,16255
|
|
10
|
-
pysat/solvers.py,sha256=
|
|
10
|
+
pysat/solvers.py,sha256=3lL66AYnpm5n4Qppc5jpVY-WG1sVkZQnVkybBCVbh_s,316900
|
|
11
11
|
pysat/_fileio.py,sha256=FxmRrrmCDay-2Guhdy0YhDlmVDAsCNaqfHzz18n_O5I,6924
|
|
12
12
|
pysat/_utils.py,sha256=8mNX5XUKd9Bha99-jfvYgX2z2_CsE9z0DdEXCScSdCE,1398
|
|
13
|
-
pysat/__init__.py,sha256=
|
|
13
|
+
pysat/__init__.py,sha256=poOL1Ot2XSG__T9lCJL8B4RJTXz8uX-cbB5cL7bl6tQ,1018
|
|
14
14
|
pysat/allies/approxmc.py,sha256=OV2nCeOKN69wXzGwHS9MH7exxYKW3wjMCwLD3GQ0Xqg,13971
|
|
15
15
|
pysat/allies/unigen.py,sha256=d3uMDKiJzA7RLwfuZL4aniYbHPo28SqQd-h3jpmoOxU,17153
|
|
16
16
|
pysat/allies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -22,31 +22,31 @@ pysat/examples/hitman.py,sha256=yj1BBm8ghQvMQmcGope6xMs1L2fVfeMsgR2jozxZtDA,2702
|
|
|
22
22
|
pysat/examples/lbx.py,sha256=F8NW2KI9Enxjxmq_cz9wHYM1gbOqp00ULk2i24_ljDM,24096
|
|
23
23
|
pysat/examples/lsu.py,sha256=r1jKaon3QPTiPluBb3nzL9HW0HsoC5JfpMzfRUa_0GM,16700
|
|
24
24
|
pysat/examples/mcsls.py,sha256=oaDtP2Z1cNa6LfsA8Jq4pUpz9wzLsnwE2q-4yWb1s2Q,22912
|
|
25
|
-
pysat/examples/models.py,sha256
|
|
25
|
+
pysat/examples/models.py,sha256=i2rvob3thI7jILMFmoO17IPf4xd7ruMt3vcVY0AOp6A,6412
|
|
26
26
|
pysat/examples/musx.py,sha256=vjBJ2tQcnuMLP5U0jwdEDOQxIpCQ-BPYRyL1s2KhSz4,11290
|
|
27
27
|
pysat/examples/optux.py,sha256=YQSYYu6RHRWbp7EcJpHIgF3DadJhh2UQlpqL4xSpL0E,30521
|
|
28
28
|
pysat/examples/primer.py,sha256=zSC3mx1I-t2yeo-Yn1bAK42rXi4VtFIgSJT-oiozUiU,23995
|
|
29
29
|
pysat/examples/rc2.py,sha256=OkGxvQ8ufZME1GlDjmxB55hVHT5J526TWIncEBMWkn8,81083
|
|
30
30
|
pysat/examples/usage.py,sha256=9IBfW4lBHoZVBEFURW73jhc12zSeFg8_-to9o3gc5nM,2246
|
|
31
31
|
pysat/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
-
python_sat-1.9.
|
|
33
|
-
python_sat-1.9.
|
|
34
|
-
python_sat-1.9.
|
|
35
|
-
python_sat-1.9.
|
|
36
|
-
python_sat-1.9.
|
|
37
|
-
python_sat-1.9.
|
|
38
|
-
python_sat-1.9.
|
|
39
|
-
python_sat-1.9.
|
|
40
|
-
python_sat-1.9.
|
|
41
|
-
python_sat-1.9.
|
|
42
|
-
python_sat-1.9.
|
|
43
|
-
python_sat-1.9.
|
|
44
|
-
python_sat-1.9.
|
|
45
|
-
python_sat-1.9.
|
|
46
|
-
python_sat-1.9.
|
|
47
|
-
python_sat-1.9.
|
|
48
|
-
python_sat-1.9.
|
|
49
|
-
python_sat-1.9.
|
|
50
|
-
python_sat-1.9.
|
|
51
|
-
python_sat-1.9.
|
|
52
|
-
python_sat-1.9.
|
|
32
|
+
python_sat-1.9.dev24.data/platlib/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll,sha256=pMIim9wqKmMKzcCVtNhgCOXD47x3cxdDVPPaT1vrnN4,575056
|
|
33
|
+
python_sat-1.9.dev24.data/scripts/approxmc.py,sha256=h6aMnSpIaYXkTMq-tCSzNWwKb0AG-vTH4vuLWGn5Q4s,13958
|
|
34
|
+
python_sat-1.9.dev24.data/scripts/bbscan.py,sha256=xGxklG6Gc_UBaM8QvEJDOtQhEamxAncfsd65E-0JcAc,22696
|
|
35
|
+
python_sat-1.9.dev24.data/scripts/bica.py,sha256=659K6gdRBgYeNiLjQc_VnulXhbTHxnUljNYhXx-frwk,28413
|
|
36
|
+
python_sat-1.9.dev24.data/scripts/fm.py,sha256=ek1QDsuxiq1zm1PBLbrSXXEE89RP9_DYwVNnyB3eO4s,18650
|
|
37
|
+
python_sat-1.9.dev24.data/scripts/genhard.py,sha256=YswufT272W4xTJrSBlOC2ucJx4RK4ntfRv73rASrx30,19520
|
|
38
|
+
python_sat-1.9.dev24.data/scripts/lbx.py,sha256=1wAyfFjQQkhHte1OnSVhJviVmSEwWc0DaLro8fs6eik,24083
|
|
39
|
+
python_sat-1.9.dev24.data/scripts/lsu.py,sha256=EpXQCu8ZdYoNgi70Uc1b8drOwp1fo82mhGbpjonjIzw,16687
|
|
40
|
+
python_sat-1.9.dev24.data/scripts/mcsls.py,sha256=wetecyPhjfgu-jkjoZ4nrg3PiR2tCtLWLnQeiDCX5UU,22899
|
|
41
|
+
python_sat-1.9.dev24.data/scripts/models.py,sha256=nnYFRU7Bq_qjNlKglgG4zbkmrsYRpGR8KLH-PI7Hzqk,6399
|
|
42
|
+
python_sat-1.9.dev24.data/scripts/musx.py,sha256=LwK10YuQ8pIf1TJwp0HKp54O0hdk8zBy3TIfGsF1yW0,11277
|
|
43
|
+
python_sat-1.9.dev24.data/scripts/optux.py,sha256=9-4ynzXVYq7y67vy-emMbMx_gSlOBMDBX4VWkjSyHgE,30508
|
|
44
|
+
python_sat-1.9.dev24.data/scripts/primer.py,sha256=iE9Vy0XyeySIY-7-L_VMwRahsIVCEmm9k04OhLwDvuw,23982
|
|
45
|
+
python_sat-1.9.dev24.data/scripts/rc2.py,sha256=vIzgJEHSleKl45B_eENP31avWORuhaP5ogbLbf_N1HY,81070
|
|
46
|
+
python_sat-1.9.dev24.data/scripts/unigen.py,sha256=e-HC2UxWA8MTN90VslkHX1ZlTPjdhI4etzkn6G8YAX4,17140
|
|
47
|
+
python_sat-1.9.dev24.dist-info/DELVEWHEEL,sha256=1dJVR103G43lXrkPO-0xR0xnXFdOii2o7N5sfnAayZg,413
|
|
48
|
+
python_sat-1.9.dev24.dist-info/METADATA,sha256=XGcON3CrcNzPGvli6kTpZX4HKuxJynP2FR-wF6yi6mY,1854
|
|
49
|
+
python_sat-1.9.dev24.dist-info/RECORD,,
|
|
50
|
+
python_sat-1.9.dev24.dist-info/top_level.txt,sha256=0SLg3yVqNpeiqOwFcAo3OxXhqAnflCmb5Fjl6gsl-Do,33
|
|
51
|
+
python_sat-1.9.dev24.dist-info/WHEEL,sha256=0gLwYZa0C2fhgCxWR2c8HahwUiopqonVCV0wVwEg6fE,101
|
|
52
|
+
python_sat-1.9.dev24.dist-info/licenses/LICENSE.txt,sha256=q-8zFb06i-6m_ueuQhkc1J4Ew2QByvODVIgm6fZYdTY,1130
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Version: 1.13.2
|
|
2
|
-
Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-e_fhxnn2\\cp315-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-e_fhxnn2\\cp315-win_amd64\\repaired_wheel', '-v', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-e_fhxnn2\\cp315-win_amd64\\built_wheel\\python_sat-1.9.dev23-cp315-cp315-win_amd64.whl']
|
|
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
|