MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ((a&&b)||c)==((a||c)&&(b||c))


Steven T. Hatton wrote:

> On Wednesday 09 November 2005 11:02 am, Daniel Lichtblau wrote:

>>Equal does not do logical manipulations on its operands. 
> 
> 
> That's part of what I'm trying to understand. Mathamatica AFAIK takes 
> expressions and transforms them into the simplest form possible, and then 
> does pattern patching.

No, that's not what it does. There are a few transformations it does 
automatically, but they don't add up to anything like a transformation 
to "simplest form possible". There are expensive heuristic procedures, 
Simplify[] and FullSimplify[] that attempt this, but they are not 
invoked automatically and also cannot be guaranteed to find the 
"simplest form possible".

Ordinary algebra in Mathematica defies most of your expectations also:

In[1]:= (a + 1)^2 == a^2 + 2*a + 1

Out[1]= (1 + a)^2 == 1 + 2*a + a^2

In[2]:= Expand[%]

Out[2]= (1 + a)^2 == 1 + 2*a + a^2

In[3]:= Simplify[%]

Out[3]= True

The main difference is that Simplify[] won't apply LogicalExpand[] 
automatically. I suppose this would be hazardous if some symbols didn't 
represent booleans. However:

In[10]:= Simplify[((a && b) || c) == ((a || c) && (b || c)),
   TransformationFunctions -> {Automatic, LogicalExpand}]

Out[10]= True

-jpd


  • Prev by Date: Re: FileNames[] in a loop..
  • Next by Date: Re: Re: Mathematica 1
  • Previous by thread: Re: ((a&&b)||c)==((a||c)&&(b||c)) is not true
  • Next by thread: Re: ((a&&b)||c)==((a||c)&&(b||c))