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

refactor: use searchLCtx in sym_aggregate #201

Draft
wants to merge 2 commits into
base: refactor-state-monads-6
Choose a base branch
from

Conversation

alexkeizer
Copy link
Collaborator

Description:

Stacked on #200.

This uses the searchLCtx machinery we built in #189 in sym_aggregate's implementation.
For now, this searches for exactly the same kind of expressions as before, but this makes it much easier to expand this set in the next PR.

Testing:

What tests have been run? Did make all succeed for your changes? Was
conformance testing successful on an Aarch64 machine? yes

License:

By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.

return axHyps
-- `r ?field ?state = ?rhs`
searchLCtxFor (whenFound := whenFound)
(matchUnderBinders := true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment -- why is this necessary, etc.?

let expectedAlign : MetaM Expr := do
let state ← mkFreshExprMVar mkArmState
return mkApp (mkConst ``CheckSPAlignment) state
let ((), axHyps) ← StateT.run (s := #[]) <|
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some explanation for the nonsavvy devs would be good.

- If `changeType` is set to true, then we change the type of every successful
match (i.e., `whenFound` returns `continu` or `done`) to be exactly the
`expectedType`
- If `changeType` (default `false`) is set to true, then we change the type of
Copy link
Collaborator

Choose a reason for hiding this comment

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

@alexkeizer Please change the SymContext to also set matchUnderBinders to true to pick up on non-effects.

Setting this option to true will make the search procedure call `forallMetaTelescope` on each type before matching.
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