Created
April 18, 2014 20:56
-
-
Save hallettj/11064048 to your computer and use it in GitHub Desktop.
basic mathematical logic in Idris
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
module Logic | |
infixr 1 ==> | |
(==>) : Bool -> Bool -> Bool | |
False ==> _ = True | |
True ==> x = x | |
data Exists : (A : Type) -> (P : A -> Bool) -> Type where | |
exists : {A : Type} -> {P : A -> Bool} -> (a : A) -> so (P a) -> Exists A P | |
prop : Exists Integer (\n => n > 0) | |
prop = exists 2 oh | |
prop' : Exists Integer (\n => (n == 2) ==> (n /= 3)) | |
prop' = exists 2 oh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment