Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10860 > unrolled thread
| Started by | Francisco Gutierrez <fgutiers2002@yahoo.com> |
|---|---|
| First post | 2012-07-10 04:42 +0000 |
| Last post | 2012-07-11 06:18 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
strange booleanconvert behavior? Francisco Gutierrez <fgutiers2002@yahoo.com> - 2012-07-10 04:42 +0000
Re: strange booleanconvert behavior? Peter Pein <petsie@dordos.net> - 2012-07-11 06:17 +0000
Re: strange booleanconvert behavior? Peter Pein <petsie@dordos.net> - 2012-07-11 06:18 +0000
| From | Francisco Gutierrez <fgutiers2002@yahoo.com> |
|---|---|
| Date | 2012-07-10 04:42 +0000 |
| Subject | strange booleanconvert behavior? |
| Message-ID | <jtgbqo$49b$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2012-07-11 06:17 +0000 |
| Message-ID | <jtj5pr$5m0$1@smc.vnet.net> |
| In reply to | #10860 |
Am 10.07.2012 06:42, schrieb Francisco Gutierrez:
> 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
>
Hi Francisco,
using similar to your 'num2'
num2 = Or @@ Table[And[a, b, c, last],
{last, ToExpression@CharacterRange["d", "z"]}]
I observed that FullSimplify works up to seventeen terms:
FullSimplify[Take[num2, 17]]
results in
a && b && c && (d || e || f || ... || t)
I've got no idea what the "ConversionMethodParameters" in the following
input are but I multiplied suspicious values by 100 and it works :)
SetSystemOptions[
"BooleanComputationOptions" ->
{"ConversionMethodParameters" ->
{1200, 1., 10000, False}}];
BooleanConvert[num2, "CNF"]
results in
a && b && c && (d || e || f || ... || z)
Any esoteric knowledge about the SystemOptions and how
Experimental`SystemOptionsEditor[] works are welcome and highly appreciated.
Greetings,
Peter
[toc] | [prev] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2012-07-11 06:18 +0000 |
| Message-ID | <jtj5qq$5m7$1@smc.vnet.net> |
| In reply to | #10860 |
Am 10.07.2012 06:42, schrieb Francisco Gutierrez:
> 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
>
addendum to my last answer:
BooleanMinimize[num2, "CNF"]
works without change to the system options.
Cheers,
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web