diff options
Diffstat (limited to 'content/zettel/2e1c1.md')
-rw-r--r-- | content/zettel/2e1c1.md | 36 |
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; } +``` |