Formalizing Box Inference for Capture Calculus

06/10/2023
by   Yichen Xu, et al.
0

Capture calculus has recently been proposed as a solution to effect checking, achieved by tracking the captured references of terms in the types. Boxes, along with the box and unbox operations, are a crucial construct in capture calculus, which maintains the hygiene of types and improves the expressiveness of polymorphism over capturing types. Despite their usefulness in the formalism, boxes would soon become a heavy notational burden for users when the program grows. It thus necessitates the inference of boxes when integrating capture checking into a mainstream programming language. In this paper, we develop a formalisation of box inference for capture calculus. We begin by introducing a semi-algorithmic variant of the capture calculus, from which we derive an inference system where typed transformations are applied to complete missing box operations in programs. Then, we propose a type-level system that performs provably equivalent inference on the type level, without actually transforming the program. In the metatheory, we establish the relationships between these systems and capture calculus, thereby proving both the soundness and the completeness of box inference.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/11/2023

A Mechanized Theory of the Box Calculus

The capture calculus is an extension of System F<: that tracks free vari...
research
01/11/2012

A Well-typed Lightweight Situation Calculus

Situation calculus has been widely applied in Artificial Intelligence re...
research
07/07/2022

Scoped Capabilities for Polymorphic Effects

Type systems usually characterize the shape of values but not their free...
research
07/22/2021

A Typed Slicing Compilation of the Polymorphic RPC Calculus

The polymorphic RPC calculus allows programmers to write succinct multit...
research
08/14/2019

Undecidability of D_<: and Its Decidable Fragments

Dependent Object Types (DOT) is a calculus with path dependent types, in...
research
08/14/2023

Degrees of Separation: A Flexible Type System for Data Race Prevention

Data races are a notorious problem in parallel programming. There has be...
research
02/12/2021

Complete Bidirectional Typing for the Calculus of Inductive Constructions

This article presents a bidirectional type system for the Calculus of In...

Please sign up or login with your details

Forgot password? Click here to reset