Skip to content

Commit 26c5d2f

Browse files
committed
Simplifications for 0.9 release.
1 parent 200d407 commit 26c5d2f

17 files changed

+6
-1172
lines changed

Diff for: MarcoPolo.py

+1-21
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,8 @@ def enumerate(self):
3838
# subset check may improve upon seed w/ unsat_core or sat_subset
3939
seed_is_sat, seed = self.subs.check_subset(seed, improve_seed=True)
4040

41-
if self.config['half_max'] and not known_max and (seed_is_sat == self.bias_high):
42-
assert not self.config['maxseed']
43-
with self.timer.measure('half_max'):
44-
# Maximize within Map and re-check satisfiability
45-
seed = self.map.maximize_seed(seed, direction=self.bias_high)
46-
seed_is_sat, seed = self.subs.check_subset(seed, improve_seed=True)
47-
known_max = True
48-
4941
if seed_is_sat:
50-
if self.bias_high and (self.config['nogrow'] or known_max):
42+
if self.bias_high and known_max:
5143
MSS = seed
5244
else:
5345
with self.timer.measure('grow'):
@@ -56,15 +48,6 @@ def enumerate(self):
5648
yield ("S", MSS)
5749
self.map.block_down(MSS)
5850

59-
if self.config['mssguided']:
60-
with self.timer.measure('mssguided'):
61-
# don't check parents if parent is top and we've already seen it (common)
62-
if len(MSS) < self.n-1 or not self.got_top:
63-
# add any unexplored superset to the queue
64-
newseed = self.map.find_above(MSS)
65-
if newseed:
66-
self.seeds.add_seed(newseed, False)
67-
6851
else:
6952
self.got_top = True # any unsat set covers the top of the lattice
7053
if known_max and not self.bias_high:
@@ -75,9 +58,6 @@ def enumerate(self):
7558

7659
yield ("U", MUS)
7760
self.map.block_up(MUS)
78-
if self.config['smus']:
79-
self.map.block_down(MUS)
80-
self.map.block_above_size(len(MUS)-1)
8161

8262

8363
class SeedManager:

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.9
1+
0.9

Diff for: marco.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ def parse_args():
2626
help="always find a maximal/minimal seed (local optimum), controlled by bias setting (high=maximal, low=minimal)")
2727
max_group.add_argument('-M', '--maximum-seed', action='store_true',
2828
help="always find a maximum/minimum seed (largest/smallest cardinality), controlled by bias setting (high=maximum, low=minimum) (uses MiniCard as Map solver)")
29-
parser.add_argument('--smus', action='store_true',
30-
help="calculate an SMUS (smallest MUS)")
31-
parser.add_argument('--mssguided', action='store_true',
32-
help="check for unexplored subsets in immediate supersets of any MSS found")
33-
parser.add_argument('--nogrow', action='store_true',
34-
help="do not grow any satisfiable subsets found, just block as-is")
35-
parser.add_argument('--half-max', action='store_true',
36-
help="only compute a maximal model if the initial seed is SAT / bias is high or seed is UNSAT /bias is low")
3729
type_group = parser.add_mutually_exclusive_group()
3830
type_group.add_argument('--cnf', action='store_true',
3931
help="assume input is in DIMACS CNF format (autodetected if filename is *.cnf or *.cnf.gz).")
@@ -120,7 +112,7 @@ def setup_solvers(args):
120112

121113
# create appropriate map solver
122114
varbias = (args.bias == 'high')
123-
if args.maximum_seed or args.smus:
115+
if args.maximum_seed:
124116
from mapsolvers import MinicardMapSolver
125117
msolver = MinicardMapSolver(n=csolver.n, bias=varbias)
126118
else:
@@ -140,12 +132,8 @@ def main():
140132
(csolver, msolver) = setup_solvers(args)
141133

142134
config = {}
143-
config['smus'] = args.smus
144135
config['bias'] = args.bias
145136
config['maxseed'] = args.max_seed or args.maximum_seed
146-
config['mssguided'] = args.mssguided
147-
config['nogrow'] = args.nogrow
148-
config['half_max'] = args.half_max
149137

150138
mp = MarcoPolo(csolver, msolver, timer, config)
151139

Diff for: mkdist.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# gather "whitelist" of files to include
44
marco_files="*.py muser2-static README VERSION"
5-
test_files="tests/*.cnf tests/*.smt2 tests/*.gz tests/*.py tests/out/*"
5+
test_files="tests/*.cnf tests/*.smt2 tests/*.gz tests/*.py tests/out/*/*"
66
minisolvers_files=`find pyminisolvers/ \( -name "*.cc" -or -name "*.cpp" -or -name "*.h" -or -name "Makefile" -or -name "makefile" -or -name "*.py" -or -name "*.pyx" \) -print`
77

88
if [ "$1" = "list" ] ; then

Diff for: tests/out/marco_py_smus/c10.cnf.out

-12
This file was deleted.

Diff for: tests/out/marco_py_smus/dlx2_aa.cnf.out

-1,059
This file was deleted.

Diff for: tests/out/marco_py_smus/test1.cnf.gz.out

-3
This file was deleted.

Diff for: tests/out/marco_py_smus/test1.cnf.out

-3
This file was deleted.

Diff for: tests/out/marco_py_smus/test1.smt2.out

-8
This file was deleted.

Diff for: tests/out/marco_py_smus/test2.cnf.out

-4
This file was deleted.

Diff for: tests/out/marco_py_smus/test2.smt2.out

-2
This file was deleted.

Diff for: tests/out/marco_py_smus/test3.cnf.out

-19
This file was deleted.

Diff for: tests/out/marco_py_smus/test4.cnf.out

-9
This file was deleted.

Diff for: tests/out/marco_py_smus/test5.cnf.out

-1
This file was deleted.

Diff for: tests/out/marco_py_smus/test6.cnf.out

-3
This file was deleted.

Diff for: tests/out/marco_py_smus/test7.cnf.out

-4
This file was deleted.

Diff for: tests/testconfig.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,13 @@
1616
{
1717
'name': 'marco_py',
1818
'cmd': '../marco.py',
19-
'flags': ['', '-m', '-M', '--mssguided', '--nogrow', '--half-max'],
19+
'flags': ['', '-m', '-M'],
2020
'flags_all': common_flags,
2121
},
2222
{
2323
'name': 'marco_py',
2424
'cmd': '../marco.py',
25-
'flags': ['-b low', '-m -b low', '-M -b low', '-b low --mssguided', '-b low -m --mssguided', '-b low --half-max'],
26-
'flags_all': common_flags,
27-
'exclude': ['dlx2_aa.cnf'],
28-
},
29-
{
30-
'name': 'marco_py_smus',
31-
'cmd': '../marco.py',
32-
'flags': ['--smus'],
25+
'flags': ['-b low', '-m -b low', '-M -b low'],
3326
'flags_all': common_flags,
3427
'exclude': ['dlx2_aa.cnf'],
3528
},

0 commit comments

Comments
 (0)