({{, (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[k,n]
represents the k(^th) maxterm in n variables.}, {, (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[{(Subscript[k, 1]),(Subscript[k, 2]),…},n]
represents the conjunction of the maxterms (Subscript[k, i]).}, {, (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[{{(Subscript[u, 1]),…,(Subscript[u, n])},{(Subscript[v, 1]),…},…}]
represents the conjunction of maxterms given by the exponent vectors (Subscript[u, i]), (Subscript[v, i]), ….}, {, (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec,{(Subscript[a, 1]),(Subscript[a, 2]),…}]
gives the Boolean expression in variables (Subscript[a, i]) corresponding to the maxterms function specified by spec.}, {, (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec,{a,(Subscript[a, 2]),…},form]
gives the Boolean expression in the form specified by form.}})

OpenersNotesSection(Spacer1)Details

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[{{(Subscript[u, 1]),(Subscript[u, 2]),…}},{(Subscript[a, 1]),(Subscript[a, 2]),…}] gives (Subscript[b, 1])∨(Subscript[b, 2])∨… where (Subscript[b, i])==(Subscript[a, i]) if (Subscript[u, i]) is (RefLink[True, paclet:ref/True]) and (Subscript[b, i])=¬(Subscript[a, i]) if (Subscript[u, i]) is (RefLink[False, paclet:ref/False]).

The (Subscript[u, i]) etc. can be either (RefLink[True, paclet:ref/True]) and (RefLink[False, paclet:ref/False]) or 1 and 0.

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[k,n] is equivalent to (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[{(RefLink[IntegerDigits, paclet:ref/IntegerDigits])[k,n,2]}].

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec] gives a Boolean function object that works like (RefLink[Function, paclet:ref/Function]).

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec][(Subscript[a, 1]),(Subscript[a, 2]),…] gives an implicit representation equivalent to the explicit Boolean expression (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec,{(Subscript[a, 1]),(Subscript[a, 2]),…}].

(RefLink[BooleanConvert, paclet:ref/BooleanConvert]) converts (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec][vars] to an explicit Boolean expression.

In (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec,{(Subscript[a, 1]),(Subscript[a, 2]),…},form], the possible forms are as given for (RefLink[BooleanConvert, paclet:ref/BooleanConvert]).

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms])[spec,{(Subscript[a, 1]),(Subscript[a, 2]),…}] by default gives an expression in CNF.

OpenersPrimaryExamplesSection(Spacer1)Examples  (10)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Equivalent ways of specifying the same maxterm:

BooleanMaxterms[{{True,False,True}},{a,b,c}]

BooleanMaxterms[{{1,0,1}},{a,b,c}]

BooleanMaxterms[{5},{a,b,c}]

Specify a conjunction of maxterms:

BooleanMaxterms[{1,3,5},{a,b,c}]

An equivalent way to specify a conjunction of maxterms:

And@@Table[BooleanMaxterms[{i},{a,b,c}],{i,{1,3,5}}]

TautologyQ[Equivalent[%%,%]]

Return a (RefLink[BooleanFunction, paclet:ref/BooleanFunction]) object representing the conjunction of maxterms:

BooleanMaxterms[{1,3,5},3]@@{a,b,c}

BooleanMaxterms[{1,3,5},{a,b,c}]

TautologyQ[Equivalent[%%,%]]

Enumerate all maxterms of three variables:

Table[BooleanMaxterms[{i},{a,b,c}],{i,0,2^3-1}]

OpenersExampleSection1(Spacer1)Scope  (1)

Specify different forms for the result:

BooleanMaxterms[{1,3,5},{a,b,c},"CNF"]

BooleanMaxterms[{1,3,5},{a,b,c},"DNF"]

BooleanMaxterms[{1,3,5},{a,b,c},"ANF"]

OpenersExampleSection3(Spacer1)Applications  (1)

Produce a CNF formula for ∏(1,3,5):

BooleanMaxterms[{1,3,5},{x,y,z}]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

The indices correspond to positions of (RefLink[False, paclet:ref/False]), in the default ordering for (RefLink[BooleanTable, paclet:ref/BooleanTable]):

BooleanTable[BooleanMaxterms[{0,3,5,7},{a,b,c}],{a,b,c}]

Position[%,False]-1

(RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms]) can represent any (RefLink[BooleanFunction, paclet:ref/BooleanFunction]):

f=BooleanMaxterms[{1,5,7},3]

g=BooleanFunction[FromDigits[{1,0,1,1,1,0,1,0},2],3]

f===g

The mapping from maxterms to index:

maxdex[l_,k_]:=FromDigits[Table[If[MemberQ[l,i],0,1],{i,0,2^k-1}],2]

maxdex[{1,5,7},3]

The mapping from index to maxterms:

indmax[m_,k_]:=Flatten@Position[IntegerDigits[m,2,2^k],0]-1

indmax[186,3]

Using bit vectors:

With[{m=123,k=4},
BooleanMaxterms[Select[Range[0,2^k-1],BitAnd[(2^(2^k-1-#)),m]==0&],k]==BooleanFunction[m,k]]

Use (RefLink[Subsets, paclet:ref/Subsets]) to enumerate all possible Boolean functions using (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms]):

BooleanMaxterms[#,{a,b}]&/@Subsets[Range[0,2^2-1]]

(RefLink[BooleanMinterms, paclet:ref/BooleanMinterms]) is related to (RefLink[BooleanMaxterms, paclet:ref/BooleanMaxterms]):

f=BooleanMinterms[{1,3,5},3]

g=BooleanMaxterms[{1,3,5},3]

TautologyQ[Equivalent[f[a,b,c],¬g[¬a,¬b,¬c]]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[BooleanMinterms, paclet:ref/BooleanMinterms])  ▪  (RefLink[BooleanFunction, paclet:ref/BooleanFunction])  ▪  (RefLink[Or, paclet:ref/Or])  ▪  (RefLink[BooleanConvert, paclet:ref/BooleanConvert])  ▪  (RefLink[BooleanMinimize, paclet:ref/BooleanMinimize])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Boolean Computation, paclet:guide/BooleanComputation])}})}})