Skip to content

Quantifier and Heap Reasoning Improvements - #3961

Open
unp1 wants to merge 4 commits into
mainfrom
bubel/quantifier-shape-fallback
Open

Quantifier and Heap Reasoning Improvements#3961
unp1 wants to merge 4 commits into
mainfrom
bubel/quantifier-shape-fallback

Conversation

@unp1

@unp1 unp1 commented Aug 12, 2026

Copy link
Copy Markdown
Member

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

  • Refactoring (behaviour should not change or only minimally change)
  • New feature (non-breaking change which adds functionality)

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).
  • I added new test case(s) for new functionality. New problem for RAP being able to close an Adjacency list problem which stayed open before.
  • I have tested the feature as follows: RAP, testing
  • I have checked that runtime performance has not deteriorated. No regressions on RAP, can solve more proofs now. In the worst case the Strategy Options allow to switch back to the old behavior (select GOOD)

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.

@unp1 unp1 self-assigned this Aug 12, 2026
@unp1
unp1 force-pushed the bubel/quantifier-shape-fallback branch from 63f3f22 to ad12fe2 Compare August 12, 2026 10:34
@unp1 unp1 added the Feature New feature or request label Aug 13, 2026
@unp1
unp1 force-pushed the bubel/quantifier-shape-fallback branch from ac7e2ec to d3b8f3e Compare August 14, 2026 00:07
unp1 added 4 commits August 14, 2026 12:16
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
unp1 force-pushed the bubel/quantifier-shape-fallback branch from d3b8f3e to a29d31b Compare August 14, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant