We present FJ&★, a new core calculus that extends Featherweight Java (FJ) with interfaces, -expressions, intersection types and a form of dynamic type. Intersection types can be used anywhere, in particular to specify target types of -expressions. The dynamic type is exploited to specify parts of the class tables and programs we want to exclude temporarily from static typing. Our main result is the gradual guarantee, which says that if a program is well typed in a class table, then replacing type annotations (from the program and from the class table) with the dynamic type always produces a program that is still well typed in the obtained class table. Furthermore, if a typed program evaluates to a value in a class table, then replacing type annotations with dynamic types always produces a program that evaluates to the same value in the obtained class table.

Gradual Guarantee for FJ with lambda-Expressions

Viviana Bono
;
Mariangiola Dezani-Ciancaglini
;
2023-01-01

Abstract

We present FJ&★, a new core calculus that extends Featherweight Java (FJ) with interfaces, -expressions, intersection types and a form of dynamic type. Intersection types can be used anywhere, in particular to specify target types of -expressions. The dynamic type is exploited to specify parts of the class tables and programs we want to exclude temporarily from static typing. Our main result is the gradual guarantee, which says that if a program is well typed in a class table, then replacing type annotations (from the program and from the class table) with the dynamic type always produces a program that is still well typed in the obtained class table. Furthermore, if a typed program evaluates to a value in a class table, then replacing type annotations with dynamic types always produces a program that evaluates to the same value in the obtained class table.
2023
25th ACM International Workshop on Formal Techniques for Java-like Programs, FTfJP 2023, Seattle, WA, USA, 18 July 2023
Seattle, USA
18/07/2023
Proceedings of the 25th ACM International Workshop on Formal Techniques for Java-like Programs, FTfJP 2023, Seattle, WA, USA, 18 July 2023
ACM
32
38
979-8-4007-0246-4
https://doi.org/10.1145/3605156.3606453
Lambda expressions, Featherweight Java, Gradual Typing, Intersection Types
Pedro Ângelo, Viviana Bono, Mariangiola Dezani-Ciancaglini, Mário Florido
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2318/1948715
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? ND
social impact