hoas-hs: A Haskell Package for Many Theoretic Calculi, Taking Advantage of Higher-Order Abstract Syntax
Environment:
- ghc 9.12.2 (or adjust the
cabal.projectfile)
Build / Repl:
cabal build
cabal replFor Nix users, this project provides a shell.nix file that prepares you with a development environment
with ghc, cabal, and hls. It should be out of the box. To start with nix, just run
nix-shelland the enter the cabal repl.
Higher-Order Abstract Syntax
Reduction Strategies:
- call by value
- call by name
- ...
Usage:
:m UTLC
reduceListInfiAuto $ fct @ 3 @ "s" @ "z"will give a reduction list to (s (s (s (s (s (s z)))))) in 1638 steps.
let binding & primitive Y combinator
-
letfor CBV and$\lambda$ for CBN
Usage:
:m UTLCext
reduceListInfiAuto $ fct @ 3 @ "s" @ "z"will give a reduction list to (s (s (s (s (s (s z)))))) in 1621 steps.
From this paper:
Grokking the Sequent Calculus (Functional Pearl)
-
$\mu$ and$\tilde{\mu}$ constructions - critical pairs
- data/codata
- higher-order function as codata
- focusing and CPS transformation
Usage:
cabal repl
:m LMM
reduceFunList $ fcall "fct" [6] []will give a reduction list to ⟨[720]|⋆⟩, representing that the calculation result is
From this introduction paper: An Introduction to Algebraic Effects and Handlers. Invited tutorial paper
... Concurrency programs.
...
...
Simple implementation and experiments of PHOAS:
Parametric higher-order abstract syntax for mechanized semantics