Question

Since ((NOT A) XOR B) and A→B ("iff....then") (~A→~B) are logically same (e.g. login can not happen unless authentication happens) does that have any practical use or is just a logic tautology and the programmer can decide arbitrarily where to use XOR and where to use if...then?

An example rewrite is payment→delivery ("iff payment() == 'complete' then delivery()") rewritten to ((NOT payment()) XOR delivery())

EDIT: Truth table

A: payment B: delivery

A  B  A' (A→B) (A' XOR B) (A' OR B)
T  T  F    T      T           T
T  F  F    F      F           F

Where the failure is

A  B  A' (A→B) (A' XOR B) (A' OR B)
T  F  F    F      F           F

And that a case where A is false is simply a false B and all of the below just means that B is false (since NOT A).

A  B  A' (A→B) (A' XOR B) (A' OR B)
F  T  T    T      F           T
F  F  T    T      T           T

or goal → score ^ ¬goal→¬score so that there is determinism and no other way (you can't score if you don't make a goal).

Was it helpful?

Solution

A→B is equivalent to (A' OR B). These are logically the same and can be used interchangeably.

Construct truth tables for A→B and (A' XOR B) and you'll see they are not logically equivalent.

EDIT: Here's the truth table

EDIT2: Updated truth table with (B iff A), which yes, is logically equivalent to (A' XOR B) and can be used interchangeably.

A  B  A' (A→B) (A' XOR B) (A' OR B)    (B iff A)
T  T  F    T      T           T           T
T  F  F    F      F           F           F
F  T  T    T      F           T           F
F  F  T    T      T           T           T
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top