Logic - Maple Programming Help

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

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&and\left(a&orb\right),a\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{Equivalent}\left(a&iffa&orb,b&impliesa\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{Equivalent}\left(a&impliesb,b&impliesa,'p'\right)$
 ${\mathrm{false}}$ (3)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}\right\}$ (4)
 > $\mathrm{Equivalent}\left(\mathrm{¬}\left(a&andb\right),\mathrm{¬}\left(a\right)&or\mathrm{¬}\left(b\right),'p'\right)$
 ${\mathrm{true}}$ (5)
 > $p$
 > $\mathrm{Implies}\left(a&andb,a&impliesb\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{Implies}\left(a&xorb,\left(a&andb&or\mathrm{¬}\left(a\right)\right)&or\mathrm{¬}\left(b\right)\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{Implies}\left(\left(b&impliesa\right)&impliesc,\left(\left(a&iffb\right)&orb\right)&andc,'p'\right)$
 ${\mathrm{false}}$ (8)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}{,}{c}{=}{\mathrm{false}}\right\}$ (9)
 > $\mathrm{Implies}\left(a&orb,a&or\mathrm{¬}\left(b\right),'p'\right)$
 ${\mathrm{false}}$ (10)
 > $p$
 $\left\{{a}{=}{\mathrm{false}}{,}{b}{=}{\mathrm{true}}\right\}$ (11)