Random - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Logic

  

Random

  

construct a random Boolean function

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Random(alpha, opts)

Parameters

alpha

-

list or set of symbols representing the alphabet of literals

opts

-

(optional) options, as specified below.

Options

  

The opts parameter is used to specify one or more additional properties of the Array. If a property is included in the calling sequence, it must be an equation of the form keyword = value. The permissible options are described in this section.

  

clauses=c

  

Specifies the number of clauses in the generated formula. The default is the size of the alphabet alpha.

  

form=fname

  

Specifies the form of boolean canonical formula to produce. Valid options are DNF (disjunctive normal form), CNF (conjunctive normal form), or MOD2 (arithmetic modulo 2). The default is DNF.

  

literals=l

  

Specifies the number of literals appearing in each clause. A literal in this context is either a symbol from the alphabet or the negation of such a symbol. The default is the size of the alphabet alpha.

Description

• 

The Random command returns a random Boolean expression using the symbols from alpha.

• 

The Boolean expression returned is in a specific canonical form with respect to the symbols in alpha. By default, disjunctive normal form is used.

Examples

withLogic:

Randoma,b

ab¬a¬b

(1)

RandomX,Y,Z

XYZY¬X¬Z¬X¬Y¬Z

(2)

Randoma,b,form=CNF

a¬b¬a¬b

(3)

Randoma,b,c,form=CNF,clauses=10,literals=3

abcab¬cac¬ba¬b¬cbc¬a¬a¬b¬c

(4)

Randoma,b,c,form=MOD2

abc+bca+1+ca+1b+1

(5)

Compatibility

See Also

Logic