Skip to content

Add parametric maps to standardRules - #4024

Open
Drodt wants to merge 7 commits into
mainfrom
pmap
Open

Drodt wants to merge 7 commits into
mainfrom
pmap

Conversation

@Drodt

@Drodt Drodt commented Nov 5, 2026

Copy link
Copy Markdown
Member

Intended Change

Similar to PSeq I also see a need for maps, so I parameterized Map to get PMap. The rules are almost exactly the same as for map, with the exception of the pmapIsFinite axiom, which needed strengthening. I also proved the lemmas for pmap.

Whether we can/should carry over the axiom change and the proofs to Map should be discussed.

Type of pull request

  • New feature (non-breaking change which adds functionality)
  • There are changes to the taclet rule base

Ensuring quality

  • I have tested the feature as follows: proved correctness for lemmas.

Additional information and contact(s)

The contributions within this pull request are licensed under GPLv2, or (at your option) any later version, for inclusion in KeY.

@Drodt Drodt self-assigned this Nov 5, 2026
@unp1
unp1 self-requested a review November 6, 2026 09:34

@unp1 unp1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a few questions to clarify before approval. Nothing major.

in the implicit heap (additional non-object values may also be part of the domain). This can be used
in a JML specification as an invariant to ensure, that non-created objects are not (yet) part
of the domain of a map. */
pmapInDomainImpliesCreated<K, V>(PMap<K, V>);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That function should either be removed or it needs a heap parameter


// Added by Kai Wallisch
defPMapEquality {
\find(m0 = m1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that consistent with the parameteric sorts: m1:Map<Integer, String>, m2:map<Integer, Object> if theyr are siblings in the type hierarchy the equality we could derive false, otherwise using the axiom true (if they contain the same key value pairs). How do we define the type hierarchy here?

\find(pmapIsFinite<K, V>(pmapEmpty<K, V>))
\replacewith(true)
\heuristics(simplify)
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\generateEQ(..)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and others below

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.

2 participants