Skip to content

Simplify list append and drop through symbolic tails - #235

Open
RSoulatIOHK wants to merge 4 commits into
perf/beta-smt-sharingfrom
perf/beta-symbolic-list-tails
Open

Simplify list append and drop through symbolic tails#235
RSoulatIOHK wants to merge 4 commits into
perf/beta-smt-sharingfrom
perf/beta-symbolic-list-tails

Conversation

@RSoulatIOHK

@RSoulatIOHK RSoulatIOHK commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

List append and drop stop when the remaining list is symbolic, even if known constructors determine part or all of the answer. For example, [1, 2] ++ xs and List.drop 2 (1 :: 2 :: xs) remain unnecessarily opaque.

Consume the known prefix, preserve the symbolic tail, and rebuild only the residual operation. Append reuses its right operand directly when the left prefix ends in nil. Drop visits at most the requested number of known constructors and returns the tail as soon as the count reaches zero.

Tests/FixedIssues/Issue233.lean contains kernel-checked witnesses, eleven optimizer regressions for complete/partial prefixes and zero/nil cases, an optimizer-only Blaster composition, and a negative near-miss. Issue #233 was opened with the minimal examples before implementation. Existing #101 and #103 handle different rewrite rules and do not cover these cases.

Validation: lake build Tests.FixedIssues.Issue233 Tests.Smt.SmtList and lake test passed. The complete stack includes the scope-safe SMT-sharing change; tests use the same Z3 4.15.2 executable and 30-second process cap as the baseline.

Fixes #233.

The review report records all findings, existing PR overlap, the stack, benchmark evidence and remaining draft work.

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.

1 participant