[Paper Review] A program logic for higher-order procedural variables and non-local jumps
This paper presents a sound program logic for an imperative language with higher-order procedural variables and non-local jumps, leveraging the formulas-as-types correspondence for classical logic. By extending a dependent type system with dynamic-like typing through assignment, it enables a more permissive, statically checked system that supports imperative encodings of control operators like shift and reset.
Relying on the formulae-as-types paradigm for classical logic, we define a program logic for an imperative language with higher-order procedural variables and non-local jumps. Then, we show how to derive a sound program logic for this programming language. As a by-product, we obtain a non-dependent type system which is more permissive than what is usually found in statically typed imperative languages. As a generic example, we encode imperative versions of delimited continuations operators shift and reset.
Motivation & Objective
- To develop a sound program logic for imperative languages supporting higher-order procedural variables and non-local jumps.
- To relax static type systems by allowing types to evolve via assignments, mimicking dynamic typing while preserving static checking.
- To enable formal verification of imperative programs with control operators using proof-theoretic foundations.
- To provide a logical foundation for imperative continuations through a Curry-Howard-style correspondence.
Proposed method
- Extends Loopω, a pure imperative language with higher-order procedural variables, with first-order dependent types.
- Introduces a pseudo-dynamic type system where variable types change upon assignment, based on value-dependent types.
- Employs a call-by-value CPS translation to give indirect semantics to control operators like shift and reset.
- Derives a dependent imperative type system (IDc) from a functional dependent type system (FDc) via translation.
- Uses the formulas-as-types paradigm for classical logic to link program constructs with logical proofs.
- Establishes soundness and progress theorems for the resulting type system through formal metatheory.
Experimental results
Research questions
- RQ1How can a sound program logic be constructed for imperative languages with higher-order procedural variables and non-local jumps?
- RQ2Can a statically typed system achieve the expressiveness of dynamic typing in mutable variable contexts without sacrificing safety?
- RQ3How can control operators like shift and reset be formally encoded and verified in an imperative setting?
- RQ4What is the logical correspondence between imperative control flow and classical logic in a dependent type framework?
- RQ5Can a non-dependent type system be derived from a dependent one while preserving soundness and expressiveness?
Key findings
- The proposed program logic is sound and supports full verification of imperative programs with higher-order procedural variables and non-local jumps.
- The type system allows types to change via assignment, enabling initialization of uninitialized variables and avoiding default values through logical inhabitation.
- Imperative versions of shift and reset are formally encoded and type-checked using the dependent imperative type system.
- The CPS translation preserves typing and enables indirect semantics for control operators, aligning with classical logic interpretations.
- The system avoids fixpoint encoding and unbounded loops by restricting mutable variables to prevent recursion.
- The framework supports a natural simulation of global state via state-passing style, with clear logical semantics.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.