4
$\begingroup$

The Mathematica Boolean Computation webpage specifies that Mathematica has full support for "don't care" arguments and values. However I don't see any examples demonstrating this functionality. Could someone provide an example, preferably using the BooleanMinterm function?

$\endgroup$
3
$\begingroup$

BooleanMinterm doesn't afford the possibility tu use "don't care", but BooleanFunction has it :

myTruthTableForm[bf_BooleanFunction] := 
  Append[#, bf @@ #] & /@  Tuples[{True, False}, 2] // Boole // 
    Reverse // Grid[#, Dividers -> {{False, False, True}, None}] &;

{#, myTruthTableForm [ReleaseHold[#]]} & /@ {
   HoldForm @ BooleanFunction[{{0, 0} -> 1, {_, 1} -> 0}],
   HoldForm @ BooleanFunction[{{0, 0} -> 1, {0, 1} -> 0}],
   HoldForm @ BooleanFunction[{{0, 0} -> 1, {0, 1} -> 0, {__} -> _ }],
   HoldForm @ BooleanFunction[{{0, 0} -> 1, {0, 1} -> 0, {__} -> 1 }]
   } // Grid[#, Alignment -> Left] &

enter image description here

Edit

Note that BooleanFunction make some definitives choices about what happen with the "don't care" outputs. Theses choices are not predictible and doesn't correspond to any kind of minimization ("DNF","SOP","CNF","POS" etc..., see a counter example here). Nevertheless real optimisation with "don't care" are available with the third argument of BooleanMinimize (there is a example here )

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.