Immutable and valid JML set statement#3400
Conversation
* origin/main: (331 commits) increase spotless version (and thus also eclipse formatter) to fix missing space in instanceof formatting Spotless and fix rebase Some additional minor fixes and spotlessApply Update `collect(Collectors.toList())` to `toList()` Introduction of record classes where it seems useful. Refactor: Introduce a pattern variable were possible. Translate large string concatenations into raw string literal (text blocks) update beanshell version in recoder's dependencies Switch to Java 17 for KeY-2.14.0 repair POM generation using afterEvaluate Adding license to KeY files Adding license to Java files add metadata for POM generation and update templates for license headers Bump ch.qos.logback:logback-classic from 1.4.8 to 1.4.11 Fix bug in icon selection update samplesIndex.txt Repair example index better default keyboard shortcuts, corrected docs URL, cleanup removing the SmansEtAl example from first touch change docking frames dependencies to maven central versions ...
* origin/main: (180 commits) Use Amazon's Corretto add caching for gradle dependencies Update to Java 21 Runtime for testing Add HelpInfo to more extensions Add help buttons to extension settings Use pattern matching to avoid cast Change default notification setting to unfocused Renaming from reviewer suggestion (got lost when splitting the PR) Minor cleanup Prevent possible NullPointerException. Cleanup. Remove last usage of the legacy matcher. Check only new terms for well-typedness Move static metavariable cache to service caches Minor cleanup incl. spotless changes Use array of assumes instantiations Preparation for parallel prover engine - make Strategies stateless by introducing a specific explicit state object for TermBuffers and the Backtracking Manager This will allow strategies to execute in parallel Update keyext.ui.testgen/src/main/java/de/uka/ilkd/key/gui/testgen/CounterExampleAction.java Update keyext.ui.testgen/src/main/java/de/uka/ilkd/key/gui/testgen/TGInfoDialog.java Some cleanup and proper switching to automode Avoid access of non-private field in synchronized context ... # Conflicts: # key.core/src/main/java/de/uka/ilkd/key/speclang/njml/PreParser.java
This reverts commit c539948. Reason for reverting: The implemented changes to pretty printing assertions raised exceptions during interactive application. However this change has nothing to do with the original intention of this branch.
Undoing some changes that accompanied the reverted commit before this.
it makes the code more conservative.
|
This version verifies the following program: which is not correct at all. The problem is that in every loop iteration y becomes a different symbol. However, in |
|
Even simpler: The following can be proved: The x in the set statement does not refer to the correct variable (neither when reading, nor when writing) |
|
Then I would say, the simple does not work and we need to go back to the drawing board. @unp1 Do you have insides into the mechanism of variable renaming? Is there a chance, to get around the |
|
Everything is terrible. Current test program: class Test {
//@ ghost int x;
int a;
//@ requires true; ensures x==a;
void foo() {
//@set x = 0;
a = 0;
//@set x = x + 1;
a = a + 1;
//@set x = x + 1;
a = a + 1;
//@set x = x + 1;
a = a + 1;
//@set x = x + 1;
a = a + 1;
//@set x = x + 1;
a = a + 1;
}
//@ ghost int rec;
int cer;
//@ requires a >= 0; ensures rec == cer; measured_by a;
int voo(int a) {
if (a == 0) {
//@ set rec = 0;
cer = 0;
return 0;
} else {
int r = voo(a - 1) + 1;
//@ set rec = r;
cer = r;
//@ assert r >=0;
return r;
}
}
}There are only two possibilities:
|
|
@mattulbrich The mutable information of The example above is proofable except for the faulty assert statement. There are currently two construction sites:
|
The old syntax is no longer valid in favour of a unified syntax.
* weigl/fixdlsmt: fix check for cvc5 exit in error in dlsmt.sh fix cvc5 fix smt solver downloader script for z3
Version of #3195 but with an immutable Java AST.
This PR implements JML set-statement in a non-Java-like fashion (no reduction to copy assignment) preserving the semantics of Java.
Translation of JML goes directly from JML to KeY terms lazily inside the built-in rule
SetStatementRule.TODO
Type of pull request
Ensuring quality