Formalize LocSet as Set of Locations - #3962
Conversation
… functions and rules for LocSet and Set
…ed concrete & generic sort (G) patterns: Pair<int, G> and nested Pair<int, Pair<int, G>>
…o locset-as-set
# Conflicts: # key.core/src/main/java/de/uka/ilkd/key/java/TypeConverter.java
unp1
left a comment
There was a problem hiding this comment.
Thanks a lot! Great work. Only a few minor remarks/questions.
|
Please check if you want to keep the last two commits otherwise revert The second commit restricts the elementOf decomposition rules to those cases where the decomposition is necessary. Such that the decomposition rules are only applied where it makes sense and otherwise using the normal one without decomposition. Feel free to revert both commits or to only pick what you want. |
Reenables proving of setExamples
-Design a bit over the top as both strategies do not much, but split enables easier move of SetStrategy to ncore while keeping LocsetStrategy in core
unp1
left a comment
There was a problem hiding this comment.
Thanks a lot. I approved. But please make sure you are fine with my last commit (I wanted to have it done yesterday, but decided to get some sleepp at 5 a.m.) It makes the strategies a bit more useful (comm, assoc and distribute are now set strategy internal not relying on the quantifier heuristic) as well as additional simplification rules (+ their soundness proofs). Sorry that the PR adds now more lines then before, but that is misleading, still much more deleted and the vast majorit are the saved soundness proofs.
- application of commutation, associativity now done by SetStrategy and do not longer rely on rulesets and their definition by other strategies (basically just copy and paste form FOLStrategy) - add additional absorption laws to allow for more efficient simplification of set and locset terms; (all added rules proven correct witihin KeY)
|
Thanks, guys for your effort here! Sounds very reasonable and I am looking forward to having a decent set datatype in KeY! |
| arrayRangeEmpty { | ||
| \schemaVar \term Object o, o2; | ||
| \schemaVar \term int lower, upper; | ||
| \assumes( ==> o = o2) |
There was a problem hiding this comment.
Why do we assume this? o2 appears only here. Is it an error or for performance?
There was a problem hiding this comment.
If it is not an error, I can undo my last commit (9eeedc6)
There was a problem hiding this comment.
The problem was that I could not proof the taclet without the assumption (Z3 could), I did not find the proof argument that there are at least two elements of type java.lang.Object :-) The only one I could construct is 'null'. I am not sure if Z3s ability to close the proof came from translating taclets (in which case I could just not combine it) or some hard encoded information that the set of objects infinite.
I wanted to discuss it first, if everyone is fine to add an axiom stating that the java.lang.Object domain is infinite. I would like to state it as a general property (and not to hardcode it as a wellformed property). The wellformedness was also why I could not use instanceAllocation to get a second object.
But in the meantime I did not want to give up on the taclet and used the assumes as a workaround.
There was a problem hiding this comment.
But you seem to have managed it 👍 So no objections from my side, the taclet is much more powerful that way.
Intended Change
Rely on the KeY formalization of parametric
Setto expressLocSet. We have:Rules are adjusted accordingly.
Additionally, this PR provides
Pairis now parametric and has some additional rulesPlan
Type of pull request
Ensuring quality
Additional information and contact(s)
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.