Closed flo2702 closed 3 months ago
I think this is easily achievable in KeY.
All we need is a sort SORT in KeY and a sort-depending symbol alpha::sort, a few taclets that connect them to the subtype relation of the Java program and JavaDL.
The JML translation is probably easily adapted.
A topic for the HacKeYthon?
Does this hurt the theory on the meta-level?
\type(\type(a))
? \type
only defined for reference datatypes?\type(2) well-defined? Or is
\type(2)` a reference type due to autoboxing?\TYPE <: \TYPE
? x <: y
similar to instanceOf
? Then, will it support annotations?\type(\TYPE) <: \type(\TYPE)
holds.
\type
is defined for type names. I.e., \type(ClassName)
, \type(int)
, and \type(\TYPE)
are all legal expressions, but \type(\type(...))
and \type(2)
are not.
The subtype operator supports only base types without annotations.
Closed by #3465
KeY should have more support for the JML type
TYPE
.As far as I know, KeY only supports the
\type
construct in expressions of the exact form\typeof(e) == \type(C)
. It does not understand the typeTYPE
and the operator<:
at all.Use case 1
Consider a class hierarchy like the following:
The method contract of
foo()
should be provable.Use case 2
Remembering the type of objects in a
\seq
or container object.