Skip to content

A Krivine machine for the call-by-name reduction of lambda calculus (+ call/cc) expressions in Haskell.

License

Notifications You must be signed in to change notification settings

thamugadi/call-cc-krivine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

call-cc-krivine

Work in progress.

A web version, compiled with the GHC 9.6 Javascript build, is available here

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 : π

About

A Krivine machine for the call-by-name reduction of lambda calculus (+ call/cc) expressions in Haskell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published