![]() ![]() $$(times \space 3 \space 4) \Leftrightarrow 12$$ This rule define conversion of built-in constrants and functions, for example, Just eliminate a redundant $\lambda$-abstraction $$\lambda x.(e \space x) \Leftrightarrow e \quad x \notin FV(e)$$ $$\lambda x.e \Leftrightarrow \lambda y.e \quad y \notin Just subsitute $x$ with $e’$ in $e$ like normal mathematic functions. The conversion rules are defined as follows: The $\lambda$-calculus provides several conversion rules for transforming one $\lambda$-calculus into an equivalent one. $\lambda$-calculus is equivalent to Turing machines in computational power. I studied lambda-calculus for my final project in the Department of Computer Science. applying this result to anything yields K.This is a note and simple tutorial of lambda-calculus. 1] kill terms are absorbed and also increase the magnitude of bound terms Term until the substitution of all terms in the abstraction is complete. notation signifies the bound term is from the outer abstractionĪnd must be used to prevent decrementing and double replacement of the = KI -2 kill term is void due to surviving 2 term (1 2) bound terms become kill terms due to -1. 2 (1 2)] 1 was replaced with, remaining terms decremented Negative indexes are placed last in order of decreasing magnitude. Negative indexes are used for kill terms. Single positive indexes are used for bound terms. Compound abstractions reduce to a single normal form automatically, alpha reduction is not needed. The notation above is just a more compact and unambiguous way of expressing lambda abstractions. 1 ( 1 2)] 1 was replaced with, remaining terms decremented ![]() 2 (1 2 3)] 1 was replaced with, remaining terms decremented Abstractions are surrounded by 's (λmn.(λsz.ms(nsz)))(λsz.sz)(λsz.sz) Indexes are used instead of lettered terms based on the order of input. Application associates to the left, so $xyz$ is $(xy)z$.Īn alternative way of expressing a lambda abstraction and reduction.Lambda associates to the right, so $\lambda sz.sz$ is $\lambda s.(\lambda z.sz)$.The Wikipedia article gives formal definition of substitution and shows when it's necessary to rename bound variables. So first, you have to rename the bound variable first, for example to $\lambda z.xz$ and then you can safely substitute $x:=y$ to get $\lambda z.yz$. You'd get $\lambda y.yy$ which would change the meaning of the term. For example, you cannot substitute $x:=y$ into $\lambda y.xy$ because $y$ is bound under $\lambda$. ![]() Sometimes substitution is not directly possible.Substitution applies only to free variables.It is better to rename bound variables ($\alpha$-conversion) to be distinct, for example to: Note that we now have $\lambda sz$ inside $\lambda sz$ which isn't very convenient (yet allowed). Where we replaced $m$ with $\lambda sz.sz$. In your case, the first reduction would be: ![]() (Capital letters likes $M$ and $N$ are used to denote terms.) The replacement $M$ is often called contractum. It means, if you have a subterm that looks like $(\lambda x.M)N$ (called redex) you can replace it by $M$, which is $M$ with $N$ substituted for $x$. Lambda terms are simplified by the β-reduction rule: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |