20 lines
338 B
C++
20 lines
338 B
C++
#include "logicfunctions.h"
|
|
|
|
// Compute xor
|
|
void exclusive(bool x, bool y, bool& ans){
|
|
ans = x ^ y;
|
|
}
|
|
|
|
// Compute implication
|
|
void implies(bool x, bool y, bool& ans){
|
|
if (!(x || y)) {
|
|
ans = true;
|
|
} else {
|
|
ans = y;
|
|
}
|
|
}
|
|
|
|
// Compute equivalence
|
|
void equivalence(bool x, bool y, bool& ans){
|
|
ans = x == y;
|
|
} |