utils: add equivalence

This commit is contained in:
Antoine Viallon 2024-01-05 23:12:22 +01:00
parent 43b2dc9e93
commit 18a813f4c7
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -1,2 +1,6 @@
def implies(a: bool, b: bool) -> bool:
return (not b and not a) or b
def equivalence(a: bool, b: bool) -> bool:
return implies(a, b) and implies(b, a)