Skip to content

Commit

Permalink
Merge pull request #37 from HalflingHelper/all_elim_fix
Browse files Browse the repository at this point in the history
Remove Marks Fix
  • Loading branch information
jsiek authored Nov 17, 2024
2 parents 6c5b944 + fafbf87 commit 646d4b3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion abstract_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ def copy(self):
# self.subject.copy())

def __str__(self):
return '{' + str(self.subject) + '}'
return '#' + str(self.subject) + '#'

def reduce(self, env):
subject_red = self.subject.reduce(env)
Expand Down
4 changes: 2 additions & 2 deletions proof_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def check_proof(proof, env):
error(loc, "\nhave " + label + ':\n\t' + str(proved_formula))
case _:
check_proof_of(reason, new_frm, env)
body_env = env.declare_local_proof_var(loc, label, new_frm)
body_env = env.declare_local_proof_var(loc, label, remove_mark(new_frm))
ret = check_proof(rest, body_env)

case PAnnot(loc, claim, reason):
Expand Down Expand Up @@ -1070,7 +1070,7 @@ def check_proof_of(proof, formula, env):
error(loc, "\nhave " + base_name(label) + ':\n\t' + str(proved_formula))
case _:
check_proof_of(reason, new_frm, env)
body_env = env.declare_local_proof_var(loc, label, new_frm)
body_env = env.declare_local_proof_var(loc, label, remove_mark(new_frm))
check_proof_of(rest, formula, body_env)

case PAnnot(loc, claim, reason):
Expand Down
12 changes: 12 additions & 0 deletions test/should-error/have_remove_marks.pf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import List
import Nat

theorem blah : all x : Nat.
length(node(x, empty)) = 1
proof
arbitrary x : Nat
have step : length(@empty<Nat>) + #length(@empty<Nat>)#
= length(@empty<Nat>) + 0
by definition length
?
end
11 changes: 11 additions & 0 deletions test/should-error/have_remove_marks.pf.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
./test/should-error/have_remove_marks.pf:11.3-11.4: incomplete proof
Goal:
length([x]) = 1
Advice:
To prove this equality, one of these statements might help:
definition
rewrite
equations

Givens:
step: length([]) + length([]) = length([]) + 0

0 comments on commit 646d4b3

Please sign in to comment.