From b9b680585e6be81cc884b09beb8169ec2d91a4e0 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sat, 22 Jun 2024 08:50:51 -0600 Subject: [PATCH] beta-normal forms and ARSs. --- .../plugins/obsidian-to-anki-plugin/data.json | 18 ++-- notes/_journal/2024-06-22.md | 12 +++ notes/c17/declarations.md | 2 +- notes/lambda-calculus/alpha-conversion.md | 7 ++ notes/lambda-calculus/beta-reduction.md | 99 +++++++++++++++++++ notes/lambda-calculus/index.md | 16 +++ notes/logic/equiv-trans.md | 16 --- notes/programming/ars.md | 65 ++++++++++++ notes/proofs/induction.md | 2 +- 9 files changed, 211 insertions(+), 26 deletions(-) create mode 100644 notes/_journal/2024-06-22.md create mode 100644 notes/programming/ars.md diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index 5c8169b..eda61ad 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -180,7 +180,7 @@ "_journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", "_journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", "_journal/2024-01-31.md": "7c7fbfccabc316f9e676826bf8dfe970", - "logic/equiv-trans.md": "c52d0907d35d7a3c2e4576f2bd411257", + "logic/equiv-trans.md": "64b6110fdfb3d2c254de6d2dc6d7f312", "_journal/2024-02-07.md": "8d81cd56a3b33883a7706d32e77b5889", "algorithms/loop-invariants.md": "cbefc346842c21a6cce5c5edce451eb2", "algorithms/loop-invariant.md": "3b390e720f3b2a98e611b49a0bb1f5a9", @@ -256,7 +256,7 @@ "c17/strings.md": "f3cc8bd2d8c0e771079dc846d3015b42", "c17/index.md": "78576ee41d0185df82c59999142f4edb", "c17/escape-sequences.md": "a8b99070336878b4e8c11e9e4525a500", - "c17/declarations.md": "3ed374b028112c554bb4ee96f9f65231", + "c17/declarations.md": "ab6d44e48b0c1c8d98cd409721cc2c53", "algorithms/sorting/merge-sort.md": "6506483f7df6507cee0407bd205dbedd", "_journal/2024-02-24.md": "9bb319d5014caf962a9ce3141076cff4", "_journal/2024-02/2024-02-23.md": "0aad297148e8cc4058b48b7e45787ca7", @@ -413,7 +413,7 @@ "programming/index.md": "bb082325e269a95236aa6aff9307fe59", "_journal/2024-04-30.md": "369f98b9d91de89cc1f4f581bc530c0d", "_journal/2024-04/2024-04-29.md": "b4fa2fd62e1b4fe34c1f71dc1e9f5b0b", - "proofs/induction.md": "d7f456e0a696fa89198bbf6661a5f616", + "proofs/induction.md": "25b195c80df87aac399cf1234389ef9e", "proofs/index.md": "51a7bc4e30b7a6cc0d4c5712ad603448", "_journal/2024-05-01.md": "959ff67fe3db585ba6a7b121d853bbac", "_journal/2024-05-02.md": "d7d6ba7e065d807986f0bd77281c0bb1", @@ -512,8 +512,8 @@ "_journal/2024-06/2024-06-06.md": "db3407dcc86fa759b061246ec9fbd381", "_journal/2024-06-08.md": "b20d39dab30b4e12559a831ab8d2f9b8", "_journal/2024-06/2024-06-07.md": "c6bfc4c1e5913d23ea7828a23340e7d3", - "lambda-calculus/alpha-conversion.md": "e87b499517c2471cae4717703ca3aba0", - "lambda-calculus/index.md": "756c93b8717fd00b04f8a99509066486", + "lambda-calculus/alpha-conversion.md": "5fd232190961830498348fc6137e881a", + "lambda-calculus/index.md": "64efe9e4f6036d3f5b4ec0dc8cd3e7b9", "x86-64/instructions/condition-codes.md": "56ad6eb395153609a1ec51835925e8c9", "x86-64/instructions/logical.md": "818428b9ef84753920dc61e5c2de9199", "x86-64/instructions/arithmetic.md": "271218d855e7291f119f96e91f582738", @@ -536,7 +536,7 @@ "set/functions.md": "9fc813971de5fdda7aaac0cf91a721ad", "_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4", "_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", - "lambda-calculus/beta-reduction.md": "aa1b302755cde85085abedbde85161df", + "lambda-calculus/beta-reduction.md": "7d001ad86d3fd77a83c0df99bcc2597b", "_journal/2024-06-16.md": "ded6ab660ecc7c3dce3afd2e88e5a725", "_journal/2024-06/2024-06-15.md": "c3a55549da9dfc2770bfcf403bf5b30b", "_journal/2024-06-17.md": "63df6757bb3384e45093bf2b9456ffac", @@ -550,8 +550,10 @@ "startups/fundraising.md": "a8ba72cc16941a91f2367e96114daf15", "_journal/2024-06-20.md": "e67a8832003f0eb286dc6b5d6a916494", "_journal/2024-06/2024-06-19.md": "363852585ef0c6e7e8ee250b3ec7fc38", - "_journal/2024-06-21.md": "54dabfa53a12e0ffd4df319978401903", - "_journal/2024-06/2024-06-20.md": "12d4d8cc2f6dfa37b8d2c09095c5e636" + "_journal/2024-06-21.md": "12e37e2c57abab09c781b32793fbbe1a", + "_journal/2024-06/2024-06-20.md": "12d4d8cc2f6dfa37b8d2c09095c5e636", + "_journal/2024-06-22.md": "c389e4a19d3c498f68cabb1e84bc3213", + "programming/ars.md": "70cfc820968cc24d9f0198bc98f5f9a2" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-06-22.md b/notes/_journal/2024-06-22.md new file mode 100644 index 0000000..92f26f5 --- /dev/null +++ b/notes/_journal/2024-06-22.md @@ -0,0 +1,12 @@ +--- +title: "2024-06-22" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Notes on [[beta-reduction#Normal Form|β-normal forms]]. +* Very basic notes on [[ars|abstract rewriting systems]]. \ No newline at end of file diff --git a/notes/c17/declarations.md b/notes/c17/declarations.md index 236f514..04e2ca7 100644 --- a/notes/c17/declarations.md +++ b/notes/c17/declarations.md @@ -212,7 +212,7 @@ END%% ## Integer Literals -Negative integer literals are typed in a counterintuitive way. When the compiler sees a number of form `-X`, the type of `X` is first determined *before* then being negated. Promotion rules are as follows: +Negative integer literals are typed in a counterintuitive way. When the compiler sees a number of form `-X`, the type of `X` is determined *before* being negated. Promotion rules are as follows: Decimal | Other Bases ----------- | -------------------- diff --git a/notes/lambda-calculus/alpha-conversion.md b/notes/lambda-calculus/alpha-conversion.md index 27893bf..c348744 100644 --- a/notes/lambda-calculus/alpha-conversion.md +++ b/notes/lambda-calculus/alpha-conversion.md @@ -20,6 +20,13 @@ Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combi END%% +%%ANKI +Cloze +$P \equiv Q$ is to {equivalent} whereas $P \equiv_\alpha Q$ is to {congruent}. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + %%ANKI Basic What two ways can we pronounce $P \equiv_\alpha Q$? diff --git a/notes/lambda-calculus/beta-reduction.md b/notes/lambda-calculus/beta-reduction.md index d901b82..c9c9995 100644 --- a/notes/lambda-calculus/beta-reduction.md +++ b/notes/lambda-calculus/beta-reduction.md @@ -167,6 +167,105 @@ Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combi END%% +## Normal Form + +A term $Q$ which contains no $\beta$-redexes is called a **$\beta$-normal form** (or a **term in $\beta$-normal form** or just a **$\beta$-nf**). The class of all $\beta$-normal forms is called $\beta$-nf or $\lambda\beta$-nf. If a term $P$ $\beta$-reduces to a term $Q$ in $\beta$-nf, then $Q$ is called a **$\beta$-normal form of $P$**. + +%%ANKI +Basic +$\beta$-reduction terminates if and only if what? +Back: We reduce to a term in $\beta$-normal form. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +Is $\beta$-reduction guaranteed to terminate? +Back: No. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +Is $\beta$-reduction guaranteed to simplify? +Back: No. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +How is a $\beta$-normal form defined? +Back: As a $\lambda$-term that contains no $\beta$-redexes. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Cloze +The class of {all $\beta$-normal forms} is called {$\beta$-nf/$\lambda\beta$-nf}. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +What ambiguity does term "$\beta$-nf" introduce? +Back: It refers to a specific $\beta$-normal form or the class of $\beta$-normal forms. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +What does it mean for term $Q$ to be a $\beta$-normal form of term $P$? +Back: $P$ $\beta$-reduces to a term $Q$ in $\beta$-nf. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +How is the class $\beta$-nf alternatively denoted? +Back: As $\lambda\beta$-nf. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +How is the class $\lambda\beta$-nf alternatively denoted? +Back: As $\beta$-nf. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +What is the $\beta$-normal form of $(\lambda x. x(xy))N$? +Back: $N(Ny)$ +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +What is the $\beta$-normal form of $(\lambda x. xx)(\lambda x. xx)$? +Back: N/A. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +How many $\beta$-reductions can a term have? +Back: One or more. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + ## Bibliography * Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). \ No newline at end of file diff --git a/notes/lambda-calculus/index.md b/notes/lambda-calculus/index.md index d5a9ce6..336ce54 100644 --- a/notes/lambda-calculus/index.md +++ b/notes/lambda-calculus/index.md @@ -777,6 +777,22 @@ Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combi END%% +%%ANKI +Basic +Is $(\lambda x. xy)N \equiv Ny$? +Back: No. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + +%%ANKI +Basic +Is $[N/x]xy \equiv Ny$? +Back: Yes. +Reference: Hindley, J Roger, and Jonathan P Seldin. “Lambda-Calculus and Combinators, an Introduction,” n.d. [https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf](https://www.cin.ufpe.br/~djo/files/Lambda-Calculus%20and%20Combinators.pdf). + +END%% + For all $\lambda$-terms $M$, $N$, and variables $x$: * $[x/x]M \equiv M$ diff --git a/notes/logic/equiv-trans.md b/notes/logic/equiv-trans.md index 9ce5ed1..8f1fc26 100644 --- a/notes/logic/equiv-trans.md +++ b/notes/logic/equiv-trans.md @@ -830,22 +830,6 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -%%ANKI -Basic -Given valid expression $(b; [i]{\circ}s{:}e)$, what is the type of $b$? -Back: A function (an array). -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Given valid expression $(b; \epsilon{:}e)$, what is the type of $b$? -Back: A function or scalar. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - %%ANKI Basic What is the base case of selector update syntax? diff --git a/notes/programming/ars.md b/notes/programming/ars.md new file mode 100644 index 0000000..e9e27fe --- /dev/null +++ b/notes/programming/ars.md @@ -0,0 +1,65 @@ +--- +title: Abstract Rewriting Systems +TARGET DECK: Obsidian::STEM +FILE TAGS: ars +tags: + - ars +--- + +## Overview + +In an **abstract rewriting system** (ARS), an object is said to be in **normal form** if it cannot be rewritten any further, i.e. it is irreducible. An object is said to be in **canonical form** if it is presented in the "standard" representation (where "standard" is defined per field). + +In most fields, a canoncial form specifies a *unique* representation. + +%%ANKI +Basic +What is ARS an acronym for? +Back: **A**bstract **R**ewriting **S**ystem. +Reference: “Normal Form,” in _Wikipedia_, April 27, 2024, [https://en.wikipedia.org/w/index.php?title=Normal_form](https://en.wikipedia.org/w/index.php?title=Normal_form_(abstract_rewriting)&oldid=1221094193). + +END%% + +%%ANKI +Basic +Canonical/normal forms are associated with what general class of abstract systems? +Back: Abstract rewriting systems. +Reference: “Canonical Form,” in _Wikipedia_, January 7, 2024, [https://en.wikipedia.org/w/index.php?title=Canonical_form](https://en.wikipedia.org/w/index.php?title=Canonical_form&oldid=1194093963). + +END%% + +%%ANKI +Basic +What does it mean for an object to be in normal form? +Back: It cannot be rewritten any further, i.e. it is irreducible. +Reference: Normal Form,” in _Wikipedia_, April 27, 2024, [https://en.wikipedia.org/w/index.php?title=Normal_form](https://en.wikipedia.org/w/index.php?title=Normal_form_(abstract_rewriting)&oldid=1221094193). +END%% + +%%ANKI +Basic +What does it mean for an object to be in canonical form? +Back: It is presented in the "standard" way with respect to the field its presented in. +Reference: “Canonical Form,” in _Wikipedia_, January 7, 2024, [https://en.wikipedia.org/w/index.php?title=Canonical_form](https://en.wikipedia.org/w/index.php?title=Canonical_form&oldid=1194093963). + +END%% + +%%ANKI +Basic +What two assumptions are usually associated with an object in canonical form? +Back: It is as simply represented as possible and it is uniquely identifying. +Reference: “Canonical Form,” in _Wikipedia_, January 7, 2024, [https://en.wikipedia.org/w/index.php?title=Canonical_form](https://en.wikipedia.org/w/index.php?title=Canonical_form&oldid=1194093963). + +END%% + +%%ANKI +Basic +How do "canonical" and "normal" forms differ in most fields? +Back: The former usually specifies a unique representation for the object. +Reference: “Canonical Form,” in _Wikipedia_, January 7, 2024, [https://en.wikipedia.org/w/index.php?title=Canonical_form](https://en.wikipedia.org/w/index.php?title=Canonical_form&oldid=1194093963). + +END%% + +## Bibliography + +* “Canonical Form,” in _Wikipedia_, January 7, 2024, [https://en.wikipedia.org/w/index.php?title=Canonical_form](https://en.wikipedia.org/w/index.php?title=Canonical_form&oldid=1194093963). +* Normal Form,” in _Wikipedia_, April 27, 2024, [https://en.wikipedia.org/w/index.php?title=Normal_form](https://en.wikipedia.org/w/index.php?title=Normal_form_(abstract_rewriting)&oldid=1221094193). diff --git a/notes/proofs/induction.md b/notes/proofs/induction.md index 27cb2ca..34eaece 100644 --- a/notes/proofs/induction.md +++ b/notes/proofs/induction.md @@ -119,7 +119,7 @@ END%% %%ANKI Basic -What contradiction is introduced to explain why the strong induction assumption is valid? +What negation is introduced to explain why the strong induction assumption is valid? Back: If $P(n)$ is not true for all $n$, there exists a *first* $n_0$ for which $\neg P(n_0)$. Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).