Algebra and the Lambda Calculus (1993)
people.csail.mit.edu
people.csail.mit.edu
Doesn't mean I understood the rest of the paper... sigh :-p
What I'm still mystified by when confronted by these discussions is the way the lambda calculus is considered equivalent to a Turing machine. Is it essentially that you have these complex variable substitution schemes which can "encode" a Turing machines' tape and transitions or is there something more straightforward?
The talk Prof Wadler gave at Strange Loop is the most cited, but the talk he gave at Stanford [2] is the most interesting because Carl Hewitt was in the audience and was challenging him on the merits and long-term viability of functional programming in general vs Hewitt's Actor Model [3] for scalable concurrent computing.
[0] Curry–Howard correspondence https://en.wikipedia.org/wiki/Curry–Howard_correspondence
[1] Propositions as Types [pdf] http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-...
[2] Propositions as Types (Stanford) [video] https://www.youtube.com/watch?v=ivzpaiw26wQ Slides [pdf] http://www.inf.ed.ac.uk/teaching/courses/tspl/pat.pdf
[3] Actor Model https://en.wikipedia.org/wiki/Category:Actor_model_(computer...
https://corecursive.com/021-gods-programming-language-with-p...
But the variable substitution schemes you mention are not complex at all. The main rule is beta-reduction, which is really simple: just replace all appearances of the parameter with the value of the argument.
(λ x . (x y) x) m → (m y) m
βTo actually implement Lisp or lambda calculus in real life you need "cons", right(?), and some way to increment your equivalent to an "instruction pointer". Or else you don't have any memory or information to operate on and you don't have any way to move on to the next step. If you are doing it on paper I guess the act of moving your pen to an empty space is your cons and moving your eyes across the page is like incrementing your instruction pointer... In the idea of the turing machine this is all explicitly explained but every time I try and read about lambda calculus it seems like they just expect you to know it right away. This might seem really trivial to other people but its how I tend to think.
For example, here I'm building cons, car and cdr just to create a list, from which I'll get its second value:
(cons => car => cdr =>
// this block is my little world where I have lists
car(cdr(cons(1)(cons(2)(cons(3)(4)))))
)( // cons
carValue => cdrValue => extractor => extractor(carValue)(cdrValue)
)( // car
consValue => (consValue)(x => y => x)
)( // cdr
consValue => (consValue)(x => y => y)
)
(This is JavaScript-looking lambda calculus, so you can evaluate it in your browser's developer console).Read about church encodings to see how numbers, pairs, conditionals, etc are encoded.
;; excuse my possibly hybrid notation
(defun cons (car cdr)
(lambda (m)
(if (eq? m 'car) car
(if (eq? m 'cdr) cdr
nil))))
(defun car (obj) (obj 'car))
(defun cdr (obj) (obj 'cdr))See https://en.wikipedia.org/wiki/Church_encoding#Church_Boolean.... That page also has encodings of pairs and lists.
initial_tape = λn. 0
read tape idx = tape idx
write tape idx x = λn. if n = idx then x else (tape n)Rather, to me the significance of this paper is that it presents a novel way of "implementing the lambda calculus in an algebraic system" and provides a correspondence between the λ-calculus and the matrix model of computation:
Vector and matrix valued functions can be represented
by vectors and matrices some of whose entries are
lambda expressions.
I have been looking for a lingua franca for programming languages, a way to unify the langs and make use of the decades of wisdom encoded into our langs' Great Libs. Maybe the matrix model and linear algebra is the lingua franca I seek.(And see also Conal Elliott's "Compiling to Categories" http://conal.net/papers/compiling-to-categories/ )
[1] https://en.wikipedia.org/wiki/Synchronicity
https://www.urbandictionary.com/define.php?term=Blue%20Car%2...
I think there's a name for this effect, but i can't recall it.
code -tx-> polynomial -tx-> simplification -tx-> [possibly more efficient] code
Here are some the correspondences I've been looking at...
* Graph algos in the lang of linear algebra now realized and encoded into GraphBLAS [1]
* The three normed division algebras are unified under a complex Hilbert space [2]
* Ascent sequences and the bijections discovered between four classes of combinatorial objects [3]
* Dependent Types and Homotopy Type Theory [4]
* Bruhat–Tits buildings, symmetry, and spatial decomposition [5]
* Distributed lattices, topological encodings, and succinct representations [6]
* Zonotopes and Matroids and Minkowski Sums [7]
* Holographic associative memory and entanglement renormalization [8]
[1] Graph Algorithms in the Language of Linear Algebra (Jeremy Kepner) http://www.mit.edu/~kepner/ Discussion: https://news.ycombinator.com/item?id=18099520
[2] Division Algebras and Quantum Theory (John Baez) http://math.ucr.edu/home/baez/rch.pdf
[3] (2 + 2)-free posets, ascent sequences and pattern avoiding permutations [pdf] https://www.sciencedirect.com/science/article/pii/S009731650...
[4] Cartesian Cubical Computational Type Theory: Constructive Reasoning with Paths and Equalities [pdf] https://www.cs.cmu.edu/~rwh/papers/cartesian/paper.pdf
[5] Bruhat–Tits buildings and p-adic Lie groups https://en.wikipedia.org/wiki/Building_(mathematics)
[6] Distributive lattices and Stone-space dualities https://en.wikipedia.org/wiki/Distributive_lattice#Represent...
[7] Solving Low-Dimensional Optimization Problems via Zonotope Vertex Enumeration [video] https://www.youtube.com/watch?v=NH_CpMYe3tw https://en.wikipedia.org/wiki/Zonohedron
[8] Entanglement Renormalization (G Vidal) https://authors.library.caltech.edu/9242/1/VIDprl07.pdf?hovn... Holography https://en.wikipedia.org/wiki/Holographic_associative_memory
Google Scholar: https://scholar.google.com/scholar?q=related:Yi-GtarGxh0J:sc...
Which actor model are you talking about? The variants are very different and Hewitt's original paper is mainly referenced for coming up with the name rather and kicking off the field than inventing a usable model.
Type theory is even vaster. Are we talking homotopy type theory? Calculus of constructions? System F?
http://www.haskellforall.com/2014/09/morte-intermediate-lang...
Basically, it's a calculus of constructions that guarantees equivalent funtions get compiled to the same thing. It's really intended as an intermediate form for some higher-level language, and we have Annah as just such an example: