Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. module OpClassesRepro
  2.  
  3. record SemigroupRec (t : Type) (op : t -> t -> t) where
  4. constructor SemigroupInfo
  5. associative : (a : t) -> (b : t) -> (c : t) -> (op (op a b) c = op a (op b c))
  6.  
  7. resolveSemigroup
  8. : {auto associative : (a : t) -> (b : t) -> (c : t) -> (op (op a b) c = op a (op b c))}
  9. -> SemigroupRec t op
  10. resolveSemigroup {associative} = SemigroupInfo associative
  11.  
  12. %hint
  13. addAssoc
  14. : (a : Nat) -> (b : Nat) -> (c : Nat) -> plus (plus a b) c = plus a (plus b c)
  15. addAssoc a b c = sym (plusAssociative a b c)
  16.  
  17. %hint
  18. create : SemigroupRec Nat Prelude.Nat.plus
  19. create = resolveSemigroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement