 Equivalent - Maple Help

Logic

 Equivalent
 test for logical equivalence
 Implies
 test for logical implication Calling Sequence Equivalent(a, b, p) Implies(a, b, p) Parameters

 a, b - Boolean expressions p - (optional) unevaluated name Description

 • The Equivalent and Implies commands test the Boolean expressions a and b for logical equivalence or logical implication respectively.
 • The Equivalent(a, b) calling sequence returns true in the event that the two expressions are logically equivalent, and false if they are not.  Similarly, Implies(a, b) returns true if a implies b (that is, if for every valuation for which a is true, then b is also true) and false otherwise.
 • If the parameter p is supplied and the test returns false, then a valuation is assigned to p which demonstrates a negative result.  Otherwise, p is assigned NULL.
 Note: The test may be significantly faster if p is not given. Examples

 > $\mathrm{with}\left(\mathrm{Logic}\right):$
 > $\mathrm{Equivalent}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&and\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right),a\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{Equivalent}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&iff\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right),b\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{Equivalent}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b,b\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a,'p'\right)$
 ${\mathrm{false}}$ (3)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}\right\}$ (4)
 > $\mathrm{Equivalent}\left(¬\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&and\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right),\left(¬\left(a\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(¬\left(b\right)\right),'p'\right)$
 ${\mathrm{true}}$ (5)
 > $p$
 > $a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&and\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b⇒a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b$
 ${\mathrm{true}}$ (6)
 > $a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&xor\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b⇒\left(\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&and\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(¬\left(a\right)\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(¬\left(b\right)\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{Implies}\left(\left(b\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&implies\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}c,\left(\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&iff\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&and\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}c,'p'\right)$
 ${\mathrm{false}}$ (8)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}{,}{c}{=}{\mathrm{false}}\right\}$ (9)
 > $\mathrm{Implies}\left(a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}b,a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&or\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(¬\left(b\right)\right),'p'\right)$
 ${\mathrm{false}}$ (10)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}\right\}$ (11)