-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace recursive definitions of algebraic operations with axioms #41
Conversation
Maybe it is also possible to weaken |
OK, it took me two weeks to find the time to push this over the line, but I think now it's ready. I modified the the Unrelated: I also changed |
PS happy to squash-merge (but don't really know what I'm talking about) |
This approach automatically weakens |
I get annoyed when I see solutions to NNG levels in the wild which rely on definitional equality. We get confused people reporting bugs in NNG3 because they accidentally proved
x + 0 = x
byrfl
and it worked. I tried to get around this by getting Jon/Alex to weakenrfl
so that it wasn't solving stuff like this and2 + 2 = 4
, butapply
andexact
still manage to unifyx
andx + 0
.I decided that one approach to this could be to redefine addition, multiplication and exponentiation via opaque constants obeying axioms. All worlds apart from Algorithm World worked fine after the refactor, but this approach broke
decide
, which was no longer able to put2 + 2
into a normal form. We have worked around this by making a custom simp set which knows the axioms defining+
*
and^
and with another rule which makes numerals greater than 0 reduce toMyNat.succ (MyNat.succ ... (MyNat.succ 0))..)
;MyDecide
applies this simp set and then runsdecide
. Thanks to all on the Zulip thread for suggestions.Before:
(and user then shows up on Zulip confused about a "bug".)
After: