Purge sort depending functions in favor of parametric functions#3773
Purge sort depending functions in favor of parametric functions#3773
Conversation
8256cc5 to
46212b5
Compare
|
This |
It is a constant, not a SortDependingFunction.
This branch is not yet based on Java Parser. I thought, JP would take a bit longer than this PR. |
|
Delayed until #3120 is merged and invariants are changed from |
|
Per the KeY meeting: This PR is truly ready. Eventual syntax improvements are left for future PR (but should be discussed soon!) |
WolframPfeifer
left a comment
There was a problem hiding this comment.
I reviewed the code and it looks mostly fine, except for a few minor complaints (mostly about comments).
However, when trying to test the PR the GUI, already at start of KeY I get the following exception (even when removing the .key directory):
[16:35:05.483] ERROR XMLResources - Cannot not load help messages in info viewjava.util.InvalidPropertiesFormatException: jdk.internal.org.xml.sax.SAXParseException;
at java.base/jdk.internal.util.xml.PropertiesDefaultHandler.load(PropertiesDefaultHandler.java:85)
at java.base/java.util.Properties.loadFromXML(Properties.java:1003)
at de.uka.ilkd.key.util.XMLResources.getResource(XMLResources.java:58)
at de.uka.ilkd.key.util.XMLResources.<init>(XMLResources.java:36)
at de.uka.ilkd.key.gui.InfoView.<init>(InfoView.java:55)
at de.uka.ilkd.key.gui.InfoView.<init>(InfoView.java:149)
at de.uka.ilkd.key.gui.MainWindow.<init>(MainWindow.java:329)
at de.uka.ilkd.key.gui.MainWindow.getInstance(MainWindow.java:417)
I am not sure if the reason lies really in the PR, also KeY does not crash.
Apart from that and the minor comments, it seems to work fine.
|
|
||
| WS: [ \t\n\r\u00a0]+ -> channel(HIDDEN); //U+00A0 = non breakable whitespace | ||
| STRING_LITERAL:'"' ('\\' . | ~( '"' | '\\') )* '"' ; | ||
| LESS: '<'; | ||
| LESSEQUAL: '<' '=' | '\u2264'; | ||
| LGUILLEMETS: '<' '<' | '«' | '‹'; | ||
| RGUILLEMETS: '>''>' | '»' | '›'; | ||
| IMPLICIT_IDENT: '<' '$'? (LETTER)+ '>' ('$lmtd')? -> type(IDENT); |
There was a problem hiding this comment.
Until doing this review, I was not aware that we have 11 ANTLR .g4 files now (3 * lexer, 8 * parser), instead of 4 which I remember from a while ago. How many different parsers are there, and how do they work together? Is this documented or at least outlined anywhere?
In my opinion, this makes it more difficult to find token/rule declarations, and also opens possibilities for inconsistencies: Here, IMPLICIT_IDENT was removed because it was already in the ncore KeYLexer, right?
There was a problem hiding this comment.
It was removed because it is no longer needed. We have no more of these <id> identifiers with this PR
There was a problem hiding this comment.
For the rest, let's discuss at the next meeting
| @@ -178,6 +179,11 @@ public record SplitFieldName(String className, String attributeName) { | |||
| * @return the split field name | |||
| */ | |||
| public static @Nullable SplitFieldName trySplitFieldName(Named symbol) { | |||
| if (symbol instanceof ParametricFunctionInstance pfi) { | |||
| // e.g., $classErroneous<[A]> | |||
There was a problem hiding this comment.
Is this not one of our implicit field names? Why is it used as an example for a parametric function here?
There was a problem hiding this comment.
You weren't there at the KeY meeting when I explained just how amazing this implementation is and was: Yes, it is an implicit field but on the logic side, these fields where always sort depending functions, e.g., A::<classErroneous>. It just happened to look like the field syntax.
Now that sort depending functions are removed, we use parametric functions and cannot just split.
| // TODO(DD): Extend to more complex parametric functions; ask RB what is expected | ||
| // here |
There was a problem hiding this comment.
Did you want to fix or remove this TODO?
Intended Change
Replace all sort depending functions from KeY and replace them with parametric functions, e.g., int::select -> select<[int]>.
This PR does not affect behavior. In particular, sequences are not (yet) made parametric and the grammar is not really modified.
SortDependingFunctionis removed.Plan
java.lang.Object::<created>Type of pull request
Ensuring quality
.github/workflows/tests.ymlAdditional information and contact(s)
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.