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

defn: regularity tactic #150

Merged
merged 5 commits into from
Oct 28, 2022
Merged

defn: regularity tactic #150

merged 5 commits into from
Oct 28, 2022

Conversation

plt-amy
Copy link
Member

@plt-amy plt-amy commented Oct 24, 2022

if you don't have a definitional equality, a tactic will do, too

@plt-amy plt-amy requested a review from TOTBWF October 24, 2022 06:56
Copy link
Collaborator

@TOTBWF TOTBWF left a comment

Choose a reason for hiding this comment

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

Looks good to me! Mostly just style nits, though I do wonder if we can handle weakening + finding stuck transports in a single pass.

then backtrack "No possible instances, but have other decompositions to try"
else pure (tt , false)
[] → backtrack "No possible instances, but have other decompositions to try"
-- if has-alts
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably get rid of this commented out code

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh good shout, I forgot this was here, it's from a WIP that ended up not panning out. I'll revert the change so you can still use hlevel! to fill out a skeleton

@@ -606,6 +608,13 @@ prop-ext! {aprop = aprop} {bprop = bprop} = prop-ext aprop bprop
→ x ≡ y
Σ-prop-path! {bxprop = bxprop} = Σ-prop-path bxprop

prop!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, I've been wanting this one for a while!

-- This match might make you wonder: Can't Al be a line of
-- functions, so that the transport will have more arguments? No:
-- The term is in normal form.
(do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we could define something like Haskell's handle and use it here? It's a bit hard to see the <|> at first glance.

Copy link
Member Author

Choose a reason for hiding this comment

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

See "fold syntax" here: #152. There's a couple more places where big <|> trees could become a list.

refl-transport _ tm′ = pure tm′

-- Boring term traversal.
go pre n (var x args) = var x <$> go* pre n args
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it feasible to fuse the weakening and the term traversal into a single pass here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Feasible yes, but I'm not sure whether it's a good idea: de Bruijn indices always own me so keeping the owning to a centralise location sounds better. It might be feasible to have helpers for like, bottom-up and top-down traversal of terms, but because of the fast Regularity-precision this traversal is kinda neither

src/1Lab/Reflection/Regularity.agda Outdated Show resolved Hide resolved
src/1Lab/Reflection/Subst.agda Outdated Show resolved Hide resolved
src/1Lab/Reflection/Subst.agda Show resolved Hide resolved
src/Algebra/Ring/Module/Category.lagda.md Show resolved Hide resolved
@TOTBWF TOTBWF mentioned this pull request Oct 24, 2022
@plt-amy
Copy link
Member Author

plt-amy commented Oct 26, 2022

@TOTBWF am I good to merge this?

@plt-amy plt-amy merged commit 28cc7a5 into main Oct 28, 2022
@plt-amy plt-amy deleted the aliao/regularity branch December 15, 2022 04:21
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.

2 participants