Skip to content

Instantly share code, notes, and snippets.

@ikedaisuke
Created July 17, 2011 13:23
Show Gist options
  • Save ikedaisuke/1087586 to your computer and use it in GitHub Desktop.
Save ikedaisuke/1087586 to your computer and use it in GitHub Desktop.
CoPL Nat Derivation Rules
module Nat where
data Nat : Set where
Z : Nat
S : Nat -> Nat
data _plus_is_ : Nat -> Nat -> Nat -> Set where
P-Zero : (m n : Nat) -> Z plus m is n
P-Succ : (l m n : Nat) -> l plus m is n -> (S l) plus m is (S n)
data _times_is_ : Nat -> Nat -> Nat -> Set where
T-Zero : (n : Nat) -> Z times n is Z
T-Succ : (x y z w : Nat) -> x times y is z -> y plus z is w ->
(S x) times y is w
q1 : Z plus Z is Z
q1 = P-Zero Z Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment