From 47c1289ff658a5aec71635d79ffe30bb29a07876 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 11 May 2023 19:38:03 +0100 Subject: Add content --- content/zettel/2e1c1.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 content/zettel/2e1c1.md (limited to 'content/zettel/2e1c1.md') 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; } +``` -- cgit