#!/bin/env python
-#pylint: disable-msg=too-many-locals,invalid-name
-"""hi"""
+#pylint: disable-msg=too-many-locals,invalid-name,missing-docstring
-def generate():
- """Generates the yices code for peg solitaire"""
+if __name__ == '__main__':
pos = [(x, y) for x in range(7) for y in range(7) if
not ((x < 2 and y < 2) or # exclude topleft
(x > 4 and y > 4) or # exclude bottomright
(x > 4 and y < 2) or # exclude topright
(x < 2 and y > 4)) # exclude bottomleft
]
- ill_middles = [
- (2, 0), (4, 0), (0, 2), (0, 4), (6, 2), (6, 4), (2, 6), (4, 6)]
holes = [(3, 3)]
winning = (3, 3)
-
iterations = len(pos)-len(holes)
- posp = [p for p in pos if p not in ill_middles]
print """
(benchmark a1.smt
:logic QF_UF
print ';Iteration {}'.format(i)
print '(or'
for sx, sy in pos:
- for mx, my in posp:
+ for mx, my in pos:
if mx == sx and my == sy:
continue
for ex, ey in pos:
for x, y in pos if (x, y) != winning)
print '))'
-
-if __name__ == '__main__':
- generate()