Skip to content
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

Updated Pure definition in the metatheory #6964

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

ramsay-t
Copy link
Contributor

@ramsay-t ramsay-t commented Mar 20, 2025

The previous Pure definition was just a stub. This works, although there are some differences from the Haskell and some open questions about some of the details.

@ramsay-t ramsay-t requested a review from effectfully March 20, 2025 12:50
@ramsay-t ramsay-t added the No Changelog Required Add this to skip the Changelog Check label Mar 20, 2025
@ramsay-t
Copy link
Contributor Author

Currently this definition of Purity also causes the certifier to say "no" to some of the tests. We should, obviously, fix that before we merge this.

-- case applied to constr would reduce, and possibly be pure.
case : {i : ℕ} {t : X ⊢}{vs ts : List (X ⊢)}
→ lookup? i ts ≡ just t
→ Pure t
Copy link
Contributor

Choose a reason for hiding this comment

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

No, it's t applied to vs that needs to be Pure.

Anyway, do feel free to just omit case. Perhaps with a comment of what we discussed here.

sat-det sat-t sat-t₁ refl = trans (sym sat-t) sat-t₁

data Pure {X : Set} : (X ⊢) → Set where
force : {t : X ⊢} → Pure t → Pure (force t)
Copy link
Contributor

Choose a reason for hiding this comment

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

No, delay b is pure, force (delay b) isn't necessarily pure. Except when b is pure, which you also need to handle, because the implementation does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did we agree that we only force delays (and builtins), so we don't need to handle force applied to arbitrary things?


unsat-builtin : {t₁ t₂ : X ⊢} {arity args : ℕ}
→ saturation t₁ ≡ just (arity , args)
→ arity > (suc args)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't take wrong interleaving into account, I'll write it up separately.

But it complies with the current (wrong) implementation, so it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not merge Metatheory No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants