feat(untyped): define CBN and Standard evaluation strategies - #671
Conversation
|
Hi, I am doing something similar. I also have verified leftmost theorem in debruijn index. We are working on https://github.com/awesome-lambda-calculus/Fokker_challenge , normalization theorem is of most importance to us. |
|
Hi! Really cool project! |
|
Just read through your docs and I'm glad to see the project officially uses Locally Nameless. |
chenson2018
left a comment
There was a problem hiding this comment.
Looks straightforward, just a couple of small golfs:
| variable {M N : Term Var} | ||
|
|
||
| /-- The left side of a standard reduction is locally closed. -/ | ||
| lemma stand_lc_l (step : M ⭢ₛ N) : LC M := by |
There was a problem hiding this comment.
I think for the other reduction strategies we namespace all these lemmas. Especially since you do so for Standard.lc_refl below this feels odd.
There was a problem hiding this comment.
Thanks for the review!
…ame.lean Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
…ame.lean Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
chenson2018
left a comment
There was a problem hiding this comment.
Looks good, thanks!
|
@chenson2018 Why merge such unfinished code? |
We in general encourage making small PRs. This seemed fine to me for an initial pass at adding these definitions. |
|
@m-ow May I ask what project you are working on that requires this definition? In my development of fokker_challenge, changes to cslib are saved in enhancedcslib/ directory for several weeks, until I can make sure this is useful and general enough to contribute to upstream. |
Instead of phrasing things so negatively, could you please explain the specific issue that you have with the definitions in this PR? |
|
Personally I prefer https://www.is.c.titech.ac.jp/~kashima/pub/C-145.pdf Actually I have verified most part of the paper, but I am still testing them in fokker_challenge, so I will not pr soon. I don't understand merge such a pr in one day. |
I doubt this is helpful to verify "two vars are not enough". https://github.com/awesome-lambda-calculus/Fokker_challenge/wiki/Two-vars-are-not-enough |
|
BTW: "Formalization in Coq of the Standardization Theorem for λ-calculus" is not based on locallynameless |
It seems unlikely to be relevant that this reference is not specifically using locally nameless binding, as most theorems we care about are independent of this?
I've still not understood your specific objection to these definitions. They seemed very straightforward to me, so I merged the PR. There is no rush, but if you follow up with a specific alternative proposal and a fleshed out explanation of why it works better, I will certainly consider it. |
|
In this pr, standardization is parallel style. Proof in parallel style might be easier to write. |
|
Actually I have the whole proof this pr, but it is not tested in fokker_challenge, so I didn't push a pr: |
|
@lengyijun Thanks for the feedback.
The proof strategy in this PR is not parallel, it's CBN based (following Calisto, adapted to locally nameless).
Agreed that the current PR is not sufficient for fokker_challenge on its own. The next step is |
|
@m-ow Are you going to define properties of |
|
If you already have |
|
@m-ow I will not pr those. Thanks for your work. I will focus on following theorems, although I don't have any idea now: |
…rover#679) This PR proves the standardization theorem: if `M` beta-reduces to `N` in any number of steps, then `N` is reachable from `M` by a standard reduction. Builds on leanprover#671. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com> Co-authored-by: Chris Henson <chrishenson.net@gmail.com>
…rover#679) This PR proves the standardization theorem: if `M` beta-reduces to `N` in any number of steps, then `N` is reachable from `M` by a standard reduction. Builds on leanprover#671. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com> Co-authored-by: Chris Henson <chrishenson.net@gmail.com>
This PR proves the standardization theorem: if `M` beta-reduces to `N` in any number of steps, then `N` is reachable from `M` by a standard reduction. Builds on #671. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com> Co-authored-by: Chris Henson <chrishenson.net@gmail.com>
This is the first step towards the Standardization Theorem.
Instead of the classic (and painful) Barendregt approach, I defined
Standardreductionrelying on
CBNto find the head redex, which makes the proofs much nicer.