Logic
Random
construct a random Boolean function
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Random(alpha, opts)
alpha
-
list or set of symbols representing the alphabet of literals
opts
(optional) options, as specified below.
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.
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.
with⁡Logic:
Random⁡a,b
a∧b∨¬a∧¬b
Random⁡X,Y,Z
X∧Y∧Z∨Y∧¬X∧¬Z∨¬X∧¬Y∧¬Z
Random⁡a,b,form=CNF
a∨¬b∧¬a∨¬b
Random⁡a,b,c,form=CNF,clauses=10,literals=3
a∨b∨c∧a∨b∨¬c∧a∨c∨¬b∧a∨¬b∨¬c∧b∨c∨¬a∧¬a∨¬b∨¬c
Random⁡a,b,c,form=MOD2
a⁢b⁢c+b⁢c⁢a+1+c⁢a+1⁢b+1
See Also
Download Help Document