-
Notifications
You must be signed in to change notification settings - Fork 1
Add fold
operator to STS
#8
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a comment would be nice here. From what I can tell, if you have a relation that relates some states given some inputs, you can show that it if it holds for the states of a single step and with no step, then it also holds for arbitrarily many steps with the closure relation. It took me a few minutes to figure this out, so it'd be nice if the next person didn't have to.
src/Prelude/STS.agda
Outdated
module _ ⦃ _ : HasTransition Γ S I ⦄ where | ||
|
||
fold : ∀ {ℓ} {γ : Γ} (P : List I → Rel S ℓ) → | ||
(∀ {i is} → Trans (_⊢_—[ i ]→_ γ) (P is) (P (i ∷ is))) → |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(∀ {i is} → Trans (_⊢_—[ i ]→_ γ) (P is) (P (i ∷ is))) → | |
(∀ {i is} → Trans (γ ⊢_—[ i ]→_) (P is) (P (i ∷ is))) → |
I think this is more readable. You can do the same thing 2 lines below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what I wanted to do but an error about ambiguous parsing showed up, although that happened in another context in which I first developed the function. So, I've just fixed it in 0760676.
Fixed in 20ec33c. |
This PR adds a
fold
operator toSTS
.