MathGroup Archive 2010

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

Search the Archive

Re: Boolean factorization


Hi,

it is easy to transform it into CNF with BooleanConvert

a && b && c && d && (e || g || i) && (e || g || j) && (e || h || 
   i) && (e || h || j) && (f || g || i) && (f || g || j) && (f || h ||
    i) && (f || h || j)

But to simplify the latter part, you'll have to split the formula and
apply BooleanMinimize manually.

expr = (a && b && c && d && e && f) || (a && b && c && d && g && 
     h) || (a && b && c && d && i && j);

And @@ BooleanMinimize /@ 
  And @@@ GatherBy[List @@ BooleanConvert[expr, "CNF"], 
    Head[#] === Or &]

Cheers
Patrick

On Tue, 2010-10-12 at 13:48 -0400, olfa wrote:
> Hi Mathematica Community,
> 
> How to factorize
> (a && b && c && d && e && f) || (a && b && c && d && g && h) || (a &&
> b && c && d && i && j)
> into
> a && b && c && d && ((e&&f) || (g&&h) || (i && j))
> 
> Thank you.
> 



  • Prev by Date: Re: local variables - Module, For loop
  • Next by Date: Re: C-pointers from Mathematica
  • Previous by thread: Re: Boolean factorization
  • Next by thread: How to concatenate matrices?