You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/new_book.html
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -16526,18 +16526,25 @@ <h2 id="curryhowardlambek-the-trinity">12.10 Curry–Howard–Lambek: The
16526
16526
<h3 id="what-the-correspondence-means">What the Correspondence
16527
16527
Means</h3>
16528
16528
<p>A <strong>cartesian closed category</strong> (CCC) – a category with
16529
-
products, exponentials, and a terminal object – is simultaneously: 1. A
16530
-
model of propositional logic (the internal logic of the category) 2. A
16531
-
model of the simply-typed lambda calculus (types are objects, terms are
16532
-
morphisms) 3. A category with enough structure to interpret all of
16533
-
functional programming</p>
16529
+
products, exponentials, and a terminal object – is simultaneously:</p>
16530
+
<ol type="1">
16531
+
<li>A model of propositional logic (the internal logic of the
16532
+
category)</li>
16533
+
<li>A model of the simply-typed lambda calculus (types are objects,
16534
+
terms are morphisms)</li>
16535
+
<li>A category with enough structure to interpret all of functional
16536
+
programming</li>
16537
+
</ol>
16534
16538
<p>The OCaml type system lives in this world. When we write
16535
16539
<code>let f : 'a * 'b -> 'b * 'a = fun (x, y) -> (y, x)</code>, we
16536
-
are simultaneously: - <strong>Proving</strong> the logical tautology
16537
-
<span class="math inline">A \wedge B \Rightarrow B \wedge A</span> -
16538
-
<strong>Programming</strong> the swap function on pairs -
16539
-
<strong>Constructing</strong> a morphism <span class="math inline">A
16540
-
\times B \to B \times A</span> in a CCC</p>
16540
+
are simultaneously:</p>
16541
+
<ul>
16542
+
<li><strong>Proving</strong> the logical tautology <span
16543
+
class="math inline">A \wedge B \Rightarrow B \wedge A</span></li>
16544
+
<li><strong>Programming</strong> the swap function on pairs</li>
16545
+
<li><strong>Constructing</strong> a morphism <span class="math inline">A
16546
+
\times B \to B \times A</span> in a CCC</li>
16547
+
</ul>
16541
16548
<div class="sourceCode" id="cb493"><pre
16542
16549
class="sourceCode ocaml"><code class="sourceCode ocaml"><span id="cb493-1"><a href="#cb493-1" aria-hidden="true" tabindex="-1"></a><span class="co">(* Programs that are simultaneously logical proofs *)</span></span>
16543
16550
<span id="cb493-2"><a href="#cb493-2" aria-hidden="true" tabindex="-1"></a><span class="co">(* and morphisms in a cartesian closed category: *)</span></span>
0 commit comments