Ill-Typed Programs Don't Evaluate

07/13/2023
by   Steven Ramsay, et al.
0

We introduce two-sided type systems, which are a particular kind of sequent calculi for typing formulas. Two-sided type systems allow for hypothetical reasoning over the typing of compound program expressions, and the refutation of typing formulas. By incorporating a type of all values, these type systems support symmetrical notions of well-typing and ill-typing, guaranteeing both that well-typed programs don't go wrong and that ill-typed programs do not evaluate - that is, reach a value. This makes two-sided type systems suitable for incorrectness reasoning in higher-order program verification, which we illustrate through an application to precise data-flow typing in a language with constructors and pattern matching. Finally, we investigate the internalisation of the meta-level negation in the system as a complement operator on types. This motivates an alternative semantics for the typing judgement, which guarantees that ill-typed programs don't evaluate, but in which well-typed programs may yet go wrong.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/18/2019

A Three-Valued Semantics for Typed Logic Programming

Types in logic programming have focused on conservative approximations o...
research
08/25/2017

Learning to Blame: Localizing Novice Type Errors with Data-Driven Diagnosis

Localizing type errors is challenging in languages with global type infe...
research
08/01/2017

Bonsai: Synthesis-Based Reasoning for Type Systems

We describe algorithms for symbolic reasoning about executable models of...
research
03/30/2022

A meta-probabilistic-programming language for bisimulation of probabilistic and non-well-founded type systems

We introduce a formal meta-language for probabilistic programming, capab...
research
11/05/2021

Pirouette: Higher-Order Typed Functional Choreographies

We present Pirouette, a language for typed higher-order functional chore...
research
12/10/2018

Relational Cost Analysis for Functional-Imperative Programs

Relational cost analysis aims at formally establishing bounds on the dif...
research
02/13/2018

A Concurrent Constraint Programming Interpretation of Access Permissions

A recent trend in object oriented (OO) programming languages is the use ...

Please sign up or login with your details

Forgot password? Click here to reset