Created
September 15, 2019 07:50
-
-
Save kateinoigakukun/faf6a952e97d7710f7ee8f4515d6cf21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infix operator |: MultiplicationPrecedence | |
infix operator ∧: MultiplicationPrecedence | |
infix operator ∨: MultiplicationPrecedence | |
infix operator ⊃: MultiplicationPrecedence | |
prefix operator ¬ | |
func |(lhs: Bool, rhs: Bool) -> Bool { | |
switch (lhs, rhs) { | |
case (true, true): return false | |
case (true, false): return true | |
case (false, true): return true | |
case (false, false): return true | |
} | |
} | |
prefix func ¬(value: Bool) -> Bool { | |
return value | value | |
} | |
func ∧(lhs: Bool, rhs: Bool) -> Bool { | |
return (lhs | rhs) | (lhs | rhs) | |
} | |
func ∨(lhs: Bool, rhs: Bool) -> Bool { | |
return (lhs | lhs) | (rhs | rhs) | |
} | |
func ⊃(lhs: Bool, rhs: Bool) -> Bool { | |
return lhs | (rhs|rhs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment