Investigate: Invalid model with :produce-proofs true in String Theory + UF#8736
Draft
Investigate: Invalid model with :produce-proofs true in String Theory + UF#8736
:produce-proofs true in String Theory + UF#8736Conversation
Copilot
AI
changed the title
[WIP] Fix invalid model generation with produce-proofs true
Investigate: Invalid model with Feb 23, 2026
:produce-proofs true in String Theory + UF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Z3 reports
satwith a model that fails validation when:produce-proofs trueis set alongside String Theory and uninterpreted functions. Removing:produce-proofs trueproduces a valid model.Root Cause (Investigation Only — No Fix Implemented Yet)
This PR documents findings from root cause analysis. No code changes were made.
What happens with proofs enabled
propagate_values()andflatten_clauses()inasserted_formulas.cppare skipped whenm.proofs_enabled(), causing the solver to explore different search branchese="A",x=0, makingstr.substr("A",0,1) = "A" = e, so the ITE branch evaluates to the same string aseWhy the contradiction is missed
internalize_ite_term()insmt_internalizer.cppreturns early (line 832–834) without callingapply_sort_cnstr(), so the ITE enode never gets a theory variable intheory_seqcheck_extensionality()intheory_seq.cppnever compares the ITE root againste, failing to callctx.assume_eq()that would surface the UF contradiction (n(ite,"@")=1vsn(e,"@")=0)Model generation artifact
mk_func_interps()then produces two conflicting entries for the same functionn:The first entry wins, yielding
n("A","@") = 0, which violates assertion 3.Proposed Fix Direction
Ensure the ITE term receives a
theory_seqtheory variable (by callingapply_sort_cnstrfor ITE terms of sequence sort), socheck_extensionalityconsiders it and triggers the necessaryassume_eqto expose the UF contradiction before the solver declares SAT.Original prompt
:produce-proofs trueinvolving String Theory and UF #8194💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.