I've got the following term and preconditions:
Preconditions:
a <= b && x <= y
The term:
x <= a && y >= a || x <= b && y >= b || x >= a && y <= b
(|| = OR, && = AND)
From my computer science studies (a few years ago) I remembered to use a KV-Diagram for that. Now I need to define the "Output" columns, which are (if I remember correctly) all OR-subterms.
INPUT || OUTPUT
a | b | x | y || x <= a && y >= a | x <= b && y >= b | x >= a && y <= b
--+---+---+---++------------------+------------------+-----------------
0 | 0 | 0 | 0 || 1 && 1 = 1 | 1 && 1 = 1 | 1 && 1 = 1
0 | 0 | 0 | 1 || 1 && 1 = 1 | 1 && 1 = 1 | 1 && 0 = 0
0 | 0 | 1 | 0 || 0 && 1 = 0 | 0 && 1 = 0 | 1 && 1 = 1
0 | 0 | 1 | 1 || 0 && 1 = 0 | 0 && 1 = 0 | 1 && 0 = 0
0 | 1 | 0 | 0 || 1 && 1 = 1 | 1 && 0 = 0 | 1 && 1 = 1
0 | 1 | 0 | 1 || 1 && 1 = 1 | 1 && 1 = 1 | 1 && 1 = 1
0 | 1 | 1 | 0 || 0 && 1 = 0 | 1 && 0 = 0 | 1 && 1 = 1
0 | 1 | 1 | 1 || 0 && 1 = 0 | 1 && 1 = 1 | 1 && 1 = 1
1 | 0 | 0 | 0 || 1 && 0 = 0 | 1 && 1 = 1 | 0 && 1 = 0
1 | 0 | 0 | 1 || 1 && 1 = 1 | 1 && 1 = 1 | 0 && 0 = 0
1 | 0 | 1 | 0 || 1 && 0 = 0 | 0 && 1 = 0 | 1 && 1 = 1
1 | 0 | 1 | 1 || 1 && 1 = 1 | 0 && 1 = 0 | 1 && 0 = 0
1 | 1 | 0 | 0 || 1 && 0 = 0 | 1 && 0 = 0 | 0 && 1 = 0
1 | 1 | 0 | 1 || 1 && 1 = 1 | 1 && 1 = 1 | 0 && 1 = 0
1 | 1 | 1 | 0 || 1 && 0 = 0 | 1 && 0 = 0 | 1 && 1 = 1
1 | 1 | 1 | 1 || 1 && 1 = 1 | 1 && 1 = 1 | 1 && 1 = 1
But here my knowledge ends. I can't figure out, how to put the precondition into the term, because they should not be part of the resulting term.
And of course I don't know how to get the resulting term...
EDIT: There's no need for a KV-Diagram, if there's another (maybe simpler) way to get the resulting term. It was just what came to my head first, when I thought about term simplification.
EDIT2: I now figured out the solution with a bit of thinking and trial and error:
x <= b && y >= a
But it would be nice to have a proper way to simplify such terms for the future.