Simplification of expressions?

30 Views Asked by At

The expression below

fd < S &&  ld > e || fs > s && ld > e || fd > s && ld < e || fd < s && ld < e

Is the same as this...

fd < e && ld > s

But how can I simplify the first into the second? The first one was easily constructed by looking at a generalized version of my data. The second was a bit more tricky to figure out.

1

There are 1 best solutions below

0
On

The expressions are not equivalent. The top one is equivalent to $\mathit{fd}\ne s\land\mathit ld\ne e$.

So a counterexample would be $\mathit{fd}=1$, $e=2$, $\mathit{ld}=3$, $s=4$, which makes the upper expression true (because the first disjuct is), but the lower one false (because $\mathit{ld}>s$ fails).