Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: strange booleanconvert behavior?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127249] Re: strange booleanconvert behavior?
  • From: "Dave Snead" <dsnead6 at charter.net>
  • Date: Wed, 11 Jul 2012 02:20:03 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120710044211.04D95683D@smc.vnet.net>

Found the same problem.
Clearly Mathematica isn't working correctly when the number of sublists is 
more than 9.
As a workaround consider

num1={{a,b,c,d},{a,b,c,e},{a,b,c,f},{a,b,c,g},{a,b,c,h},{a,b,c,i},{a,b,c,j},{a,b,c,k},{a,b,c,l},{a,b,c,m},{a,b,c,n}}
num2=Apply[Or,Apply[And,#]&/@num1]
x = BooleanConvert[Take[num2, 9], "CNF"];
y = BooleanConvert[Drop[num2, 9], "CNF"];
BooleanConvert[x || y, "CNF"]

Cheers,
Dave



-----Original Message----- 
From: Francisco Gutierrez
Sent: Monday, July 09, 2012 9:42 PM
To: mathgroup at smc.vnet.net
Subject: [mg127249] strange booleanconvert behavior?

Dear Group:
Say I have the following expression:
num1={{a,b,c,d},{a,b,c,e},{a,b,c,f},{a,b,c,g},{a,b,c,h},{a,b,c,i},{a,b,c,j},{a,b,c,k},{a,b,c,l},{a,b,c,m},{a,b,c,n}}

I transform it into a logical expression:
n=
um2=Apply[Or,Apply[And,#]&/@num1]

I want to simplify this to a CNF, and the obvious function to use is Boolean 
Convert. Suppose I apply it to NINE elements of num2:
BooleanConvert[Take[num2,9],"CNF"]
The output is
a&&b&&c&&(d||e||f||g||h||i||j||k||l)

It works perfectly well!

However, if I apply BooleanConvert to the whole expression I get back a 
bunch of crap. Also if I apply it to 10 elements of num2.
In sum, it appears that BooleanConvert only works well for 9 expressions or 
less. Tried this with other two examples, and found
exactly the same result.

All this in Mathematica 8

Can somebody help me?
Francisco





  • Prev by Date: Re: polarplot with arrow bearing tickmarks
  • Next by Date: Re: Sending an interrupt to the frontend?
  • Previous by thread: strange booleanconvert behavior?
  • Next by thread: Re: strange booleanconvert behavior?