construct the truth table of a Boolean expression - Maple Help

Online Help

All Products    Maple    MapleSim


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= [x1,...,xn], where x1,...,xn, are identifiers in the expression, then T[v1,...,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

withLogic:

T1:=TruthTablea &xor b,a,b:

T1true,false

true

(1)

T2:=TruthTable`&not`a &nor b &iff c,a,b,c:

T2true,false,false

false

(2)

T3:=TruthTablea &xor b,a,b,form=MOD2:

T31,0

1

(3)

See Also

Logic, Logic/Satisfy, type[tabular]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam