Given non-negative real number tSS, tLS, tIS, tBS.
(i.e. they are real type with tSS>=0 and tLS>=0 and tIS>=0 and tBS>=0 and tSS>=0)
The following contraint C1 is in CNF format that contains 12 conjuncts.
(tSS+tLS<=tIS)And(tIS<=tBS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS+tLS<=tBS)And(tBS<=tIS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS+tLS<=tBS)And(tSS<=tIS)And(tIS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS<=tIS)And(tIS<=tBS)And(tBS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS+tLS<=tIS)And(tSS<=tBS)And(tBS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS<=tBS)And(tBS<=tIS)And(tIS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS+tLS<=tBS)And(tIS<=tSS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS<=tBS)And(tIS<=tBS)And(tBS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tIS<=tBS)And(tBS<=tSS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS+tLS<=tIS)And(tBS<=tSS)And(tSS+tLS+tIS+tBS<=3) OR
(tSS<=tIS)And(tBS<=tSS)And(tIS<=tSS+tLS)And(tSS+tLS+tIS+tBS<=3) OR
(tIS<=tSS)And(tBS<=tIS)And(tSS+tLS+tIS+tBS<=3)
I wish to obtain the constraint C2 in the form of
tSS<=a and tLS<=b and tIS<=c and tBS <=d and tSS<=e
The constraint C2 only needs to be included in C1, i.e.
any valuation satisfies C2 must satisfies C1, but not vice versa.
The value of a-e, is value that ranges from 0 to infinity.
Infinity means that it can take any value larger than 0.
Is it possible to use Z3 to infer the value of a-e? (it can be unsatisfiable)
There may be more efficient techniques to do it but at least you can solve the problem using quantifiers.
Let
C1(tSS, tLS, tIS, tBS)denote the CNF formula andC2(SS, tLS, tIS, tBS, a, b, c, d)is the constraint to satisfy. You can check for satisfiability of the following quantified formula:forall tSS tLS tIS tBS. C2(SS, tLS, tIS, tBS, a, b, c, d) => C1(tSS, tLS, tIS, tBS)where
a, b, c, dare free variables.I encoded your concrete example using Z3 SMT online. The query is unsatisfiable in this case.