Skip to content

Add rewrite rule: List.any with equality lambda to List.elem#101

Open
felipeperet wants to merge 3 commits intoinput-output-hk:mainfrom
felipeperet:feat/list-any-to-elem-rewrite-rule
Open

Add rewrite rule: List.any with equality lambda to List.elem#101
felipeperet wants to merge 3 commits intoinput-output-hk:mainfrom
felipeperet:feat/list-any-to-elem-rewrite-rule

Conversation

@felipeperet
Copy link
Copy Markdown
Contributor

Closes #100.

Rewrites List.any l (fun x => x == k) to List.elem k l before SMT translation.
Handles both x == k and k == x, and extends to custom types with derived BEq instances using definitional equality checking instead of syntactic pattern matching.

Notably, ConstNormOpaqueFunArg_5 now reduces to True in the optimization phase alone.

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.

[Suggestion] Rewrite rule: List.any with equality lambda to List.elem

1 participant