<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Language on Siddharth Mishra</title><link>http://brightprogrammer.in/tags/language/</link><description>Recent content in Language on Siddharth Mishra</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 01 May 2026 20:09:23 -0700</lastBuildDate><atom:link href="http://brightprogrammer.in/tags/language/index.xml" rel="self" type="application/rss+xml"/><item><title>Lambda Calculus - Equivalences &amp; Reductions</title><link>http://brightprogrammer.in/posts/2-lambda-calculus-equivalences-and-reductions/</link><pubDate>Thu, 06 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/2-lambda-calculus-equivalences-and-reductions/</guid><description>&lt;p>This section is important, because we&amp;rsquo;ll learn how are applications performed on given
lambda expressions.&lt;/p>
&lt;div class="notice notice-info">
 &lt;p class="notice-title">Info&lt;/p>
 &lt;div class="notice-body">TL;DR, to apply a lambda term in a lambda expression, we use a series
of reductions. These reductions come from corresponding equivalence relations.
A reduction is just another way of replacing the lambda expression with a corresponding
equivalent expression.&lt;/div>
&lt;/div>

&lt;h1 id="equivalence">Equivalence&lt;/h1>
&lt;p>When considering equivalence of two expressions, they can be equivalent in four ways&lt;/p>
&lt;ul>
&lt;li>$\alpha$-equivalence - Renaming of bound variables&lt;/li>
&lt;li>$\beta$-equivalence - Function application and reduction&lt;/li>
&lt;li>$\eta$-equivalence - Function extensionality&lt;/li>
&lt;li>syntactic equivalence&lt;/li>
&lt;/ul>
&lt;p>These equivalences are basically the equivalence relations we talked about above.
Using a series of these equivalence relations between two lambda expressions, we can
apply reductions to source lambda expression, and then reach a final, target expression
from a source expression.&lt;/p></description></item><item><title>Lambda Calculus - Fixed Point Theorem</title><link>http://brightprogrammer.in/posts/5-lambda-calculus-fixed-point-theorem/</link><pubDate>Thu, 06 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/5-lambda-calculus-fixed-point-theorem/</guid><description>&lt;h2 id="fixed-point-theorem">Fixed Point Theorem&lt;/h2>
&lt;blockquote>
&lt;p>$ \forall F \quad \exists X \mid FX = X $&lt;/p>
&lt;p>For all lambda expression $F$, there exists another lambda expression $X$, such that $FX = X$, meaning when $F$ is
applied over $X$ we get $X$ (itself).&lt;/p>&lt;/blockquote>
&lt;ul>
&lt;li>Let&amp;rsquo;s take $F = \lambda x . x$ (the identity abstraction), Then any lambda expression can take place of $X$.&lt;/li>
&lt;li>Now consider $F = \lambda x . y$, then we have $X \equiv y$, because $(\lambda x . y)y = y$.&lt;/li>
&lt;li>If $F = \lambda x . xy$, then? Then can use $X \stackrel{\beta}{=} \lambda y . X$, because $FX \equiv (\lambda x . xy)(\lambda y . X) \stackrel{\beta}{\rightarrow} (\lambda y . X) y \stackrel{\beta}{\rightarrow} X$.&lt;/li>
&lt;li>What if $F = \lambda x . xx$ then? We have $X \stackrel{\beta}{=} \lambda x . x$ or $X \stackrel{\eta}{=} I$ (the identity abstraction). Then $FX = FI = II = I$.&lt;/li>
&lt;/ul>
&lt;div class="notice notice-info">
 &lt;p class="notice-title">Info&lt;/p></description></item><item><title>Lambda Calculus - Free &amp; Bound Variables</title><link>http://brightprogrammer.in/posts/3-lambda-calculus-free-and-bound-variables/</link><pubDate>Thu, 06 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/3-lambda-calculus-free-and-bound-variables/</guid><description>&lt;h1 id="free--bound-variables">Free &amp;amp; Bound Variables&lt;/h1>
&lt;p>A variable occurrence is &lt;strong>bound&lt;/strong> if it lies inside the scope of some $\lambda$ that binds it.
Otherwise it&amp;rsquo;s &lt;strong>free&lt;/strong>. Free variables are just the &amp;ldquo;inputs&amp;rdquo; a term still depends on.&lt;/p>
&lt;div class="notice notice-info">
 &lt;p class="notice-title">Info&lt;/p>
 &lt;div class="notice-body">When I say a variable is free/bound, I mean the &lt;strong>occurrence&lt;/strong>. The same symbol can be both free
and bound inside the same expression.&lt;/div>
&lt;/div>

&lt;h2 id="definitions">Definitions&lt;/h2>
&lt;p>We can define the set of free variables $\text{FV}(M)$ and bound variables $\text{BV}(M)$ inductively:&lt;/p></description></item><item><title>Lambda Calculus - Logic</title><link>http://brightprogrammer.in/posts/4-lambda-calculus-logic/</link><pubDate>Thu, 06 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/4-lambda-calculus-logic/</guid><description>&lt;h2 id="logic">Logic&lt;/h2>
&lt;h3 id="if-else">If, Else&lt;/h3>
&lt;p>Let&amp;rsquo;s build some boolean login out of power of pure combinations. Unlike usual logic, we won&amp;rsquo;t get
&lt;code>true&lt;/code>/&lt;code>false&lt;/code> as values. Here &lt;code>true&lt;/code> and &lt;code>false&lt;/code> are lambda abstractions itself.&lt;/p>
&lt;ul>
&lt;li>$\text{True} \stackrel{\beta}{=} \lambda xy.x$ - Meaning, take two values, and evaluate to only the first one.&lt;/li>
&lt;li>$\text{False}\stackrel{\beta}{=} \lambda xy.y$ - Take two, and evaluate to only the second one, discarding the first.&lt;/li>
&lt;/ul>
&lt;p>These are often called $\text{First}$ and $\text{Second}$ correspondingly for these reasons. So we can write
$\text{First} \equiv \text{True}$ and $\text{Second} \equiv \text{False}$.&lt;/p></description></item><item><title>Lambda Calculus - Grammar &amp; Terms</title><link>http://brightprogrammer.in/posts/1-lambda-calculus-conversion/</link><pubDate>Tue, 04 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/1-lambda-calculus-conversion/</guid><description>&lt;h1 id="introduction">Introduction&lt;/h1>
&lt;p>Lambda calculus, just like any other programming language out there is a programming language. In fact it&amp;rsquo;s the simplest
programming language there is. It&amp;rsquo;s even simpler than assembly.&lt;/p>
&lt;div class="notice notice-tip">
 &lt;p class="notice-title">Tip&lt;/p>
 &lt;div class="notice-body">Whenever we compare something, it must be in respect with some common property.
Saying one this is better than other, or one is easier than other is meaningless.&lt;/div>
&lt;/div>

&lt;p>Lambda calculus is simpler than any language with respect to types of instructions available. Lambda calculus
has just two instructions :&lt;/p></description></item><item><title>Fixing Recursions In Grammar</title><link>http://brightprogrammer.in/posts/fixing-recursions-in-grammar/</link><pubDate>Sat, 01 Feb 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/fixing-recursions-in-grammar/</guid><description>&lt;h1 id="edit-12th-feb-2025">Edit 12th Feb 2025&lt;/h1>
&lt;div class="notice notice-info">
 &lt;p class="notice-title">Info&lt;/p>
 &lt;div class="notice-body">So, it turns out the actual grammar is more complex than what I initially thought. There seems to be a kind-of &lt;em>&lt;strong>induced recursion&lt;/strong>&lt;/em>
due to mutual recursion between rule $\text{prefix}$, $\text{template-prefix}$ and $\text{prefix}$, $\text{closure-prefix}$.
If you&amp;rsquo;re reading this post for the first time, just disregard this message.&lt;/div>
&lt;/div>

&lt;p>&lt;a href="#further-reading">\[
\text{A long-standing issue regarding algorithms that manipulate} \\
\text{context-free grammars (CFGs) in a “top-down” left-to-right fashion} \\
\text{is that left recursion can lead to nontermination.} ^{\text{[1]}}
\]&lt;/a>&lt;/p></description></item></channel></rss>