Close
Close window
Equivalent - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

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

>

with(Logic):

>

Equivalent(a &and (a &or b), a);

true

(1)
>

Equivalent(a &iff (a &or b), b &implies a);

true

(2)
>

Equivalent(a &implies b, b &implies a, 'p');

false

(3)
>

p;

a=false,b=true

(4)
>

Equivalent(&not(a &and b), (&not a) &or (&not b), 'p');

true

(5)
>

p;

>

Implies(a &and b, a &implies b);

true

(6)
>

Implies(&xor(a,b), &and(a,b) &or (&not a) &or (&not b));

true

(7)
>

Implies(b &implies a &implies c, (a &iff b) &or b &and c, 'p');

false

(8)
>

p;

a=false,b=true,c=false

(9)
>

Implies(a &or b, a &or (&not b), 'p');

false

(10)
>

p;

a=false,b=true

(11)


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /