Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thamugadi/call-cc-krivine
A Krivine machine for the call-by-name reduction of lambda calculus (+ call/cc) expressions in Haskell.
https://github.com/thamugadi/call-cc-krivine
call-cc haskell krivine-machine lambda-calculus
Last synced: 2 months ago
JSON representation
A Krivine machine for the call-by-name reduction of lambda calculus (+ call/cc) expressions in Haskell.
- Host: GitHub
- URL: https://github.com/thamugadi/call-cc-krivine
- Owner: thamugadi
- License: gpl-3.0
- Created: 2023-01-01T20:46:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T17:53:16.000Z (12 months ago)
- Last Synced: 2024-02-26T19:04:14.333Z (12 months ago)
- Topics: call-cc, haskell, krivine-machine, lambda-calculus
- Language: Haskell
- Homepage:
- Size: 65.4 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# call-cc-krivine
**Work in progress.**
[A web version, compiled with the GHC 9.6 Javascript build, is available here](https://aramya.neocities.org/)
A Krivine machine for the call-by-name reduction of lambda calculus (with call/cc & clock) expressions in Haskell.
``t ⋆ π`` describes a state, where ``t`` is a term and ``π`` is a stack of terms. Pushing ``u`` on ``π`` is written ``u : π``. ``n`` is the number of instructions executed so far.
To implement ``call/cc``, we allow ourselves to have a term that carries a stack in the form ``continuation π``.*Before* |*After*|
|- |-
|``t s ⋆ π`` | ``t ⋆ s : π``
|``λx.t ⋆ s : π`` | ``t[x := s] ⋆ π``
|``call/cc ⋆ f : π`` |``f ⋆ continuation π : π``
| ``continuation π₁ ⋆ s : π₂`` | ``s ⋆ π₁``
| ``clock ⋆ s : π`` | ``s ⋆ n : π``