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.
Intended Change
This adds multisets in KeY, to show permutation properties. This complements the existing formalizations using
seqPermandbsum.(\mset int k; low <= k <= high; t)extended JML quantifiermsetRange{int k;}(low, high, t)to JavaDL and other constructors such asmsetSingle,msetSumPlan
There were some fixes needed to actually prove permutation properties of quicksort or similar.
applyEqorhideAuxiliaryEq. Three instantiations ofhideAuxiliaryEqwere needed, Quicksort_sort.zproof.zipEqualityConstraint.java, functionnormalize()does not break anythingType of pull request
Additional information
Quicksort could not be shown without the changes to
EqualityConstraint.java. As far as I understand it, theisRigid()guard prevents normalization and is therefore a completeness bug in the current version of KeY. Credits go to @unp1. Apparently, in an old KeY 1.x version, theisRigid()guard was needed for soundness as it would prevent normalization with constrained program variables.The basic idea of the MSet rules is as follows:
msetRangeinto amsetSumof themsetSinglewith the updated element andmsetRangefor the remaining part without the update.msetSumis converted into a normal form using associativity and commutativity.A = BintoA_decomposed = B. To bringBin the same form (although there are no updates),msetRangeis also decomposed on side B an equation using the rulemset_extract_triggeredand friends.Alternatively to the decomposition approach, we could also back-convert the normal form of
msetSums (e.g.A_decomposed) into a bigmsetRange. However, we have not implemented this.The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.