summaryrefslogtreecommitdiffstats
path: root/content/zettel/2e1c1.md
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-05-11 19:38:03 +0100
committerYann Herklotz <git@yannherklotz.com>2023-05-11 19:38:03 +0100
commit47c1289ff658a5aec71635d79ffe30bb29a07876 (patch)
tree56cf6b959e37fed88c492d34defd3d7ec40e7148 /content/zettel/2e1c1.md
parentfbe0fc62120348f582dc4db2b614078943d0764b (diff)
downloadzk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.tar.gz
zk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.zip
Add content
Diffstat (limited to 'content/zettel/2e1c1.md')
-rw-r--r--content/zettel/2e1c1.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/content/zettel/2e1c1.md b/content/zettel/2e1c1.md
new file mode 100644
index 0000000..9754992
--- /dev/null
+++ b/content/zettel/2e1c1.md
@@ -0,0 +1,36 @@
++++
+title = "Comparing symbolic evaluations with conditionals"
+author = "Yann Herklotz"
+tags = []
+categories = []
+backlinks = ["3c3", "3a7", "2e1c"]
+forwardlinks = ["2e1c2", "2e1c1a"]
+zettelid = "2e1c1"
++++
+
+``` c
+if (P) { x = 1; }
+else if (Q) { x = 2; }
+else if (R) { x = 3; }
+else { x = 4; }
+```
+
+is equivalent to the following if $P \land Q$ is *unsatisfiable*:
+
+``` c
+if (Q) { x = 2; }
+else if (P) { x = 1; }
+else if (R) { x = 3; }
+else { x = 4; }
+```
+
+If $Q \land R$ is *satisfiable*, then these can never change in order,
+however, if $P \land R$ is *unsatisfiable*, then it would also be
+equivalent to the following:
+
+``` c
+if (Q) { x = 2; }
+else if (R) { x = 3; }
+else if (P) { x = 1; }
+else { x = 4; }
+```