test for logical equivalence - Maple Help

Online Help

All Products    Maple    MapleSim


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

Logic[Equivalent] - test for logical equivalence

Logic[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

withLogic:

Equivalenta &and a &or b,a

true

(1)

Equivalenta &iff a &or b,b &implies a

true

(2)

Equivalenta &implies b,b &implies a,'p'

false

(3)

p

a=true,b=false

(4)

Equivalent`&not`a &and b,`&not`a &or `&not`b,'p'

true

(5)

p

Impliesa &and b,a &implies b

true

(6)

Impliesa &xor b,a &and b &or `&not`a &or `&not`b

true

(7)

Impliesb &implies a &implies c,a &iff b &or b &and c,'p'

false

(8)

p

a=false,b=true,c=false

(9)

Impliesa &or b,a &or `&not`b,'p'

false

(10)

p

a=false,b=true

(11)

See Also

Logic, Logic/Satisfy, Logic/Tautology


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam