construct the truth table of a Boolean expression - Maple Help

Home : Support : Online Help : Programming : Logic : Boolean : Logic Package : Logic/TruthTable

Logic[TruthTable] - construct the truth table of a Boolean expression

 Calling Sequence TruthTable(expr, L, opt)

Parameters

 expr - Boolean expression L - list of identifiers appearing in the expression opt - (optional) equation of the form form=tblform, where tblform is either boolean or MOD2.

Description

 • The TruthTable command returns the truth table  corresponding to the Boolean expression expr.
 • The parameter L, a list of identifiers appearing in the expression, determines the ordering used for table indices.  That is, if T is the table returned and L= $[\mathrm{x1},...,\mathrm{xn}]$, where $\mathrm{x1},...,\mathrm{xn}$, are identifiers in the expression, then $T[\mathrm{v1},...,\mathrm{vn}]$ is equivalent to eval( expr, [x1=v1, ..., xn=vn] ).
 • The truth table returned is of type tabular.
 • The optional parameter form=tblform specifies the type of the inputs and output; by default, this is boolean.  If form=MOD2 is specified, then the indices and entries will be zeroes and ones.

Examples

 > $\mathrm{with}\left(\mathrm{Logic}\right):$
 > $\mathrm{T1}:=\mathrm{TruthTable}\left(a&xorb,\left[a,b\right]\right):$
 > ${\mathrm{T1}}_{\mathrm{true},\mathrm{false}}$
 ${\mathrm{true}}$ (1)
 > $\mathrm{T2}:=\mathrm{TruthTable}\left(\mathrm{¬}\left(a\right)&norb&iffc,\left[a,b,c\right]\right):$
 > ${\mathrm{T2}}_{\mathrm{true},\mathrm{false},\mathrm{false}}$
 ${\mathrm{false}}$ (2)
 > $\mathrm{T3}:=\mathrm{TruthTable}\left(a&xorb,\left[a,b\right],\mathrm{form}=\mathrm{MOD2}\right):$
 > ${\mathrm{T3}}_{1,0}$
 ${1}$ (3)