From 9101fa8a7a2f2298f13d176b1b4211951975949a Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Mon, 12 Aug 2024 06:44:58 -0600 Subject: [PATCH] More SET instruction flashcards. --- .../plugins/obsidian-to-anki-plugin/data.json | 32 ++- notes/_journal/2024-08-12.md | 11 + notes/_journal/{ => 2024-08}/2024-08-10.md | 2 +- notes/_journal/2024-08/2024-08-11.md | 9 + notes/c17/declarations.md | 4 +- notes/data-structures/b-tree.md | 90 ++++++- notes/encoding/floating-point.md | 3 +- notes/formal-system/index.md | 2 +- .../formal-system/proof-system/equiv-trans.md | 4 +- notes/lambda-calculus/alpha-conversion.md | 2 +- notes/lambda-calculus/beta-reduction.md | 8 +- notes/set/relations.md | 22 +- notes/x86-64/instructions/condition-codes.md | 254 +++++++++++++++++- 13 files changed, 395 insertions(+), 48 deletions(-) create mode 100644 notes/_journal/2024-08-12.md rename notes/_journal/{ => 2024-08}/2024-08-10.md (61%) create mode 100644 notes/_journal/2024-08/2024-08-11.md diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index ab0ba15..5808333 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -191,7 +191,12 @@ "b-tree-split-node.png", "b-tree-initial.png", "b-tree-inserted-b.png", - "b-tree-inserted-q.png" + "b-tree-inserted-q.png", + "church-rosser.png", + "normalized-form.png", + "denormalized-form.png", + "infinity.png", + "nan.png" ], "File Hashes": { "algorithms/index.md": "3ac071354e55242919cc574eb43de6f8", @@ -306,7 +311,7 @@ "c17/strings.md": "2da50edd26eae35c81f70e65bbd12d49", "c17/index.md": "78576ee41d0185df82c59999142f4edb", "c17/escape-sequences.md": "a8b99070336878b4e8c11e9e4525a500", - "c17/declarations.md": "eb289ab10ccb8b1a7981ceedbbdda2ad", + "c17/declarations.md": "e5b4268270bcec35e6f2e4b727c5494e", "algorithms/sorting/merge-sort.md": "6506483f7df6507cee0407bd205dbedd", "_journal/2024-02-24.md": "9bb319d5014caf962a9ce3141076cff4", "_journal/2024-02/2024-02-23.md": "0aad297148e8cc4058b48b7e45787ca7", @@ -367,7 +372,7 @@ "_journal/2024-03/2024-03-15.md": "e54b2513beac5f46313b4c37622adf39", "_journal/2024-03-17.md": "72e99c7630085aee2c7f340a06b5ada7", "_journal/2024-03/2024-03-16.md": "ab7629c24ebe70838072cf6acec47cb0", - "encoding/floating-point.md": "fcec4aaa249fe8fd90b14c3806cefbf5", + "encoding/floating-point.md": "f9db6e21f1d86539642062626388265b", "_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f", "_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b", "set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53", @@ -557,14 +562,14 @@ "_journal/2024-06/2024-06-04.md": "52b28035b9c91c9b14cef1154c1a0fa1", "_journal/2024-06-06.md": "3f9109925dea304e7172df39922cc95a", "_journal/2024-06/2024-06-05.md": "b06a0fa567bd81e3b593f7e1838f9de1", - "set/relations.md": "4d7a00c8f68d5f72b4ab365b9b553f2c", + "set/relations.md": "baf811b946bf2326d8343f126ffc6ef5", "_journal/2024-06-07.md": "795be41cc3c9c0f27361696d237604a2", "_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": "4dc6cceec27ef88ab2b256c05fc5d91d", + "lambda-calculus/alpha-conversion.md": "6df655e60976715e5c6fbbe72b628c6d", "lambda-calculus/index.md": "76d58f85c135c7df00081f47df31168e", - "x86-64/instructions/condition-codes.md": "1f59f0b81b2e15582b855d96d1d377da", + "x86-64/instructions/condition-codes.md": "77eda8d73ab458bd5ae2e6e11582be74", "x86-64/instructions/logical.md": "818428b9ef84753920dc61e5c2de9199", "x86-64/instructions/arithmetic.md": "271218d855e7291f119f96e91f582738", "x86-64/instructions/access.md": "c19bc3392cf493fcc9becf46c818cc50", @@ -586,7 +591,7 @@ "set/functions.md": "02b0f1e2a585e918e14a8ccf29fd578d", "_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4", "_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", - "lambda-calculus/beta-reduction.md": "6c9a9f4983b0974e0184acaee7c27a22", + "lambda-calculus/beta-reduction.md": "2074de1a5ab2171489239988a84b271f", "_journal/2024-06-16.md": "ded6ab660ecc7c3dce3afd2e88e5a725", "_journal/2024-06/2024-06-15.md": "c3a55549da9dfc2770bfcf403bf5b30b", "_journal/2024-06-17.md": "63df6757bb3384e45093bf2b9456ffac", @@ -672,11 +677,11 @@ "logic/classical/index.md": "ee0a4b2bfcfa2cab0880db449cb62df1", "logic/classical/truth-tables.md": "b739e2824a4a5c26ac446e7c15ce02aa", "formal-system/proof-system/index.md": "800e93b72a9852ea4823ab0a40854bba", - "formal-system/proof-system/equiv-trans.md": "abd8fe3ca5b61f0bdec0870f230734af", + "formal-system/proof-system/equiv-trans.md": "47afc3ffa0bb758d9629d9d4a401394e", "formal-system/logical-system/index.md": "708bb1547e7343c236068c18da3f5dc0", "formal-system/logical-system/pred-logic.md": "34e872f4f920bf4e8c2cd00ee95b310f", "formal-system/logical-system/prop-logic.md": "b61ce051795d5a951c763b928ec5cea8", - "formal-system/index.md": "4c3d4de525e8e3254efd208341a300b1", + "formal-system/index.md": "28b596a8ffa7dca05e8c0b890be43aec", "programming/short-circuit.md": "c256ced42dc3b493aff5a356e5383b6e", "formal-system/abstract-rewriting.md": "8424314a627851c5b94be6163f64ba30", "_journal/2024-07-22.md": "d2ca7ce0bbeef76395fee33c9bf36e9d", @@ -725,10 +730,13 @@ "_journal/2024-08/2024-08-07.md": "119c052f4109a3e098d825b771af89de", "_journal/2024-08-09.md": "2ce3e0c468f51750d8ad86a19bcc3264", "_journal/2024-08/2024-08-08.md": "b8211a4c576ff594217e2e9cae9396c0", - "data-structures/b-tree.md": "5f5e6f483ce6beca9fb3a4cd96264e22", + "data-structures/b-tree.md": "ccd4256aaef57e7c793ca72da6de5808", "data-structures/binary-tree.md": "67b0b5b9688faa205983993fe507079a", - "_journal/2024-08-10.md": "9e4c7c2c0fd9e855d5cf6b5eff18b111", - "_journal/2024-08/2024-08-09.md": "2ce3e0c468f51750d8ad86a19bcc3264" + "_journal/2024-08-10.md": "08e7ea4a78c46645b93ec51e2372d04f", + "_journal/2024-08/2024-08-09.md": "2ce3e0c468f51750d8ad86a19bcc3264", + "_journal/2024-08-11.md": "acc91e07b43590e90846d2c936dcb3d5", + "_journal/2024-08/2024-08-10.md": "08e7ea4a78c46645b93ec51e2372d04f", + "_journal/2024-08-12.md": "dbce7846aa65606fe528e4cd51022a9f" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-08-12.md b/notes/_journal/2024-08-12.md new file mode 100644 index 0000000..8ac5e67 --- /dev/null +++ b/notes/_journal/2024-08-12.md @@ -0,0 +1,11 @@ +--- +title: "2024-08-12" +--- + +- [x] Anki Flashcards +- [x] KoL +- [ ] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Add more SET condition code checks. \ No newline at end of file diff --git a/notes/_journal/2024-08-10.md b/notes/_journal/2024-08/2024-08-10.md similarity index 61% rename from notes/_journal/2024-08-10.md rename to notes/_journal/2024-08/2024-08-10.md index b142597..c1907e1 100644 --- a/notes/_journal/2024-08-10.md +++ b/notes/_journal/2024-08/2024-08-10.md @@ -9,4 +9,4 @@ title: "2024-08-10" - [ ] Korean (Read 1 Story) * Read through Chapter 3 of "Modern C". -* Notes on B-tree insertions. \ No newline at end of file +* Notes on B-tree insertions and [[b-tree#B+ tree|B+ trees]]. Finish reading how B-tree deletions work. \ No newline at end of file diff --git a/notes/_journal/2024-08/2024-08-11.md b/notes/_journal/2024-08/2024-08-11.md new file mode 100644 index 0000000..4b2ee3f --- /dev/null +++ b/notes/_journal/2024-08/2024-08-11.md @@ -0,0 +1,9 @@ +--- +title: "2024-08-11" +--- + +- [x] Anki Flashcards +- [x] KoL +- [ ] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/c17/declarations.md b/notes/c17/declarations.md index 13f7252..23e104d 100644 --- a/notes/c17/declarations.md +++ b/notes/c17/declarations.md @@ -29,7 +29,7 @@ whereas **direct declarators** will look like one of: %%ANKI Basic -What two qualifiers can be found on a pointer? +What two qualifiers can be used in a pointer declaration? Back: `const` and `volatile`. Reference: Van der Linden, Peter. _Expert C Programming: Deep C Secrets_. Programming Languages / C. Mountain View, Cal.: SunSoft Pr, 1994. @@ -697,7 +697,7 @@ END%% %%ANKI Basic -What is the "only advantage" of `enum`s over `#define` according to Linden? +According to Linden, what is the "only advantage" of `enum`s over `#define`? Back: `enum`s can usually be traced in a debugger. Reference: Van der Linden, Peter. _Expert C Programming: Deep C Secrets_. Programming Languages / C. Mountain View, Cal.: SunSoft Pr, 1994. diff --git a/notes/data-structures/b-tree.md b/notes/data-structures/b-tree.md index cd40cec..ba683e4 100644 --- a/notes/data-structures/b-tree.md +++ b/notes/data-structures/b-tree.md @@ -141,7 +141,7 @@ END%% %%ANKI Basic Consider a B-tree of order $7$. How many children $c$ can the root have? -Back: $0 \leq c \leq 7$ +Back: $1 \leq c \leq 7$ Reference: Donald Ervin Knuth, _Art of Computer Programming, 3: Sorting and Searching_, 2. ed., 34. (Reading, Mass: Addison-Wesley, 1995). END%% @@ -363,7 +363,95 @@ Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition ( END%% +## B+ Tree + +The **B+ tree** is a B-tree with the following differences: + +* Internal nodes do not store values; that is, all values are stored in the leaf nodes. +* Leaf nodes may include a pointer to the next leaf node to speed sequential access. + +%%ANKI +Basic +What is the *required* distinction between B-trees and B+ trees? +Back: Values in B+ trees are only stored in leaf nodes. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +In a B-tree, where can values be found? +Back: In any node. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +In a B+ tree, where can values be found? +Back: In the leaf nodes. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +What is the *optional* distinction between B-trees and B+ trees? +Back: A B+ tree leaf node may include a pointer to the next leaf node. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +How is a B+ tree defined in terms of B-trees? +Back: As a B-tree in which all values must reside in the leaf nodes. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +Why might a B+ tree implementation include pointers from leaf to leaf? +Back: To speed up sequential access. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +Which of B-trees and B+ trees likely have a higher order? +Back: B+ trees. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +Why do B+ trees typically have higher orders than B-trees? +Back: Their internal nodes do not have values, leaving room for more keys. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +Which of B+ trees and B-trees are likely deeper? +Back: B-trees. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + +%%ANKI +Basic +Why are B+ trees typically shallower than B-trees? +Back: Their internal nodes do not have values, leaving room for more keys. +Reference: “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). + +END%% + ## Bibliography +* “B-Tree,” in _Wikipedia_, August 7, 2024, [https://en.wikipedia.org/w/index.php?title=B-tree](https://en.wikipedia.org/w/index.php?title=B-tree&oldid=1239132600). * Donald Ervin Knuth, _Art of Computer Programming, 3: Sorting and Searching_, 2. ed., 34. (Reading, Mass: Addison-Wesley, 1995). * Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022). \ No newline at end of file diff --git a/notes/encoding/floating-point.md b/notes/encoding/floating-point.md index e5af30a..c2737d9 100644 --- a/notes/encoding/floating-point.md +++ b/notes/encoding/floating-point.md @@ -10,7 +10,8 @@ tags: ## Overview -The IEEE floating-point standard defines an encoding used to represent numbers of form $$(-1)^s \times M \times 2^E$$ where $s$ denotes the **sign bit**, $M$ the **significand**, and $E$ the **exponent**. The binary representation of floating point numbers are segmented into three fields: the sign bit, the exponent field, and the fraction field. Furthermore, there are three classes these fields are interpreted with respect to: +The IEEE floating-point standard defines an encoding used to represent numbers of form $$(-1)^s \times M \times 2^E$$ +where $s$ denotes the **sign bit**, $M$ the **significand**, and $E$ the **exponent**. The binary representation of floating point numbers are segmented into three fields: the sign bit, the exponent field, and the fraction field. Furthermore, there are three classes these fields are interpreted with respect to: * Normalized Form * Here the exponent field is neither all `0`s nor all `1`s. diff --git a/notes/formal-system/index.md b/notes/formal-system/index.md index 905657a..6ac61bc 100644 --- a/notes/formal-system/index.md +++ b/notes/formal-system/index.md @@ -90,7 +90,7 @@ END%% %%ANKI Basic Which of a formal system or a deductive system is defined in terms of the other? -Back: The formal system. +Back: A deductive system makes up part of a formal system. Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). END%% diff --git a/notes/formal-system/proof-system/equiv-trans.md b/notes/formal-system/proof-system/equiv-trans.md index c5a5851..3e4186a 100644 --- a/notes/formal-system/proof-system/equiv-trans.md +++ b/notes/formal-system/proof-system/equiv-trans.md @@ -323,7 +323,7 @@ END%% %%ANKI Basic How does the principle of explosion relate to the law of contradiction? -Back: If a contradiction could be proven, then anything can be proven. +Back: If a contradiction could be proven, then anything can be proven (using the principle of explosion). Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). END%% @@ -1174,7 +1174,7 @@ END%% %%ANKI Basic -Suppose $x \neq y$. *Why* isn't the following a tautology? $$\large{E_{e_1, e_2, e_3, e_4}^{x, x, y, x}} = E_{(x; \epsilon{:}e_1; \epsilon{:}e_2), e_3, e_4}^{x, y, x}$$ +Suppose $x \neq y$. *Why* isn't the following a tautology? $$\large{E_{e_1, e_2, e_3, e_4}^{x[1], x[2], y, x[3]}} = E_{(x; \,[1]{:}e_1; \,[2]{:}e_2), e_3, e_4}^{x, y, x[3]}$$ Back: Because not every $x$ was made adjacent before grouping. Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. diff --git a/notes/lambda-calculus/alpha-conversion.md b/notes/lambda-calculus/alpha-conversion.md index eef1f2a..fc0aeee 100644 --- a/notes/lambda-calculus/alpha-conversion.md +++ b/notes/lambda-calculus/alpha-conversion.md @@ -8,7 +8,7 @@ tags: ## Overview -Let $\lambda$-term $P$ contain an occurrence of $\lambda x. M$, and let $y \not\in FV(M)$. The act of replacing this occurrence of $\lambda x. M$ with $\lambda y. [y/x]M$ is called a **change of bound variable** or an $\alpha$-conversion in $P$. +Let $\lambda$-term $P$ contain an occurrence of $\lambda x. M$, and let $y \not\in FV(M)$. The act of replacing this occurrence of $\lambda x. M$ with $\lambda y. [y/x]M$ is called a **change of bound variable** or an **$\alpha$-conversion in $P$**. If $P$ can be changed to $\lambda$-term $Q$ by a finite series of changes of bound variables, we shall say **$P$ is congruent to $Q$**, or **$P$ $\alpha$-converts to $Q$**, or $P \equiv_\alpha Q$. diff --git a/notes/lambda-calculus/beta-reduction.md b/notes/lambda-calculus/beta-reduction.md index b72ae12..1e4438a 100644 --- a/notes/lambda-calculus/beta-reduction.md +++ b/notes/lambda-calculus/beta-reduction.md @@ -14,14 +14,14 @@ If and only if $P$ can be changed to a term $Q$ by a finite series of $\beta$-co %%ANKI Cloze -$\alpha$-{converts} is to $\beta$-{reduces}. +$\alpha$-{converts} and $\beta$-{reduces} is to 0 or more modifications. 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 -$\alpha$-{conversion} is to $\beta$-{contraction}. +$\alpha$-{conversion} and $\beta$-{contraction} is to 1 modification. 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%% @@ -573,7 +573,9 @@ END%% %%ANKI Cloze -$P =_\beta Q$ iff $\exists P_0, \ldots, P_n$ s.t. $P_0 \equiv P$, $P_n \equiv Q$, and $\forall i \leq n - 1$, {$P_i \,\triangleright_{1\beta}\, P_{i+1}$} or {$P_{i+1} \,\triangleright_{1\beta}\, P_i$} or {$P_i \equiv_\alpha P_{i+1}$}. +$P =_\beta Q$ iff $\exists P_0, \ldots, P_n$ s.t. $P_0 \equiv P$, $P_n \equiv Q$, and $\forall i \leq n - 1$: + +
{$P_i \,\triangleright_{1\beta}\, P_{i+1}$} or {$P_{i+1} \,\triangleright_{1\beta}\, P_i$} or {$P_i \equiv_\alpha P_{i+1}$}
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%% diff --git a/notes/set/relations.md b/notes/set/relations.md index 84dc9ea..7832a7e 100644 --- a/notes/set/relations.md +++ b/notes/set/relations.md @@ -514,7 +514,7 @@ END%% %%ANKI Basic -For what values of $n$ is an "$n$-ary relation on $A$" a "relation"? +For what values of $n$ is an "$n$-ary relation on $A$" definitively a relation? Back: $n > 1$ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -1093,13 +1093,6 @@ Reference: “Antisymmetric Relation,” in _Wikipedia_, January 24, 2024, [http END%% -%%ANKI -Cloze -{1:Distinct} elements is to {2:antisymmetry} whereas {2:any} elements is to {1:asymmetry}. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). - -END%% - %%ANKI Cloze A relation $R$ is asymmetric iff $R$ is {antisymmetric} and {irreflexive}. @@ -1238,7 +1231,7 @@ END%% %%ANKI Basic What members must be added to make $R = \{\langle a, b \rangle, \langle b, c \rangle, \langle c, a \rangle\}$ strongly connected on $\{a, b, c\}$? -Back: $\langle a, a \rangle$, $\langle b, b \rangle$, $\langle c, c \rangle$ +Back: $\langle a, a \rangle$, $\langle b, b \rangle$, and $\langle c, c \rangle$. Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). END%% @@ -1261,21 +1254,14 @@ END%% %%ANKI Basic Why might we say asymmetry is "strong antisymmetry"? -Back: The former implies the latter. +Back: Asymmetry implies antisymmetry. Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). END%% -%%ANKI -Cloze -{1:Distinct} elements is to {2:connected} whereas {2:any} elements is to {1:strongly connected}. -Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). - -END%% - %%ANKI Basic -What makes "strong connectedness" stronger than "connectedness"? +What makes "strong connectivity" stronger than "connectivity"? Back: The former implies the latter. Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). diff --git a/notes/x86-64/instructions/condition-codes.md b/notes/x86-64/instructions/condition-codes.md index 19a5d7a..1a1c812 100644 --- a/notes/x86-64/instructions/condition-codes.md +++ b/notes/x86-64/instructions/condition-codes.md @@ -94,12 +94,19 @@ END%% ## SET -| Instruction | Synonym | Effect | Description | -| ----------- | ------- | ---------- | -------------------- | -| `sete` | `setz` | `D <- ZF` | Equal / zero | -| `setne` | `setnz` | `D <- ~ZF` | Not equal / not zero | -| `sets` | | `D <- SF` | Negative | -| `setns` | | `D <- ~SF` | Nonnegative | +| Instruction | Synonym | Effect | Description | +| ----------- | -------- | --------------------------------- | ------------------------------------ | +| `sete` | `setz` | `D <- ZF` | Equal / zero | +| `setne` | `setnz` | `D <- ~ZF` | Not equal / not zero | +| `sets` | | `D <- SF` | Negative | +| `setns` | | `D <- ~SF` | Nonnegative | +| `setl` | `setnge` | `D <- SF ^ OF` | Less (signed `<`) | +| `setle` | `setng` | D <- (SF ^ OF) \| ZF | Less or equal (signed `<=`) | +| `setg` | `setnle` | `D <- ~(SF ^ OF) & ~ZF` | Greater (signed `>`) | +| `setge` | `setnl` | `D <- ~(SF ^ OF)` | Greater or equal (signed `<=`) | +| `setb` | `setnae` | `D <- CF` | Below (unsigned `<`) | + +Note how the other condition code effects are easy to derive from `setl` and `setb`. %%ANKI Basic @@ -258,6 +265,241 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% +%%ANKI +Basic +What arithmetic computation is a `SET` instruction's interpretation of condition codes based on? +Back: `t = a - b` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `l` in the `setl` instruction short for? +Back: **L**ess. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{`setl`} is a synonym for {`setnge`}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `nge` in the `setnge` instruction short for? +Back: **N**ot **g**reater or **e**qual. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `b` in the `setb` instruction short for? +Back: **B**elow. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{`setb`} is a synonym for {`setnae`}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `nae` in the `setnae` instruction short for? +Back: **N**ot **a**bove or **e**qual. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setl`} is to {2:signed} integers whereas {2:`setb`} is to {1:unsigned} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setnae`} is to {2:unsigned} integers whereas {2:`setnge`} is to {1:signed} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What condition code(s) does `setl` refer to? +Back: `SF` and `OF`. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +In terms of condition codes, what value does `setl` put in its specified destination? +Back: `SF ^ OF` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What condition code(s) does `setb` refer to? +Back: `CF` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +In terms of condition codes, what value does `setb` put in its specified destination? +Back: `CF` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `le` in the `setle` instruction short for? +Back: **L**ess or **e**qual. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{`setle`} is a synonym for {`setng`}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setle`} is to {2:signed} integers whereas {2:`setbe`} is to {1:unsigned} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setna`} is to {2:unsigned} integers whereas {2:`setng`} is to {1:signed} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What condition code(s) does `setle` refer to? +Back: `SF`, `OF`, and `ZF`. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +In terms of condition codes, what value does `setle` put in its specified destination? +Back: `(SF ^ OF) | ZF` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `g` in the `setg` instruction short for? +Back: **G**reater. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{`setg`} is a synonym for {`setnle`}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setg`} is to {2:signed} integers whereas {2:`seta`} is to {1:unsigned} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setnle`} is to {2:signed} integers whereas {2:`setnbe`} is to {1:unsigned} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What condition code(s) does `setg` refer to? +Back: `SF`, `OF`, and `ZF`. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +In terms of condition codes, what value does `setg` put in its specified destination? +Back: `~(SF ^ OF) & ~ZF` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What is `ge` in the `setge` instruction short for? +Back: **G**reater or **e**qual. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Cloze +{`setge`} is a synonym for {`setnl`}. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setge`} is to {2:signed} integers whereas {2:`setae`} is to {1:unsigned} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +{1:`setnb`} is to {2:unsigned} integers whereas {2:`setnl`} is to {1:signed} integers. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +What condition code(s) does `setge` refer to? +Back: `SF` and `OF`. +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + +%%ANKI +Basic +In terms of condition codes, what value does `setge` put in its specified destination? +Back: `~(SF ^ OF)` +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. + +END%% + ## Bibliography * Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.