| 1 |
(* Check that dependencies in the indices of the type of the terms to |
| 2 |
match are taken into account and correctly generalized *) |
| 3 |
|
| 4 |
Require Import Relations.Relation_Definitions. |
| 5 |
Require Import Basics. |
| 6 |
|
| 7 |
Record Base := mkBase |
| 8 |
{(* Primitives *) |
| 9 |
World : Set |
| 10 |
(* Names are real, links are theoretical *) |
| 11 |
; Name : World -> Set |
| 12 |
|
| 13 |
; wweak : World -> World -> Prop |
| 14 |
|
| 15 |
; exportw : forall a b : World, (wweak a b) -> (Name b) -> option (Name a) |
| 16 |
}. |
| 17 |
|
| 18 |
Section Derived. |
| 19 |
Variable base : Base. |
| 20 |
Definition bWorld := World base. |
| 21 |
Definition bName := Name base. |
| 22 |
Definition bexportw := exportw base. |
| 23 |
Definition bwweak := wweak base. |
| 24 |
|
| 25 |
Arguments bexportw [a b]. |
| 26 |
|
| 27 |
Inductive RstarSetProof {I : Type} (T : I -> I -> Type) : I -> I -> Type := |
| 28 |
starReflS : forall a, RstarSetProof T a a |
| 29 |
| starTransS : forall i j k, T i j -> (RstarSetProof T j k) -> RstarSetProof T i k. |
| 30 |
|
| 31 |
Arguments starTransS [I T i j k]. |
| 32 |
|
| 33 |
Definition RstarInv {A : Set} (rel : relation A) : A -> A -> Type := (flip (RstarSetProof (flip rel))). |
| 34 |
|
| 35 |
Definition bwweakFlip (b a : bWorld) : Prop := (bwweak a b). |
| 36 |
Definition Rweak : forall a b : bWorld, Type := RstarInv bwweak. |
| 37 |
|
| 38 |
Fixpoint exportRweak {a b} (aRWb : Rweak a b) (y : bName b) : option (bName a) := |
| 39 |
match aRWb,y with |
| 40 |
| starReflS _ a, y' => Some y' |
| 41 |
| starTransS jWk jRWi, y' => |
| 42 |
match (bexportw jWk y) with |
| 43 |
| Some x => exportRweak jRWi x |
| 44 |
| None => None |
| 45 |
end |
| 46 |
end. |
| 47 |
|
| 48 |
End Derived. |