I have 4 variables of integer a, b, c, d
which could define 2 intervals:
[min(a, b), max(a, b)]
and [min(c, d), max(c, d)]
Could anyone tell me if it is possible by only using the functions mix
and max
and []
to represent the intersection of these 2 intervals? The definition of these functions are as following:
min(x, y) = x if x < y, y otherwise max(x, y) = x if x > y, y otherwise [x, y] = {i is integer | x <= i <= y}. so when x > y, [x, y] = empty
Going forward, is it possible by only using the functions mix
and max
to represent the union of these 2 intervals?
Thank you very much!
Edit1: as the comments suggest, the intersection may be empty under some condition. So I just added a function []
.