forked from math-comp/hierarchy-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a8a5f
commit d79445b
Showing
4 changed files
with
64 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From HB Require Import structures. | ||
|
||
HB.mixin Record m1 T := { default1 : T }. | ||
|
||
HB.mixin Record m2 T := { default2 : T }. | ||
|
||
HB.structure Definition s1 := { T of m1 T }. | ||
HB.structure Definition s2 := { T of m2 T }. | ||
|
||
HB.instance Definition _ (X : s1.type) : m1 (list X) := | ||
m1.Build (list X) (cons default1 nil). | ||
HB.instance Definition list_m2 (X : s2.type) : m2 (list X) := | ||
m2.Build (list X) (cons default2 nil). | ||
|
||
HB.structure Definition s3 := { T of m1 T & m2 T }. | ||
|
||
HB.about list. (* should have s3 *) | ||
|
||
(* The s3 instance on list should be synthetized automatically, *) | ||
(* this is nontrivial because the parameters are not the same *) | ||
(* but there is a join in the hierarchy, so it can be defined. *) | ||
(* Actually just recalling the list_m2 instance above suffices. *) | ||
HB.instance Definition _ (X : s3.type) := list_m2 X. | ||
HB.about list. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters