0
$\begingroup$

I have a complex relation which I need to expand and represnt it clear and nice. So I used LogicalExpand (LE). I know LE does only the simple expansion and nothing further. but it creates some wrong relations which I am sure besaed on my source relation. So how to remove or get most correct output, please look at this example:

Simplify /@ LogicalExpand [(w == wP || z < x) && (w == wP || w > x + 2 z) && (wP == 4 + 2 x + z || z >= x || w <= x + 2 z) && z == zP && (x + z == yP || z < x) && 2 x + z == xP && (x + 2 z == yP || z >= x)] (w==wP && x+z==yP && 2 x+z==xP && z==zP && z>=x)|| #1 right (w==wP && x+z==yP && 2 x+z==xP && wP==4+2 x+z && x+2 z==yP && z==zP)|| #2 Wrong (w==wP && x+z==yP && 2 x+z==xP && x+2 z==yP && z==zP && w<=x+2 z)|| #3 Wrong (w==wP && 2 x+z==xP && wP==4+2 x+z && x+2 z==yP && z==zP && z<x)|| #4 wrong (w==wP && 2 x+z==xP && x+2 z==yP && z==zP && z<x && w<=x+2 z)|| #5 right (2 x+z==xP && wP==4+2 x+z && x+2 z==yP && z==zP && w>x+2 z && z<x) #6 right 

As you see above lines 2,3 and 4 are definitely wrong, as I am sure based on my source relations. For example, you see in line #2 two different yP is created. x+z==yP and x+2 z==yP . I just need the rest of it. IS there any way for this problem? How to return numbers 1,5 and 6 ?

$\endgroup$

1 Answer 1

3
$\begingroup$

Get an overview

te = (w == wP || z < x) && (w == wP || w > x + 2 z) && (wP == 4 + 2 x + z || z >= x || w <= x + 2 z) && z == zP && (x + z == yP || z < x) && 2 x + z == xP && (x + 2 z == yP || z >= x); TraditionalForm[ te //. Or -> Composition[(Column[#, Right, Background -> {{White, LightGray}}, Frame -> All] &), List]] 

enter image description here

red = Reduce[te, Reals]; TraditionalForm[ red //. Or -> Composition[(Column[#, Right, Background -> {{White, LightGray}}, Frame -> All] &), List]] 

enter image description here

le = LogicalExpand[te]; TraditionalForm[(Simplify /@ le) //. Or -> Composition[(Column[#, Right, Background -> {{White, LightGray}}, Frame -> All] &), List]] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.