summaryrefslogtreecommitdiffstats
path: root/content/zettel/2e1c1.md
blob: 9754992013ea42fede51a576213c1ec71aad896c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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; }
```