-
Notifications
You must be signed in to change notification settings - Fork 86
Extract GobLint.cartesian_*map functions
#1890
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
9a36ac4 to
332023d
Compare
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.
Pull request overview
This PR extracts three new utility functions (cartesian_map, cartesian_filter_map, and cartesian_concat_map) into GobList to unify common patterns found throughout the codebase. These patterns typically involved using BatList.cartesian_product followed by List.map, or using List.map inside List.concat_map to achieve cartesian product operations.
Key changes:
- Added three new
GobList.cartesian_*maputility functions - Refactored multiple occurrences of the cartesian product + map pattern across the codebase
- Updated function signatures from tuple-destructuring to separate parameters where appropriate
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/util/std/gobList.ml |
Added three new utility functions: cartesian_map, cartesian_filter_map, and cartesian_concat_map |
tests/unit/dune |
Added -open Goblint_std flag to make GobList functions available |
tests/unit/maindomaintest.ml |
Replaced BatList.cartesian_product + List.map with GobList.cartesian_map |
tests/unit/cdomains/intDomainTest.ml |
Removed local cart_op helper and used GobList.cartesian_map |
src/domains/intDomainProperties.ml |
Replaced cartesian product pattern with GobList.cartesian_map |
src/domain/hoareDomain.ml |
Multiple conversions to GobList.cartesian_map and cartesian_filter_map |
src/cdomains/congruenceClosure.ml |
Removed local map2 helper, converted to GobList.cartesian_map, added TODO for potential future extraction |
src/cdomain/value/cdomains/structDomain.ml |
Kept BatList.cartesian_product with TODO comments for potential future conversion |
src/cdomain/value/cdomains/int/intervalSetDomain.ml |
Converted multiple functions to use all three cartesian variants, updated function signatures from tuple to separate parameters |
src/arg/myARG.ml |
Renamed cartesian_concat_paths to cartesian_append and implemented with GobList.cartesian_map |
src/analyses/extractPthread.ml |
Updated lambda signature and used GobList.cartesian_map |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is on top of #1886 because I got the idea there.GobList.cartesian_mapunifies two kinds of patterns I found in various places:List.maponBatList.cartesian_product.List.mapinsideList.concat_map.In a few places, the variants
GobList.cartesian_filter_mapandGobList.cartesian_concat_mapare introduced.