pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/BinderDavid/pointer-abstract-machine

n="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b55097560d244c08.css" /> GitHub - BinderDavid/pointer-abstract-machine: The Pointer Abstract Machine from Sec. 9 of Curien & Herbelin's "The Duality of Computation" · GitHub
Skip to content

BinderDavid/pointer-abstract-machine

Repository files navigation

Pointer Abstract Machine

CI

The pointer abstract machine was first developed by Danos and Regnier. This is a very simple implementation of the variant described in section 9 of the paper "The Duality of Computation" by Pierre-Louis Curien and Hugo Herbelin.

How to use

Use stack in order to build the project:

stack build

Use stack run in order to execute one of the examples defined in app/Main.hs:

stack run ex2

Stepping through an example

Press Enter to step through the program:

stack run ex3
Computing command < μ α.< λx.x | ~μ y.< y | α > > | ~μ x.< x | □ > >

Initial State:
┌───────────────────────────────────────────────────────────────────────────────
│ Term: μ α.< λx.x | ~μ y.< y | α > >{-1}
│ Cont: ~μ x.< x | □ >{-1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│
└───────────────────────────────────────────────────────────────────────────────


Step 1: Evaluated a cut between a mu abstraction and a continuation.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: λx.x{0}
│ Cont: ~μ y.< y | α >{0}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│ •  • 0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 2: Evaluated a cut between a term and a tilde mu abstraction.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: y{1}
│ Cont: α{1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│ •  • 1 ⟼ y : λx.x{0}
│      0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 3: Evaluated a term variable by looking up the value in the stack.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: λx.x{0}
│ Cont: α{1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│    • 1 ⟼ y : λx.x{0}
│ •    0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 4: Evaluated a continuation variable by looking up the value in the stack.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: λx.x{0}
│ Cont: ~μ x.< x | □ >{-1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│      1 ⟼ y : λx.x{0}
│ •    0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 5: Garbage collection: Popped the top of the stack.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: λx.x{0}
│ Cont: ~μ x.< x | □ >{-1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│ •    0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 6: Evaluated a cut between a term and a tilde mu abstraction.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: x{1}
│ Cont: □{1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│ •  • 1 ⟼ x : λx.x{0}
│      0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Step 7: Evaluated a term variable by looking up the value in the stack.
┌───────────────────────────────────────────────────────────────────────────────
│ Term: λx.x{0}
│ Cont: □{1}
├───────────────────────────────────────────────────────────────────────────────
│ Stack:
│    • 1 ⟼ x : λx.x{0}
│ •    0 ⟼ α : ~μ x.< x | □ >{-1}
└───────────────────────────────────────────────────────────────────────────────


Computation finished.

About

The Pointer Abstract Machine from Sec. 9 of Curien & Herbelin's "The Duality of Computation"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy