/hazel

Primary LanguageCoqGNU General Public License v3.0GPL-3.0

Hazel - A Separation Logic for Effect Handlers

This repository contains the Coq formalization of the following papers:

Installation

To build the Hazel project you can follow the instructions in the file INSTALL.md.

These instructions show you how to create a separate opam switch with the necessary packages to build the project, thus keeping your previous switches clean.

Alternatively, you can install the packages by yourself according to their versions as listed in the file opam.

Repository Structure

Preliminaries

Language

Program Logic

Case studies

  • case_studies/iteration.v: Introduction of tools to specify iteration in the presence of effects. Specification of higher-order iteration methods and lazy sequences.
  • case_studies/callcc.v: Implementation of callcc and throw using multi-shot continuations; statement and proof of reasoning rules for this encoding; and verification of programs exploiting callcc/throw, including Delbianco and Nanevski's inc3 and Filinski's shift/reset.
  • case_studies/control_inversion.v: Verification of two implementations of invert: a function that transforms iteration methods into lazy sequences. The first implementation is based on effect handlers and the second one is based on callcc.
  • case_studies/shallow_as_deep.v: Verification of the encoding of shallow handlers using deep handlers.
  • case_studies/exceptions.v: Verification of the encoding of exceptions using effect handlers.
  • case_studies/state.v: Verification of the implementation of a mutable cell using effect handlers in state-passing style.
  • case_studies/shift_reset.v: Reasoning rules for an effect-handler--based encoding of shift and reset.
  • case_studies/asynchronous_computation.v: Verification of a library for asynchronous computation.
  • case_studies/automatic_differentiation.v: Verification of a minimalist reverse-mode automatic differentiation library.