Which laws do I need to use to simplify
!X + (!Y + !Z)*(Y + Z)
to
!X + (Y*!Z) + (!Y*Z)
Which laws do I need to use to simplify
!X + (!Y + !Z)*(Y + Z)
to
!X + (Y*!Z) + (!Y*Z)
No need to apply any specific 'laws', just write down a simple table to figure out the two expression are equivalent (providing +
is OR
and *
is AND
):
Y Z !Y !Z (!Y+!Z)*(Y+Z) (Y*!Z) +(!Y*Z)
0 0 1 1 (1+1=1)*(0+0=0)=0 (0*1=0)+(1*0=0)=0
0 1 1 0 (1+0=1)*(0+1=1)=1 (0*0=0)+(1*1=1)=1
1 0 0 1 (0+1=1)*(1+0=1)=1 (1*1=1)+(0*0=0)=1
1 1 0 0 (0+0=0)*(1+1=1)=0 (1*0=0)+(0*1=0)=0
Likewise you can deduct that (X or Y) and Z
is equivalent to (X and Z) or (Y and Z)
. This is called distributivity of and
over or
. Further reading is a nice article about Boolean algebra on Wikipedia.
In your example: (!Y + !Z)*(Y + Z) = !Y*(Y + Z) + !Z*(Y + Z) = !Y*Y + !Y*Z + !Z*Y + !Z*Z
. Trivially A and not A == false
, then your expression simplifies to !Y*Z + !Z*Y
and further to Y*!Z + !Y*Z
because of commutativity.
You can first start by distributivity of multiplication over addition:
!X + (!Y + !Z)*(Y + Z) = !X + !Y*Y + !Z*Y + !Y*Z + !Z*Z
Then, we can use complementation to remove elements of the form !p*p
:
= !X + 0 + !Z*Y + !Y*Z + 0
And finally remove the 0
as they are +
's neutral.
If memory serves (and I take your notation correctly), then that's an SLD resolution inside a simple conjunction: http://en.wikipedia.org/wiki/SLD_resolution