| 1 |
(* Check that possible instantiation made during evar materialization |
| 2 |
are taken into account and do not raise Not_found *) |
| 3 |
|
| 4 |
Set Implicit Arguments. |
| 5 |
|
| 6 |
Record SpecializedCategory (obj : Type) (Morphism : obj -> obj -> Type) := { |
| 7 |
Object :> _ := obj; |
| 8 |
|
| 9 |
Identity' : forall o, Morphism o o; |
| 10 |
Compose' : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d' |
| 11 |
}. |
| 12 |
|
| 13 |
Section SpecializedCategoryInterface. |
| 14 |
Variable obj : Type. |
| 15 |
Variable mor : obj -> obj -> Type. |
| 16 |
Variable C : @SpecializedCategory obj mor. |
| 17 |
|
| 18 |
Definition Morphism (s d : C) := mor s d. |
| 19 |
Definition Identity (o : C) : Morphism o o := C.(Identity') o. |
| 20 |
Definition Compose (s d d' : C) (m : Morphism d d') (m0 : Morphism s d) : |
| 21 |
Morphism s d' := C.(Compose') s d d' m m0. |
| 22 |
End SpecializedCategoryInterface. |
| 23 |
|
| 24 |
Section ProductCategory. |
| 25 |
Variable objC : Type. |
| 26 |
Variable morC : objC -> objC -> Type. |
| 27 |
Variable objD : Type. |
| 28 |
Variable morD : objD -> objD -> Type. |
| 29 |
Variable C : SpecializedCategory morC. |
| 30 |
Variable D : SpecializedCategory morD. |
| 31 |
|
| 32 |
(* Should fail nicely *) |
| 33 |
Definition ProductCategory : @SpecializedCategory (objC * objD)%type (fun s d |
| 34 |
=> (morC (fst s) (fst d) * morD (snd s) (snd d))%type). |
| 35 |
Fail refine {| |
| 36 |
Identity' := (fun o => (Identity (fst o), Identity (snd o))); |
| 37 |
Compose' := (fun s d d' m2 m1 => (Compose (fst m2) (fst m1), Compose (snd |
| 38 |
m2) (snd m1))) |
| 39 |
|}. |
| 40 |
Abort. |
| 41 |
End ProductCategory. |