Nat.agda 404 B

123456789101112131415161718192021222324252627282930
  1. module Nat where
  2. import Bool
  3. open Bool
  4. data Nat : Set where
  5. zero : Nat
  6. suc : Nat -> Nat
  7. infixr 25 _+_
  8. _+_ : Nat -> Nat -> Nat
  9. zero + m = m
  10. suc n + m = suc (n + m)
  11. infix 10 _==_ _<_
  12. _==_ : Nat -> Nat -> Bool
  13. zero == zero = true
  14. suc n == zero = false
  15. zero == suc m = false
  16. suc n == suc m = n == m
  17. _<_ : Nat -> Nat -> Bool
  18. n < zero = false
  19. zero < suc m = true
  20. suc n < suc m = n < m