You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I had to change compared to the original tutorial:
I had to add //@ set nodeseq = \seq_empty in the constructor of LinkedList. That was missing in the original. Did we change the initialization of sequence attributes? KeY 3.0 set it to null.
Also: Method resolution for Arrays.copyOf(array, array.length + 10) fails (comes up when getting a name proposal or using typeof). JavaParser says:
com.github.javaparser.resolution.MethodAmbiguityException: Ambiguous method call: cannot find a most applicable method: JavaParserMethodDeclaration{wrappedNode=public static double[] copyOf(double[] original, int newLength);, typeSolver=de.uka.ilkd.key.java.loader.JavaParserFactory$DynamicTypeSolver@787b2e03}, JavaParserMethodDeclaration{wrappedNode=public static float[] copyOf(float[] original, int newLength);, typeSolver=de.uka.ilkd.key.java.loader.JavaParserFactory$DynamicTypeSolver@787b2e03}
at com.github.javaparser.resolution.logic.MethodResolutionLogic.findMostApplicable(MethodResolutionLogic.java:1123)
at com.github.javaparser.resolution.logic.MethodResolutionLogic.findMostApplicable(MethodResolutionLogic.java:993)
at com.github.javaparser.symbolsolver.javaparsermodel.contexts.JavaParserTypeDeclarationAdapter.solveMethod(JavaParserTypeDeclarationAdapter.java:319)
at com.github.javaparser.symbolsolver.javaparsermodel.contexts.ClassOrInterfaceDeclarationContext.solveMethod(ClassOrInterfaceDeclarationContext.java:111)
at com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserClassDeclaration.solveMethod(JavaParserClassDeclaration.java:339)
at com.github.javaparser.resolution.logic.MethodResolutionLogic.solveMethodInType(MethodResolutionLogic.java:1364)
at com.github.javaparser.resolution.logic.MethodResolutionLogic.solveMethodInType(MethodResolutionLogic.java:1352)
at de.uka.ilkd.key.java.KeYProgModelInfo.getProgramMethod(KeYProgModelInfo.java:422)
at de.uka.ilkd.key.java.JavaInfo.getProgramMethod(JavaInfo.java:623)
at de.uka.ilkd.key.java.ast.reference.MethodReference.method(MethodReference.java:323)
at de.uka.ilkd.key.java.ast.reference.MethodReference.getKeYJavaType(MethodReference.java:374)
at de.uka.ilkd.key.java.TypeConverter.getKeYJavaType(TypeConverter.java:528)
at de.uka.ilkd.key.rule.metaconstruct.TypeOf.transform(TypeOf.java:40)
at de.uka.ilkd.key.java.visitor.ProgramReplaceVisitor.performActionOnProgramMetaConstruct(ProgramReplaceVisitor.java:107)
What I had to change compared to the original tutorial:
I had to add //@ set nodeseq = \seq_empty in the constructor of LinkedList. That was missing in the original. Did we change the initialization of sequence attributes? KeY 3.0 set it to null.
I think that is a bug: seq is a value data type, it should not be possible to assign null to a ghost field of that type. Also, this is the whole reason for the need to specify the default value (as is currently done via /*! defaultValue(x)*/ attached to the sort declaration). I tried to rework that in #3659, see there for more details.
I think instead of null, the default value should be assigned. We should probably fix that for the 3.0 release, I will look into it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Adds FM 2024 Tutorial examples as tests.
Plan
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.