Published June 15, 2020 | Version 1.0
Conference paper Open

SFJ: An implementation of Semantic Featherweight Java

  • 1. University of Glasgow


There are two approaches to defining subtyping relations: the syntactic and the semantic approach. In semantic subtyping, one defines a model of the language and an interpretation of types as subsets of this model. Subtyping is defined as inclusion of subsets denoting types. An orthogonal subtyping question, typical of object-oriented languages, is the nominal versus the structural subtyping. Dardha et al. [11,12] defined boolean types and semantic subtyping for Featherweight Java (FJ) and integrated both nominal and structural subtyping, thus exploiting the benefits of both approaches. However, these benefits were illustrated only at a theoretical level, but not exploited practically. We present SFJ—Semantic Featherweight Java, an implementation of FJ which features boolean types, semantic subtyping and integrates nominal as well as structural subtyping. The benefits of SFJ, illustrated in the paper and the accompanying video (with audio/subtitles) [27], show how static type-checking of boolean types and semantic subtyping gives higher guarantees of program correctness, more flexibility and compactness of program writing.



Files (447.5 kB)

Name Size Download all
447.5 kB Preview Download

Additional details


BEHAPI – Behavioural Application Program Interfaces 778233
European Commission
From Data Types to Session Types---A Basis for Concurrency and Distribution EP/K034413/1
UK Research and Innovation