Skip to content

Commit

Permalink
Change assertion to check
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Aug 19, 2024
1 parent 5e55f3c commit eca1a38
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions test/prog_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,12 @@
"(2848768 + ((2 ** 712191) * (-1 + ((2 ** 356096) * (-1 + ((2 ** 178049) * (-1 + ((2 ** 89025) * (-1 + ((2 ** 44513) * (-1 + ((2 ** 22258) * (-1 + ((2 ** 11130) * (-1 + ((2 ** 5566) * (-1 + ((2 ** 2784) * (-1 + ((~10^425) * (2 ** 1393)))))))))))))))))))))",
"(???)",
),
"1RB 0LC 1LC 1RA 1LD 0LD 0LE 0LC 1RE 0RB": (
6250,
"(10 ↑↑ 7)",
"(???)",
"(???)",
),
"1RB 0RC 1LA 1RD 1RF 1LD 0LE 1RA 1LC 0RE ... 0RA": (
7160,
"(10 ** 442169)",
Expand Down
2 changes: 1 addition & 1 deletion test/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ def test_prover(self):
progs = (
"1RB 0LD 1LB 0RC 0RE 1LD 1LA ... 0RB 0LC",
"1RB 0RC 1LC 1RA 1RE 0LD 0LC 0LE 0RB 1LD",
"1RB 0LC 1LC 1RA 1LD 0LD 0LE 0LC 1RE 0RB",
"1RB 3LA 4LB 0RB 1RA 3LA 2LA 2RA 4LA 1RA 5RB ...",
"1RB 3RB 5RA 1LB 5LA 2LB 2LA 2RA 4RB ... 3LB 2LA",
"1RB 1RA 1LC 0RF 0LE 0RD 0RE 1LB 1RA 0LC ... 1RD",
"1RB 1LC 1LA 0LD 1RB 0LA ... 1LE 1RF 0LB 1RB 0RE",
"1RB 0LF 0RC 1RC 1RD 1RB 0RE 1RA 1RF ... 1LA 0LD",
"1RB 1LD 0RC ... 1RD 0LA 1RE 1RF 1LC 1LE 1RA 0RD",
"1LB ... 0LC 1LC 0LD 0LC 1LE 1RA 0LF 0LE 1LG 1RD 0LH 0LG 1LI 1RF 0LJ 0LI 1RJ 1RH",
)
Expand Down
8 changes: 4 additions & 4 deletions test/test_turing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,9 +1123,9 @@ def test_algebra(self):
print(' },\n')

assert_num_counts({
"adds": 109880,
"adds": 110605,
"divs": 13612,
"exps": 110582,
"muls": 11623,
"totl": 245697,
"exps": 110617,
"muls": 11683,
"totl": 246517,
})
5 changes: 2 additions & 3 deletions tm/num.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,8 @@ def __sub__(self, other: Count) -> Count:
if isinstance(other, Add):
l, lo = self.l, other.l

assert isinstance(l, int) and isinstance(lo, int)

return (l - lo) + (self.r - other.r)
if isinstance(l, int) and isinstance(lo, int):
return (l - lo) + (self.r - other.r)

return self + -other

Expand Down

0 comments on commit eca1a38

Please sign in to comment.