Quantifier and Heap Reasoning Improvements - #3961
Open
unp1 wants to merge 4 commits into
Open
Conversation
unp1
force-pushed
the
bubel/quantifier-shape-fallback
branch
from
August 12, 2026 10:34
63f3f22 to
ad12fe2
Compare
unp1
force-pushed
the
bubel/quantifier-shape-fallback
branch
from
August 14, 2026 00:07
ac7e2ec to
d3b8f3e
Compare
Improves treatment of quantified formulas involving arrays with affine integer indexes. Trigger matching compares the structure of two terms, so a fact about b[srcStart + t] cannot be used on a term about a[x]: the witness x - srcStart occurs nowhere in the proof. Re-indexing therefore had to be written as a lemma and discharged by SMT. A theory can now solve a trigger subterm against the term it should match, through a new method on QuantifierTheorySupport. Integer arithmetic solves k*t + rest = s for t by exact division, for a pattern affine in one unbound variable. A wrong solution costs one instantiation, since instantiating a universal with any term is sound. (created with AI tooling support)
Applying a method contract anonymises the heap. A quantified formula from before the call has its triggers over the old heap, so trigger matching finds no instance and the property cannot be used afterwards. For an array read select(h,a,arr(i)) the heap theory now adds the trigger select(H,a,arr(i)) with a metavariable H for the heap, which matches the read over any heap. Such a trigger is matched by unification and by basic matching. An instantiation that basic matching gets by solving a subterm costs 10000 more, so it is tried after the ones from ordinary matches. AdjacencyStore.storeValidList, added here, needs this across its call to storeList. runAllProofs: 101 of 672 proofs change, 793103 against 803745 nodes. (created with AI tooling supported)
…alues then o != u Some heap simplification rules rely in their assumes on the fact that two objects are different, i.e., \assumes (==> o = u). this change makes it more likely for that formula to be actually present
Approval should only be called on taclets whose assumes clause has been matched.
unp1
force-pushed
the
bubel/quantifier-shape-fallback
branch
from
August 14, 2026 10:52
d3b8f3e to
a29d31b
Compare
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.
Second of three of the last AI supported work
Improves the quantifier heuristics and heap reasoning by providing triggers if array access is an affine integer expression. It also makes inequality of objects explicit in the sequents enabling more heap simplification rules to be applied automatically. The added taclet has been proven sound and the proof has been added.
Type of pull request
Ensuring quality
Additional information and contact(s)
Created with AI tooling support
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.