-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exploiting JML Names in the Proof Tree #3022
base: main
Are you sure you want to change the base?
Conversation
* master: (168 commits) missing NPE check in MasterHandlerTest Fix KeYProject#1696 (wrong hash for heapAtPre) a two-state method needs the invariant also at pre-state (try to fix KeYProject#1689) Fix KeYProject#1690 Fix failing test case Fixed rule "wellFormedStoreObjectEQ" [floats] repairing JML interpretation of equality on floats and doubles. [floats] optimising float termination rules [floats] reconducting a proof Move functionality for relevant Java files from NodeInfo to new class ProofJavaSourceCollection fix error in logging formatting strings fix the collection of JUnit tests on jenkins [floats] missing rules for double assignments [floats] re-implementing a Z3FP solver. also show message of the chained cause of the exception in IssueDialog [floats] added missing unary minus repairing cast to integer in JML translation. [floats] repairing float-cast rules [floats] repairing cast to float [floats] nasty method call missing ... # Conflicts: # key/key.core/src/main/antlr4/JmlParser.g4 # key/key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java # key/key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLSpecCase.java # key/key.ui/src/main/java/de/uka/ilkd/key/gui/MainWindow.java # key/test/Test.java
* origin/master: (43 commits) fix jml-assert/model-methods-*.key Wrong classnames and forgoten parameter type. fix jml-assert/ModelMethods.java for real (wrong classname) fix jml-assert/ModelMethods.java (missing semicolon) please checkstyle make jml-assert/ModelMethod::test4 static as it was meant to be keep the ProgramVariableCollection when translating JML asserts While here only selfVar is used to fix usages of `this` in JML asserts the rest is probably needed to fix `\old()`. ensure that the condition of a JML assert statement is always a formula The condition is always some boolean expression, so it gets translated to either a formula or boolean Term, so normalize that to formula as that is what the rule needs in the end. Do it directly when translating the Term, to reject programs where the expression isn't boolean early. add tests for issue KeYProject#1698 remove pointless extension of CreatingASTVisitor by MergeRuleUtils.CollectLocationVariablesVisitor As the name say it only collects stuff in the AST and doesn't change anything so the work CreatingASTVisitor does is unnessesary. So extend JavaASTVisitor directly instead. Adapt test cases after fixing class invariant soundness bug KeYProject#1598 Fix KeYProject#1598 soundness bug of class invariants by adding '\assumes ( ==> self = null )' cleaned after talking to Richard fix after merge remove forgotten unused imports and last old TODO of jml assert branch remove the remaining TODOs of this branch - JMLAssert: should be fine - getOr: not needed anymore after better understanding CreatingASTVisitor and implementing it better (maybe use children as parameter name in CreatingASTVisitor too) - ProgVarReplaceVisitor: should be fine - SLEnvInput: the AST can't be changed at that point so that idea isn't possible add tests for using quantors in jml assert/assume copy back test to hopefully fix mergeconflict fixed file name in example fixed wrong verbose output of testRunAllProofs added notloadable proofcollection TestProperty ... # Conflicts: # key/key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java
* Fixing test cases * Refactor (own package)
* origin/master: (119 commits) Use generic method correctly avoid creating proof obligations in ProofManagementDialog It is unnecessary to create proof obligations in most cases there and creating some proof obligations changes state shared with a large part of KeY (see KeYProject#1715). JavaDoc for changed methods + Doubles for timeout Checkstyle/SonarQube Avoid reopening popup menu when selection button is pressed Bug fixes from the IdentityHashMap case study Solve missing plugin in shadowJar by adding `mergeServiceFiles()` SonarQube Checkstyle mark JSpinner backgrounds correctly when an error occurs Deactivate SMT button when no proof is loaded Check formatting with Spotless Add JavaDoc Modify problems using solver sockets Minor changes checkstyle Write comments Delete solvers.txt (automatically created during build) Load solvers.txt from everywhere on classpath Fix failing legacy solver test cases by setting different SMT logic ...
# By Julian Wiesler (146) and others # Via Wolfram Pfeifer (25) and others * origin/main: (331 commits) Report location on error in constant evaluation Fix javadoc formatting Correctly handle unloading proofs Formatting and documentation ignore class output, add test case Javac issues extension: handle non-Java proofs Fix construction of Javac issue dialog fix typo Update tests.yml Fix branch name in Checkstyle script Update feature_request.md copy bug-report from gitlab to github Update dlsmt.sh Taclet equality oracle Move files Spotless Add open goals to error message of reload proof test Allow empty constructor blocks and others Deactivate ListOperationsNonNull_remove test Fix specification and proof script for setValueAt ... # Conflicts: # key.core/src/main/antlr4/JmlParser.g4 # key.core/src/main/java/de/uka/ilkd/key/logic/label/SpecNameLabel.java # key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java # key.core/src/main/java/de/uka/ilkd/key/proof/init/JavaProfile.java # key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLClassInv.java # key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLInitially.java # key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLSpecCase.java # key.core/src/main/java/de/uka/ilkd/key/speclang/njml/LabeledParserRuleContext.java # key.core/src/main/java/de/uka/ilkd/key/speclang/njml/TextualTranslator.java # key.core/src/test/java/de/uka/ilkd/key/rule/tacletbuilder/BranchNamingFunctionsTest.java # key.ui/src/main/java/de/uka/ilkd/key/gui/MainWindow.java # key.ui/src/main/java/de/uka/ilkd/key/gui/actions/MakeNamedFormulaToAbbrevAction.java # key/key.core/src/main/java/de/uka/ilkd/key/logic/label/FormulaTermLabel.java # key/key.core/src/main/java/de/uka/ilkd/key/rule/executor/javadl/NoFindTacletExecutor.java # key/key.core/src/main/java/de/uka/ilkd/key/rule/tacletbuilder/TacletGoalTemplate.java # key/key.core/src/main/resources/de/uka/ilkd/key/proof/rules/propRule.key # key/test/Test.java
* origin/main: (25 commits) Test for correct pretty printer behaviour Fix program element printing in proof saver Fix another proof file Fix taclet proof that uses this construct Fix inInt typo Fix ProofTreeView NPE Bump org.junit.vintage:junit-vintage-engine from 5.8.2 to 5.9.2 Bump org.antlr:antlr4 from 4.9.3 to 4.12.0 Bump org.antlr:antlr from 3.5.2 to 3.5.3 disable test case for java 17 Enabling Java 17 for unit-tests Formatting Indicate state in UI Handle proof modifications that prevent undos Refactor undo button to KeyAction Set popup size automatically Change UI to button + dropdown menu Fix misc. issues + Javadocs Support undo for auto mode and close by SMT Checkstyle, Javadocs ...
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* origin/main: Bump com.miglayout:miglayout-swing from 11.2 to 11.3
* main: (25 commits) Bump com.diffplug.spotless from 6.24.0 to 6.25.0 Bump com.diffplug.spotless from 6.23.3 to 6.24.0 Bump org.slf4j:slf4j-api from 2.0.10 to 2.0.11 Bump org.slf4j:slf4j-api from 2.0.9 to 2.0.10 spotless reformat automatical translate package.html to package-info.java spotless after discussion: all datatypes are free ignore files in */antlr4/gen/* Treat duplicate predicate declarations as error. adding example file for natural numbers as ADTs Fix TestTermParser to avoid multiple parsing of declarations implement the discussion of KaKeY spotless fix merge errors fix passing of warnings no spaces in displaynames of taclets fix spaces in origin label manually + spotless add an example for case distinction add list example with two proofs ...
# By Drodt (57) and others # Via GitHub (17) and others * origin/main: (147 commits) Merge main into extraxt-new-core fixes KeYProject#1533 added checkbox to disable example loader directly in dialog address reviewer comments: set border + spotless + typo JML enabled keys indicator for the status line add test case for adt taclets Fix position info for equality expr errors Revert debugging code Spotless Add ADT Deconstructors Moved TestSMTMod to newsmt2 spotless applied to TestSMTMod Added test for Modulo Translation Added translation from KeY mod to SMT mod. Soundness derived from translation of KeY div to SMT div preventing NPEs in overloaded operators added test cases for operator overloading activate the OverloadedOperatorHandler.java for LocSet datatype and repair translation Bump ch.qos.logback:logback-classic from 1.4.14 to 1.5.0 Update README.md (license date and Java version) ... # Conflicts: # key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java # key.core/src/main/java/de/uka/ilkd/key/settings/GeneralSettings.java # key.core/src/main/java/de/uka/ilkd/key/speclang/jml/pretranslation/TextualJMLConstruct.java # key.ui/build.gradle # keyext.caching/src/test/java/de/uka/ilkd/key/proof/reference/TestReferenceSearcher.java
* main: ColorSettings: drop old configuration file format Bump ch.qos.logback:logback-classic from 1.5.0 to 1.5.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, the generation of name labels seems to work only partially:
class Labels {
int f = 7;
//@ invariant inv1: f == 7;
/*@ requires pre1: x == 5;
@ ensures post1: \result == 42;
@ ensures post2: \result == \lbl(prod, 6 * 7);
@*/
int m(int x) {
return 42;
}
}
Only the formula with lbl got a label as expected. Am I doing something wrong here?
* also fix some encoding in recorder/src files
* main: change gradle github action to new syntax adding comments to jml spec factory default contracts EQ version of seqSwapPreservesSeqPerm + proof added rule for sequences: swap preserves perm Fix test case that failed with new default-contract behavior Fix code format Add test Add documentation Add proof setting for sound or unsound default contracts Don't add default contracts for Object or <init> methods Default contract for contractless methods Fix compiler check when using classpath Add printf to JavaRedux
* weigl/codequality: reenable sonarqube, disable the crappy things
* refs/heads/main: Update key.core/src/main/java/de/uka/ilkd/key/nparser/builder/TacletPBuilder.java spotless update oracle for taclet equality test repair soundness of assignment2UpdateRules with checked overflows spotless Changed types in replacement map for WD taclets, since PR KeYProject#3436 made casting TermSV to ProgramVariable not applicable Fix and test goToNext() Fix goToNextSibling() (thx Tobias) Format Add comments and next() method Remove SVSubstitute Clean up inheritance Implement missing methods Start implementation of traversal Implement cursor Increase Java version API design throw an error if choices used in a taclet are not declared correct inRange(..) predicates for overflow check semantics fix creating of branches for overflow checking
I mark this "Work in progress" since a number of checks fail. Please undo if/when ready to review. |
This is a typical example that KeY development is dysfunctional. It was green, and nobody reviewed it, after repeatedly merging the main branch into it, it became red. I do not see any reason to invest further time into it, only to see the branch rot away until the next review. |
5a6311a
to
097be71
Compare
I reviewed it a long time ago, had some fundamental questions, remarks, and pointed out some bugs (#3022 (review)). In my opinion, this is my job as a reviewer. Until now, I did not get any answer to those (see #3022 (review) and #3022 (comment)), so I do not consider it my job to do another review until my points are answered/resolved. I think that the job of the developer is to provide a working, tested and high quality PR (at least with a clear concept, a description with a list of the changes it contains, good documentation, passing CI tests). Only having "green tests" is not sufficient ... And if my questions have been resolved in the meantime, I would expect at least a comment answering them, not just a re-request of a review ... |
This PR adds the newly introduced JML names for entities to KeY. Such labels are exploited inside the KeY's proof tree as branching labels. And may later become accessible in proof scripts.
This MR brings following changes:
JML entities have names:
lbl
function is supported, e.g.,\lbl(NAME, x != y)
A new term label
name(XXX)
is added, where "XXX" holds the name given in the JML specification.Terms that are created by the JMLParser/Translator receive a this term label if the entity has a name or a
\lbl
was given.Change to the KeY parser: Goal templates can have computed labels.
Currently, the label of a goal can be a schema variable or static string. With this MR you are allowed to define labels which are computed by a Java interface
BranchNamingFunction
.A taclet exploits this in the following way:
New branching naming functions can be added by an interface. The
\nameLabelOf
tries to find af«name(X)»
term label, and returnsX
. It fallbacks to the origin term label and then to the toString representation.TODO
origin
label@post_abc
?andRightX
andorLeftX
per Built-In rule?KeY example (working)
New rules$x \in 3..6$ ) allows a more comprehensible proof split.
andRightX
(forJML
Consider following examples:
This results into the following proof tree. At places where no name label is available we ask the origin label for a string representation. The origin label needs further improvement e.g., line numbers ❗
Sum And Max
Introduction of Abbreviations for Named Terms
Menu: Proof-> Introduce abbreviation for named formulas
Before:
After actions is applied: