Skip to content

Shepherding #1107: Fix SMT translation of integer literals#1123

Closed
aqjune-aws wants to merge 2 commits intomainfrom
Robertboy18/fix-smt-int-literal-translate
Closed

Shepherding #1107: Fix SMT translation of integer literals#1123
aqjune-aws wants to merge 2 commits intomainfrom
Robertboy18/fix-smt-int-literal-translate

Conversation

@aqjune-aws
Copy link
Copy Markdown
Contributor

--- This is a verbatim copy from #1107 ---

Issue #, if available:

N/A. Found while working on leanprover/cslib#539.

Description of changes:

This fixes SMT translation of integer literals. Previously, Strata.DL.SMT.Translate.translateTerm translated .prim (.int x) as having Lean type Prop; this PR changes it to Int.

This matters for integer-valued SMT ite terms. In CSLib/Boole (Check: leanprover/cslib#539), an expression like:

if i + 1 == n then 0 else i + 1

was producing a VC elaboration error because the branch literal 0 had type Int but was expected to have type Prop.

This PR also adds a regression test covering an integer-valued SMT ite.

Checks run:

lake env lean StrataTest/DL/SMT/TranslateTests.lean
lake env lean StrataTest/DL/SMT/DenoteTests.lean
lake env lean StrataTest/DL/SMT/EncoderTests.lean
lake build Strata.DL.SMT.Translate StrataTest.DL.SMT.TranslateTests

Let me know if you have any questions!

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aqjune-aws
Copy link
Copy Markdown
Contributor Author

aqjune-aws commented May 5, 2026

I will confirm the internal benchmark result and proceed

-> The internal benchmark didn't regress

@tautschnig
Copy link
Copy Markdown
Contributor

Closing as #1107 has been merged.

@tautschnig tautschnig closed this May 6, 2026
@tautschnig tautschnig deleted the Robertboy18/fix-smt-int-literal-translate branch May 6, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants