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

feat: LCtxSearch abstraction to search the local context in a single pass #189

Merged
merged 16 commits into from
Sep 30, 2024

Conversation

alexkeizer
Copy link
Collaborator

@alexkeizer alexkeizer commented Sep 25, 2024

Description:

The main purpose of this definition is to build an abstraction around searching the local context for variables of certain expected types. We currently already do this in multiple places, and building an abstraction around it allows us to deduplicate code, making it more robust, more powerful and more performant (although the performance win is probably negligible, given we don't search the local context that often).

  • I've built a datastructure that stores a set of patterns to search for, this allows us to cleanly separate the declaration of what to search for from doing the actual search.
  • Using this abstraction, I've reimplemented SymContext.fromLocalContext, to now do only two passes over the local context, instead of a separate pass for each variable we look for.
  • I've also renamed the former to fromMainContext to emphasize the fact we search the context of the main (TacticM) goal, not the ambient MetaM local context, and
  • I've removed the definition that canonicalized types (canonicalizeHypothesisTypes), since we've incorporated that functionality in searchLCtx as well, as an option on search patterns

In future PRs, we'd like to:

  • extract an AxEffects.fromLocalContext using this search abstraction
    • use the former in the stand-alone explodeStep tactic, and
  • use the search abstraction in sym_aggregate

Testing:

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

License:

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

@alexkeizer alexkeizer force-pushed the refactor-state-monads-4 branch from c3a952a to d3cab07 Compare September 25, 2024 21:41
@alexkeizer alexkeizer force-pushed the refactor-state-monads-5 branch from 9065c01 to 20173f9 Compare September 25, 2024 21:42
@alexkeizer alexkeizer force-pushed the refactor-state-monads-4 branch from d3cab07 to ad949b6 Compare September 26, 2024 21:00
@alexkeizer alexkeizer force-pushed the refactor-state-monads-5 branch from 6431c4f to 60b484e Compare September 26, 2024 21:00
@alexkeizer alexkeizer changed the title WIP: feat: LCtxSearch abstraction to search the local context in a single pass feat: LCtxSearch abstraction to search the local context in a single pass Sep 26, 2024
@alexkeizer
Copy link
Collaborator Author

@bollu, this is ready for review, modulo the fact that it's stacked on #187. Could you do a pass already? This one is a bit tricky, so I'd appreciate your thoughts!

Base automatically changed from refactor-state-monads-4 to main September 27, 2024 22:03
@alexkeizer alexkeizer force-pushed the refactor-state-monads-5 branch from 8beb2b5 to 7e6b84f Compare September 27, 2024 22:12
@alexkeizer alexkeizer marked this pull request as ready for review September 27, 2024 22:16
@alexkeizer alexkeizer requested a review from shigoel as a code owner September 27, 2024 22:16
@alexkeizer
Copy link
Collaborator Author

alexkeizer commented Sep 27, 2024

This is now rebased and ready for review

@shigoel
Copy link
Collaborator

shigoel commented Sep 30, 2024

@alexkeizer Could you please hit Squash and merge if/when the CI succeeds?

@alexkeizer alexkeizer merged commit 16e3f4f into main Sep 30, 2024
5 checks passed
shigoel added a commit that referenced this pull request Oct 3, 2024
…mContext` (#200)

### Description:

Stacked on #189, we use the more powerful search capabilities to include
hypotheses that describe reads from *any* `StateField` into the initial
AxEffects.

### 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.

---------

Co-authored-by: Shilpi Goel <[email protected]>
shigoel added a commit that referenced this pull request Oct 3, 2024
### 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.

---------

Co-authored-by: Shilpi Goel <[email protected]>
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