Created
January 17, 2019 20:43
-
-
Save artemohanjanyan/855fe9c8c5bc6450c5081d85d94ad038 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
module EvenOdd | |
import Data.Fin | |
%access public export | |
%default total | |
data Even : (n: Nat) -> Type where | |
ZEven : Even Z | |
SsEven : (n: Nat) -> Even n -> Even (S (S n)) | |
data Odd : Nat -> Type where | |
OneOdd : Odd 1 | |
SsOdd : Odd n -> Odd (2 + n) | |
oddNotZero : Odd 0 -> Void | |
oddNotZero OneOdd impossible | |
oddNotZero (SsOdd _) impossible | |
notOddSs : Not (Odd n) -> Not (Odd (2 + n)) | |
notOddSs a b = case b of | |
(SsOdd x) => ?notOddSs_rhs_2 | |
evenNotOdd : Even n -> Not (Odd n) | |
evenNotOdd ZEven = oddNotZero | |
evenNotOdd (SsEven n x) = | |
let rec = evenNotOdd x | |
in notOddSs rec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment