ModuleB.agda 828 B

123456789101112131415161718192021222324252627282930313233343536
  1. -- This module is used to illustrate how to import a parameterised module.
  2. module examples.syntax.ModuleB
  3. (A : Set)
  4. ((==) : A -> A -> Prop)
  5. (refl : (x : A) -> x == x)
  6. where
  7. infix 5 /\
  8. module SubModule where
  9. postulate dummy : A
  10. data True : Prop where
  11. tt : True
  12. data False : Prop where
  13. data (/\) (P, Q : Prop) : Prop where
  14. andI : P -> Q -> P /\ Q
  15. data List : Set where
  16. nil : List
  17. cons : A -> List -> List
  18. eqList : List -> List -> Prop
  19. eqList nil nil = True
  20. eqList (cons x xs) nil = False
  21. eqList nil (cons y ys) = False
  22. eqList (cons x xs) (cons y ys) = x == y /\ eqList xs ys
  23. reflEqList : (xs : List) -> eqList xs xs
  24. reflEqList nil = tt
  25. reflEqList (cons x xs) = andI (refl x) (reflEqList xs)