3 ms·
Here is Church factorial in graphical notation: ┬────────────────────── │ ┬────────────── ─ ┬ ┬ │ ┼─┬───────┬──── ┬ │ │ │ ┼─┼───────┼─┬── │ │ │ │ │ ┼
by tromp 13y ago
Here is Church factorial in graphical notation:
┬──────────────────────
│ ┬────────────── ─ ┬ ┬
│ ┼─┬───────┬──── ┬ │ │
│ ┼─┼───────┼─┬── │ │ │
│ │ ┼─┬─┬── ┼─┼─┬ │ │ │
│ │ ┼─┼─┼─┬ │ ├─┘ │ │ │
│ │ └─┤ ├─┘ ├─┘ │ │ │
│ │ ├─┘ │ │ │ │
│ └───┤ │ │ │ │
│ ├─────┘ │ │ │
└─────┤ │ │ │
└───────────┤ │ │
└─┤ │
└─┘
- lisper 13y agoThat's pretty cool looking, but I have no idea what I'm looking at. Does this notation have a name? Is it documented somewhere? (Hm, I wonder how hard it would be to write a parser for it. :-)
- tromp 13y agoThat's my graphical notation for lambda calculus, documented at http://www.cwi.nl/~tromp/cl/diagrams.html http://www.cwi.nl/~tromp/cl/diagrams.html Btw, here's an even shorter version of factorial: ┬──────────────── ┼─────────────┬── │ ──┬──────── ┼ ┬ │ ┬─┼─┬────── │ │ │ │ │ ┼─┬─┬── │ │ │ │ │ ┼─┼─┼─┬ │ │ │ │ │ └─┤ ├─┘ │ │ │ │ │ ├─┘ │ │ │ │ ├───┘ │ │ │ ├─┘ │ │ └─┤ │ │ └───────────┤ │ └─┘ In de-Bruijn notation it is \\2 (\\1 (2 (\\3 2 (2 1)))) (\2) (\1), which in conventional notation is \n\f.n (\x\m.m (x (\a\b.m a (a b)))) (\x.f) (\x.x)