Logic - Maple Programming Help

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

Logic

 Import
 express in terms of Logic package operators

 Calling Sequence Import(expr, {form})

Parameters

 expr - expression form - expression where form=MOD2 or form=boolean

Description

 • The Import command transforms a Maple expression of a specified type into one suitable for use by the Logic package.

Available Conversions

 The following conversions are available (form must be one of these).
 • MOD2:  An input polynomial is converted to a boolean expression by mapping multiplication to &and, addition to &xor, $0$ to true, and $1$ to false.
 • boolean: Any ternary logical operators (for example, and, or, and not) present in the expression are replaced with the equivalent Logic package operators.

Examples

 > $\mathrm{with}\left(\mathrm{Logic}\right):$
 > $\mathrm{Import}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}c,\mathrm{form}=\mathrm{boolean}\right)$
 $\left({a}{\vee }{b}\right){\vee }{c}$ (1)
 > $\mathrm{Import}\left(\mathbf{not}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left(a\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{xor}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}b\right)⇒c,\mathrm{form}=\mathrm{boolean}\right)$

 Logic:-&implies(¬(a &xor b), c)

 > $\mathrm{Import}\left(x\left(y+1\right)+z+1,\mathrm{form}=\mathrm{MOD2}\right)$
 ${¬}{x}{\wedge }{¬}{y}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{xor}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{z}$ (2)