A Co-contextual Type Checker for Featherweight Java (incl. Proofs)

by   Edlira Kuci, et al.

This paper addresses compositional and incremental type checking for object-oriented programming languages. Recent work achieved incremental type checking for structurally typed functional languages through co-contextual typing rules, a constraint-based formulation that removes any context dependency for expression typings. However, that work does not cover key features of object-oriented languages: Subtype polymorphism, nominal typing, and implementation inheritance. Type checkers encode these features in the form of class tables, an additional form of typing context inhibiting incrementalization. In the present work, we demonstrate that an appropriate co-contextual notion to class tables exists, paving the way to efficient incremental type checkers for object-oriented languages. This yields a novel formulation of Igarashi et al.'s Featherweight Java (FJ) type system, where we replace class tables by the dual concept of class table requirements and class table operations by dual operations on class table requirements. We prove the equivalence of FJ's type system and our co-contextual formulation. Based on our formulation, we implemented an incremental FJ type checker and compared its performance against javac on a number of realistic example programs.


page 1

page 2

page 3

page 4


Induction, Coinduction, and Fixed Points in PL Type Theory

Recently we presented a concise survey of the formulation of the inducti...

Types for Tables: A Language Design Benchmark

Context: Tables are ubiquitous formats for data. Therefore, techniques f...

Aplib: Tactical Programming of Intelligent Agents

This paper presents aplib, a Java library for programming intelligent ag...

Modeling the Invariance of Virtual Pointers in LLVM

Devirtualization is a compiler optimization that replaces indirect (virt...

A Type System for First-Class Layers with Inheritance, Subtyping, and Swapping

Context-Oriented Programming (COP) is a programming paradigm to encourag...

Type checking extracted methods

Many object-oriented dynamic languages allow programmers to extract meth...

A case for DOT: Theoretical Foundations for Objects With Pattern Matching and GADT-style Reasoning

Many programming languages in the OO tradition now support pattern match...