0
$\begingroup$

Consider a logical expression such as

expr = (a == b + q - w || c == d) && (q + c - d == w || e == r);

I wonder if there is a function that would completely expand the nested brackets and fully simplify each case, e.g.:

expr // ExpandAndSimplify

(a + w == b + q && c + r == d + e) || (a == b && q == w) ||

(c == d && q == w) || (c == d && r == e)

Is there such a function in Mathematica? Or maybe one can implement it somehow?

$\endgroup$
  • 2
    $\begingroup$ Does expr // Reduce give you what you want? $\endgroup$ – Andrew Norton Aug 4 at 22:30
  • $\begingroup$ @AndrewNorton Oh, yes it does, thanks for pointing it out! $\endgroup$ – Kagaratsch Aug 4 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.