1
$\begingroup$

I have a list of inequalities with AND/OR conditions (A,B,C,D are all inequalities):

l = {A && (B || C || D)}   (This is simplified, in reality it will be far more complicated as shown below.)

What I want to like the following:

l = {A && B, A && C, A && D}

In other words, I want to remove all OR conditions to make it a list of conditions for all possible cases.

For your reference, the following is a real example I actually want to change using the above process. I just want to remove all OR conditions to make this expression more readable. Therefore, I would like to split the following into many different cases.

 (x + p δ > 
    y && (((p (-1 + v) + f v - x + y - v y)/(f v) < ρ < (
        v (f - x) + p (-1 + v + δ - v δ))/(f v) && 
       v + δ != 1) || (v + δ < 
        1 && ((v (f - x) + p (-1 + v + δ - v δ))/(
          f v) < ρ < (v (f - y) + p (-1 + v + δ))/(f v) ||
          p + x + v y + f v (-1 + ρ) < 
          p v + y)) || (v + δ > 
        1 && ((v (f - x) + p (-1 + v + δ - v δ))/(
          f v) < ρ < (
          f v δ - x (-1 + v + δ) + 
           y (-1 + v + δ - v δ))/(f v δ) || 
         p + x + v y + f v (-1 + ρ) < p v + y)))) || (x + 
     p δ < y && 
   y + x (-1 + δ) + (-1 + v) y δ + 
     f v δ ρ < (f + p) v δ && v + δ != 1)

Thanks in advance for your help!

$\endgroup$
1
  • 2
    $\begingroup$ Apply[List, LogicalExpand[a && (b||c||d)]] $\endgroup$
    – I.M.
    Commented Jul 27, 2021 at 6:03

1 Answer 1

1
$\begingroup$

One option is to make use of transposition in the general sense, and Thread just does it:

Sequence @@@ Thread[#, Or] & /@ l
{A && B, A && C, A && D}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.