Skip to content

Joachim’s Haskell and lean4 experiments #2

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

Draft
wants to merge 146 commits into
base: main
Choose a base branch
from
Draft

Joachim’s Haskell and lean4 experiments #2

wants to merge 146 commits into from

Conversation

nomeata
Copy link

@nomeata nomeata commented Apr 3, 2023

Not to be merged, just for visibility.

This large branch contains (or contained) the following changes

@nomeata nomeata changed the title Joachim’s Haskell experiments Joachim’s Haskell and lean4 experiments Apr 5, 2023
@rossberg
Copy link
Collaborator

Done.

@nomeata
Copy link
Author

nomeata commented Apr 26, 2023

As the IL is still changing a lot, would you mind going through the non-draft PRs and merge what can be merged (and say why something can’t be merged), so that I don’t have to spend that much time on merge conflicts?

Copy link
Collaborator

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we all agree that the changes to the spec are temporary hacks? If so, that's okay with me, but we should clearly mark them as such, and we need to have a plan for resolving them quickly. Once other backends start depending on them it could become much more difficult to fix them.

@raoxiaojia
Copy link

raoxiaojia commented May 9, 2023

I guess it's sensible if the backends wait a bit until these are decided since it might have non-trivial impact on the actual implementation.
I'm hoping to connect the proofs to these DSL-generated definitions to see how they work together! The verbosity of the constructors seem to be the main hindrance but it's something that can be addressed.

Update: oops, I accidentally clicked on 'Close with comment'. This is reopened.

@raoxiaojia raoxiaojia closed this May 9, 2023
@raoxiaojia raoxiaojia reopened this May 9, 2023
nomeata added 13 commits May 9, 2023 14:52
this is a pass that takes care of the problem with `MUT?`, which is a
non-functional expression (denotes multiple values), and thus cannot be
compiled like this to functional backends (proof backends).

Here is its effect:
```diff
 relation Global_ok: `%|-%:%`(context, global, globaltype)
   ;; 3-typing.watsup:414.1-418.40
-  rule _ {C : context, expr : expr, gt : globaltype, t : valtype}:
+  rule _ {C : context, expr : expr, gt : globaltype, t : valtype, w0 : ()?}:
     `%|-%:%`(C, GLOBAL(gt, expr), gt)
     -- Globaltype_ok: `|-%:OK`(gt)
-    -- if (gt = `MUT%?%`(()?{}, t))
+    -- if (gt = `MUT%?%`(w0, t))
     -- Expr_ok_const: `%|-%:%CONST`(C, expr, t)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants