Skip to content

Commit f6c1970

Browse files
committed
more
1 parent 1ceb6ea commit f6c1970

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

_CoqProject.test-suite

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ tests/fun_instance.v
8181
tests/issue284.v
8282
tests/issue287.v
8383
tests/monoid_law_structure.v
84+
tests/monoid_law_structure_clone.v
8485

8586
-R tests HB.tests
8687
-R examples HB.examples

tests/monoid_law_structure.v

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,4 @@ HB.mixin Record isPreMonoid T := {
1515
HB.structure Definition PreMonoid := { T of isPreMonoid T }.
1616

1717
HB.structure Definition Monoid :=
18-
{ T of isPreMonoid T &
19-
isMonLaw T zero add }.
20-
(* isMonLaw T (@zero (PreMonoid.clone T _)) (@add (PreMonoid.clone T _))*)
18+
{ T of isPreMonoid T & isMonLaw T zero add }.

tests/monoid_law_structure_clone.v

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
From HB Require Import structures.
2+
3+
HB.mixin Record isMonLaw T (e : T) (op : T -> T -> T) := {
4+
opmA : forall a b c, op (op a b) c = op a (op b c);
5+
op1m : forall x, op e x = x;
6+
opm1 : forall x, op x e = x;
7+
}.
8+
9+
HB.structure Definition MonLaw T e := { op of isMonLaw T e op }.
10+
11+
HB.mixin Record isPreMonoid T := {
12+
zero : T;
13+
add : T -> T -> T;
14+
}.
15+
HB.structure Definition PreMonoid := { T of isPreMonoid T }.
16+
17+
HB.structure Definition Monoid :=
18+
{ T of isPreMonoid T &
19+
isMonLaw T (@zero (PreMonoid.clone T _)) (@add (PreMonoid.clone T _)) }.

0 commit comments

Comments
 (0)