Predicate transformer commands and git merge conflicts.

c-declarations
Joshua Potter 2024-05-27 14:01:40 -06:00
parent 47519891a4
commit 32b180c83d
6 changed files with 193 additions and 16 deletions

View File

@ -202,7 +202,7 @@
"_journal/2024-02/2024-02-10.md": "562b01f60ea36a3c78181e39b1c02b9f",
"_journal/2024-02-11.md": "afee9f502b61e17de231cf2f824fbb32",
"binary/endianness.md": "63117fe7795e2a10cb2eb7843a089d9d",
"logic/normal-form.md": "6fa46165cbbed5d312e0621f98d21f55",
"logic/normal-form.md": "389c3a4cf2d924642f21194d78c211e0",
"_journal/2024-02-12.md": "240d17f356305de9c0c00282b2931acd",
"_journal/2024-02/2024-02-11.md": "afee9f502b61e17de231cf2f824fbb32",
"encoding/ascii.md": "34350e7b5a4109bcd21f9f411fda0dbe",
@ -313,7 +313,7 @@
"_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f",
"_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b",
"set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53",
"set/index.md": "87f04456ea94ca2d06514f98101fa39a",
"set/index.md": "4a190fea888f896f6784f350216cdf46",
"set/graphs.md": "4bbcea8f5711b1ae26ed0026a4a69800",
"_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb",
"_journal/2024-03/2024-03-18.md": "63c3c843fc6cfc2cd289ac8b7b108391",
@ -436,7 +436,7 @@
"_journal/2024-05-13.md": "71eb7924653eed5b6abd84d3a13b532b",
"_journal/2024-05/2024-05-12.md": "ca9f3996272152ef89924bb328efd365",
"git/remotes.md": "2208e34b3195b6f1ec041024a66fb38b",
"programming/pred-trans.md": "c3039011d2ec6f968cd0c759cbc4b2e6",
"programming/pred-trans.md": "24fb4b8d8137626dcacbc02c9ecd07a1",
"set/axioms.md": "063955bf19c703e9ad23be2aee4f1ab7",
"_journal/2024-05-14.md": "f6ece1d6c178d57875786f87345343c5",
"_journal/2024-05/2024-05-13.md": "71eb7924653eed5b6abd84d3a13b532b",
@ -472,10 +472,11 @@
"_journal/2024-05/2024-05-23.md": "d0c98b484b1def3a9fd7262dcf2050ad",
"_journal/2024-05-26.md": "3b95f86726d646f157ebe2ae55e2afda",
"_journal/2024-05/2024-05-25.md": "3e8a0061fa58a6e5c48d12800d1ab869",
"_journal/2024-05-27.md": "825a4bc24833f955581fb5949ec79a4e",
"_journal/2024-05-27.md": "b36636d10eab34380f17f288868df3ae",
"_journal/2024-05/2024-05-26.md": "abe84b5beae74baa25501c818e64fc95",
"algebra/set.md": "d7b4c7943f3674bb152389f4bef1a234",
"algebra/boolean.md": "56d2e0be2853d49b5dface7fa2d785a9"
"algebra/boolean.md": "56d2e0be2853d49b5dface7fa2d785a9",
"git/merge-conflicts.md": "cb7d4d373639f75f6647be60f3fe97f3"
},
"fields_dict": {
"Basic": [

View File

@ -2,10 +2,12 @@
title: "2024-05-27"
---
- [ ] Anki Flashcards
- [x] Anki Flashcards
- [x] KoL
- [ ] Sheet Music (10 min.)
- [ ] Go (1 Life & Death Problem)
- [ ] Korean (Read 1 Story)
* More algebra of sets identities and analogs between membership tables and truth tables.
* More algebra of sets identities and analogs between membership tables and truth tables.
* Flashcards on git [[merge-conflicts|merge conflicts]].
* Basic predicate transformer commands.

View File

@ -0,0 +1,79 @@
---
title: Merge Conflicts
TARGET DECK: Obsidian::STEM
FILE TAGS: git::merge
tags:
- git
---
## Overview
Merge conflicts are denoted by `<<<<<<<`, `=======`, and `>>>>>>>` markers.
%%ANKI
Basic
What marker denotes the start of a merge conflict section?
Back: `<<<<<<<`
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846975-->
END%%
%%ANKI
Basic
What marker denotes the end of a merge conflict section?
Back: `>>>>>>>`
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846981-->
END%%
%%ANKI
Basic
What marker separates differences between two branches in a merge conflict section?
Back: `=======`
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846984-->
END%%
%%ANKI
Basic
In a `git merge`, which branch's changes are listed first in a merge conflict section?
Back: The branch you are currently on, i.e. `HEAD`.
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846987-->
END%%
%%ANKI
Basic
In a `git merge`, what changes are between `<<<<<<<` and `=======`?
Back: The changes present on the current branch.
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846990-->
END%%
%%ANKI
Basic
In a `git merge`, what changes are between `>>>>>>>` and `=======`?
Back: N/A.
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846993-->
END%%
%%ANKI
Basic
In a `git merge`, what changes are between `=======` and `>>>>>>>`?
Back: The changes present on the branch being merged into `HEAD`.
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846999-->
END%%
%%ANKI
Basic
In a `git merge`, what changes are between `=======` and `<<<<<<<`?
Back: The changes present on the branch being merged into `HEAD`.
Reference: Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).
<!--ID: 1716804846996-->
END%%
## Bibliography
* Scott Chacon, *Pro Git*, Second edition, The Experts Voice in Software Development (New York, NY: Apress, 2014).

View File

@ -25,7 +25,7 @@ END%%
%%ANKI
Basic
What zero-order logical normal form(s) have only $\land$ and $\lor$ operators?
Back: CNF and DNF
Back: CNF and DNF.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1707675369145-->
END%%

View File

@ -484,7 +484,7 @@ END%%
Basic
What constant operand evaluations determine the direction of implication in Distributivity of Disjunction?
Back: $F \Rightarrow T$ evaluates truthily but $T \Rightarrow F$ does not.
Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716310927718-->
END%%
@ -492,7 +492,7 @@ END%%
Basic
*Why* does Distributivity of Disjunction use an implication instead of equality?
Back: Because the underlying command may be nondeterministic.
Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716311034191-->
END%%
@ -500,10 +500,98 @@ END%%
Basic
*When* does Distributivity of Disjunction hold under equality (instead of implication)?
Back: When the underlying command is deterministic.
Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716311034194-->
END%%
## Commands
### skip
For any predicate $R$, $wp(skip, R) = R$.
%%ANKI
Basic
How is the $skip$ command defined?
Back: As $wp(skip, R) = R$.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300099-->
END%%
%%ANKI
Basic
Which command does Gries call the "identity transformation"?
Back: $skip$
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300109-->
END%%
%%ANKI
Cloze
Provide the specific command: for any predicate $R$, $wp(${$skip$}$, R) = R$.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300113-->
END%%
### abort
For any predicate $R$, $wp(abort, R) = F$.
%%ANKI
Basic
How is the $abort$ command defined?
Back: As $wp(abort, R) = F$.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300116-->
END%%
%%ANKI
Cloze
Provide the specific command: for any predicate $R$, $wp(${$abort$}$, R) = F$.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300119-->
END%%
%%ANKI
Basic
How is the $abort$ command executed?
Back: It isn't.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300126-->
END%%
%%ANKI
Basic
*Why* can't the $abort$ command be executed?
Back: Because it terminates in state $F$ which is impossible.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300129-->
END%%
%%ANKI
Basic
Which command does Gries introduce as the only whose predicate transformer is "constant"?
Back: $abort$
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300133-->
END%%
%%ANKI
Basic
*Why* is $abort$ considered the only "constant" predicate transformer?
Back: The Law of the Excluded Miracle ensures $wp(S, F) = F$ for any other commands $S$.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300137-->
END%%
%%ANKI
Basic
Consider $makeTrue$ defined as $wp(makeTrue, R) = T$ for all predicates $R$. What's wrong?
Back: If $R = F$, $makeTrue$ violates the Law of the Excluded Miracle.
Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.
<!--ID: 1716810300145-->
END%%
## Bibliography
* Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981.

View File

@ -144,9 +144,16 @@ END%%
%%ANKI
Cloze
An {1:atom} in set theory is to {2:atomic} logical statements whereas {2:sets} are to {1:molecular} statements.
An {atom} is to set theory as an {atomic} logical statement is to propositional logic.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1716494526273-->
<!--ID: 1716807316136-->
END%%
%%ANKI
Cloze
A {set} is to set theory as a {2:molecular} logical statement is to propositional logic.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1716807316144-->
END%%
%%ANKI
@ -167,8 +174,8 @@ END%%
%%ANKI
Basic
Enderton's exposition makes what assumption about atoms?
Back: The set of all atoms is the empty set.
Enderton's exposition makes what assumption about the set of all atoms?
Back: It is the empty set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1716494526284-->
END%%
@ -255,7 +262,7 @@ END%%
%%ANKI
Basic
What two properties ensures definition $\varnothing$ is well-defined?
Back: The empty set exists and is unique.
Back: Existence and uniqueness.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1715688034312-->
END%%