Universal Lambda Machine: Difference between revisions

m
no edit summary
imported>Tromp
mNo edit summary
imported>Tromp
mNo edit summary
Line 2:
One of the foundational mathematical constructs behind computer science is the universal machine, as a machine that can emulate the behaviour of any other machine, given a description of it. Alan Turing introduced the idea of a universal Turing machine in 1936–1937.
 
The lambda calculus is an even older, and in many ways simpler, model of computation. That simplicity is reflected in the Binary Lambda Calculus (BLC for short), which describes lambda terms with binary tokens 00 for lambda, 01 for application, and 1^n0 for variable n (which binds to the n'th enclosing lambda). BLC also specifies a way to represent bits and lists as lambda terms, which provides for a simple I/O convention.
 
BLC also specifies a way to represent bits and lists as lambda terms, which provides the following I/O convention:
 
The lambda universal machine parses the binary encoding of a lambda term from the start of its input, applies that term to the remainder of input, and outputs the result interpreted as a list of bits or bytes.
 
BLC as a programming language has its own entry on Rosetta Code at https://rosettacode.org/wiki/Category:Binary_Lambda_Calculus which links to more detailed descriptions of the language.
 
;Task:
Simulate the universal lambda machine Or in other words, write a BLC interpreter. Support either bit-mode or byte-mode, or preferably both, (with byte-mode as the default, and a -b command line flag for bit mode).
 
To test your universal lambda machine, you should execute the following BLC programs.
Anonymous user