Skip to content

Commit

Permalink
Run reasoner on everything
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed May 3, 2024
1 parent aea2f8b commit fa1c606
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 13 deletions.
31 changes: 31 additions & 0 deletions test/prog_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@
"1RB 2LC 3LA 0RD 3LE 2RB 0RB 1LE 1RD 2LA ... ... 1RF 0LA 1RD 2LA 2RF 3RF 1LG ... 1LA 0RF 3LA 0RD 2RB 3RB 1LE 1LH 3LE 3LH ... 1RB": 3,

# Spinout
"1RB 1RC 0RC 1RC 0LA 1LB 2LC 2RA 1LB": 3,

"1RB 1RC 0LC 1RD 1LB 1LE 1RD 0RA 1LA 0LE": 3,
"1RB 0RC 1LC 0LD 1RE 0LD 0LC 1LB 0RE 1RA": 3,
"1RB 1LC 1RD 0RA 0LC 1LE 1LA 0RE 0LA 1RB": 3, # 10^1089
Expand Down Expand Up @@ -1102,6 +1104,7 @@
"1RB 2LB 1LC 1LA 2RB 1RB ... 2LA 0LC",
"1RB 2RA 1LC 2LB 0RB 2LA 1LA 0LB 1LA",
"1RB 2RA 1LC 2LB 0RB 2LA 2RB 0LB 1LA",
"1RB 2RC 1LA 2LA 1RB 0RB 2RB 2RA 1LC",

"1RB 2LB 4LB 3LA ... 1LA 3RA 3LB 0LB 0RA",

Expand Down Expand Up @@ -1183,6 +1186,8 @@
"1RB 3LA 1LA 1RA 2LB 2RA 0RB 3RB", # QH 77, xmas
"1RB 2LA 2RB 1LA 3LB 3RA 2RB 0RB", # QH 14, xmas

"1RB 3LA 1LA 4LA 1RA 2LB 2RA ... 0RA 0RB",
"1RB 4LA 1LA ... 2RB 2LB 3LA 1LB 2RA 0RB",

"1RB ... 0RC 1RC 0RD 0RC 1RE 1LA 0RF 0RE 1LF 1LD",
"1RB 0LD 1RC 0RF 1LC 1LA 0LE ... 1LF 0RB 0RC 0RE",
Expand Down Expand Up @@ -1313,6 +1318,10 @@
"1RB 1LE 0RC 1LD 1RD 0RD 1RE 1RC 0LA 1LB", # 10^46
}

MACRO_SPINOUT: set[str] = {
"1RB ... 1RC 0RF 1RD 0LF 1LE 0RC 1LD 0RE 1LC 1RA",
}

BLANKERS = (
{prog: None for prog in DO_BLANK}
| SPINOUT_BLANK
Expand Down Expand Up @@ -2076,6 +2085,28 @@
for prog in progs
}

HALTERS = set(
HALT
| HALT_SLOW
| PROVER_HALT
) | DO_HALT

SPINNERS = set(
SPINOUT
| SPINOUT_SLOW
| SPINOUT_BLANK
| SPINOUT_BLANK_SLOW
| PROVER_SPINOUT
) | DO_SPIN_OUT

RECURS = set(
RECUR_COMPACT
| RECUR_DIFFUSE
| RECUR_SLOW
| RECUR_TOO_SLOW
| QUASIHALT
) | PROVER_QUASIHALT

## test program ######################################################

PROGS: dict[
Expand Down
29 changes: 16 additions & 13 deletions test/test_turing.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,41 +225,44 @@ def test_blank(self):

def test_false_negatives(self):
for prog in CANT_HALT_FALSE_NEGATIVES:
self.assertNotIn(prog, HALTERS)
self.assert_could_halt(prog)

for prog in CANT_BLANK_FALSE_NEGATIVES:
self.assertNotIn(prog, BLANKERS)
self.assert_could_blank(prog)

for prog in CANT_SPIN_OUT_FALSE_NEGATIVES:
self.assertNotIn(
prog,
SPINOUT
| SPINOUT_SLOW
| SPINOUT_BLANK
| SPINOUT_BLANK_SLOW)

self.assertNotIn(prog, SPINNERS)
self.assert_could_spin_out(prog)

def test_halt(self):
for prog in DO_HALT | set(HALT_SLOW):
for prog in HALTERS:
self.assert_could_halt(prog)

for prog in SPINNERS | RECURS:
self.assert_cant_halt(prog)

def test_spinout(self):
for prog in DO_SPIN_OUT | set(SPINOUT_SLOW):
for prog in SPINNERS:
self.assert_simple(prog)

if prog in MACRO_SPINOUT:
continue

self.assert_could_spin_out(prog)

for prog in DONT_SPIN_OUT:
for prog in DONT_SPIN_OUT | HALTERS | RECURS:
self.assert_cant_spin_out(prog)

def test_recur(self):
# pylint: disable-next = line-too-long
for prog in RECUR_COMPACT | RECUR_DIFFUSE | RECUR_SLOW | RECUR_TOO_SLOW:
for prog in RECURS:
self.assert_cant_halt(prog)
self.assert_cant_blank(prog)
self.assert_cant_spin_out(prog)

if prog not in BLANKERS:
self.assert_cant_blank(prog)

def test_holdouts(self):
for cat in ('42h', '24h'):
for prog in read_holdouts(cat):
Expand Down

0 comments on commit fa1c606

Please sign in to comment.