Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11000 > unrolled thread

Re: strange booleanconvert behavior?

Started byFrancisco Gutierrez <fgutiers2002@yahoo.com>
First post2012-07-20 07:57 +0000
Last post2012-07-20 07:57 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: strange booleanconvert behavior? Francisco Gutierrez <fgutiers2002@yahoo.com> - 2012-07-20 07:57 +0000

#11000 — Re: strange booleanconvert behavior?

FromFrancisco Gutierrez <fgutiers2002@yahoo.com>
Date2012-07-20 07:57 +0000
SubjectRe: strange booleanconvert behavior?
Message-ID<jub31n$ej2$1@smc.vnet.net>
Many thanks to Dave Snead and Peter Pein for their responses to my query about BooleanConvert behavior.

The solutions worked. At the same time, it is clear that BooleanConvert has a quirk (or the documentation is severely incomplete). Hope in version 9 it is fixed

Francisco

From: Dave Snead <dsnead6@charter.net>
Sent: Wednesday, July 11, 2012 1:20 AM
Subject: Re: strange booleanconvert behavior?

Found the same problem.
Clearly Mathematica isn't working correctly when the number of sublists is 
more than 9.
As a work around 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
Subject: 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:
num2=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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web