Logic - Maple Programming 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

Parameters

Description

Examples

Compatibility

Calling Sequence

TruthTable(expr, L, opt)

Parameters

expr

-

Boolean expression

L

-

(optional) list of identifiers appearing in the expression

opt

-

(optional) equation(s) of the form option=value, where option is one of 'output' or 'form'; specify options for the TruthTable command

Description

• 

The TruthTable command returns the truth table corresponding to the Boolean expression expr.

• 

The optional parameter L, which can only be used with output=table, specifies a list of identifiers appearing in the expression. This list 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] ).

  

If L is omitted, the identifiers appearing in the expression are listed in the resulting truth table in lexicographical order.

• 

The optional parameter output=returnform specifies the form of the returned truth table: table, Matrix, or 'DataFrame'.  The default is 'DataFrame'.

• 

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:

T1TruthTablea &xor b

T1:=abvalue1falsefalsefalse2falsetruetrue3truefalsetrue4truetruefalse

(1)

TruthTablea &xor b,output=Matrix

falsefalsefalsefalsetruetruetruefalsetruetruetruefalse

(2)

TruthTablea &xor b,output=table

tablefalse,false=false,false,true=true,true,false=true,true,true=false

(3)

T2TruthTable`&not`a &nor b &iff c,a,b,c,output=table:

T2true,false,false

false

(4)

T3TruthTablea &xor b,a,b,form=MOD2,output=table:

T31,0

1

(5)

Compatibility

• 

The Logic[TruthTable] command was updated in Maple 2016.

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