Re: ((a&&b)||c)==((a||c)&&(b||c)) is not true

*To*: mathgroup at smc.vnet.net*Subject*: [mg62086] Re: ((a&&b)||c)==((a||c)&&(b||c)) is not true*From*: "Steven T. Hatton" <hattons at globalsymmetry.com>*Date*: Fri, 11 Nov 2005 02:51:49 -0500 (EST)*References*: <200511090845.DAA17387@smc.vnet.net> <dksig6$k6l$1@smc.vnet.net> <dkuvog$7rc$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Richard Fateman wrote: > A good reason for Mathematica to fail to show that these > are the same, is that they are in some senses different. > > > These look like logical statements and as such they look like they > are logically identical, but these are actually > programs with short-circuit evaluation. > > > Consider > c[] := (Print[C_called]; True) > a[] := (Print[A_called]; False) > b[] := (Print[B_called]; True) > (a[] && b[]) || c[] > (a[] || c[]) && (b[] || c[]) > > They are different PROGRAMS. Good observation. There should, however, be some way to tell Mathematica to treat them as traditional symbolic logic statements. I don't believe that LogicExpand will do that for me. I'm not sure what happens with Implies, but my observation is that it does not handle all cases. -- The Mathematica Wiki: http://www.mathematica-users.org/ Math for Comp Sci http://www.ifi.unizh.ch/math/bmwcs/master.html Math for the WWW: http://www.w3.org/Math/

**References**:**((a&&b)||c)==((a||c)&&(b||c))***From:*"Steven T. Hatton" <hattons@globalsymmetry.com>