Some of the things I've learned every day since Oct 10, 2016
Category Archives: computation
January 21, 2017Posted by on
Given a type system, the top type is the type which contains every possible value in that type system, making every other type a subtype of .
By contrast, the bottom type is the type which contains no values, making every other type a supertype of .
January 18, 2017Posted by on
The Liskov Substitution Principle makes the intuitive generalization that if are types and ( is a subtype of ), then in a program with this type system, objects from can be substituted with objects from without certain properties of the program being affected.
December 18, 2016Posted by on
A term within a rewriting system (such as one in the lambda calculus) is confluent if, for any pair of terms such that and (where means is a reduct of under 0 or more reductions), there exists a term such that and . If every term in a system is confluent, the system itself is said to be confluent.
Systems which are both confluent and terminating are especially nice, because any sequence of reductions can be applied to a given term with the resulting irreducible reduct being the same.
December 12, 2016Posted by on
In programming, homoiconicity a property of languages in which programs are represented as instances of a data structure of a primitive type of the language. This takes advantage of the fact that the information of programs and data can be carried through the same medium by storing a program’s code in a form that the language knows how to access and manipulate.
This can make metaprogramming much easier than it otherwise would be. A good example of a language exhibiting homoiconicity is LISP, where everything is represented as a list (S-expression). Since both programs and data are stored as lists, a LISP program can manipulate another program as easily as it would any data.
December 3, 2016Posted by on
Newman’s Lemma, also known as the Diamond Lemma, states that if a rewriting system is terminating (is strongly normalizing), then that system is locally confluent if and only if it is confluent.
November 30, 2016Posted by on
In general, there is no algorithm which determines whether two lambda expressions are equivalent under the reduction rules of the lambda calculus. This is the problem for which the first proof of undecidability was given.
November 29, 2016Posted by on
In a rewrite system, such as -reduction in the lambda calculus, a term may or may not satisfy either the weak normalization or the strong normalization property.
A term satisfies the weak normalization property if there exists a sequence of rewrites on that eventually results in a normal form of : a term which is irreducible.
A term satisfies the strong normalization property if every sequence of rewrites on eventually results in a normal form of .
If every term in a rewrite system satisfies the [weak | strong] normalization property, then the system itself is said to satisfy the same property.
An example of a system which satisfies neither of the normalization properties is the pure untyped lambda calculus. An example of a non-normal term within this system is
Under -reduction, this term reduces to itself, and so it never terminates in an irreducible form.
Conversely, a term within this system which is weakly normal is
Under -reduction, this term reduces to just the variable , an irreducible term.
There are other forms of the lambda calculus, as well as other similar systems, which are normal. These can be viewed as programming languages in which every program eventually will (or can) terminate. A significant drawback to such a system, however, is that if a system is normal it cannot be Turing complete.
Additionally, in the lambda calculus every normalizing term has a unique normal form.