projet-traduction-langage/fichiersRat/src-rat-tam-test/testfun6.rat
2021-11-24 14:13:45 +01:00

39 lines
652 B
Plaintext

bool and (bool b1 bool b2){
if b1 {
if b2 { return true; }
else { return false; }
} else {
return false;
}
}
bool or (bool b1 bool b2){
if b1 {
return true;
} else {
if b2 { return true; }
else { return false; }
}
}
bool not (bool b) {
if b { return false; } else { return true; }
}
bool implies (bool p bool q) {
return (call or((call not (p)) q));
}
bool veriftranspose(bool a bool b){
return ((call implies(a b)) = (call implies((call not(b)) (call not(a)))));
}
test{
bool a = true;
bool b = true;
print (call veriftranspose(a b));
a = true;
b = false;
print (call veriftranspose(a b));
}