Supposons que j'ai quelque chose comme ceci:Puis-je utiliser une notation pour un type inductif pour définir ce type dans Coq?
Inductive SubtypeOf :
Gamma -> UnsafeType -> Type -> Set :=
| SubRefl :
forall (gamma : GammaEnv) (u : UnsafeType)
, SubtypeOf gamma u u
| SubTrans :
forall (gamma : GammaEnv) (u1 u2 u3 : Type)
, SubtypeOf gamma u1 u2
-> SubtypeOf gamma u2 u3
-> SubtypeOf gamma u1 u3.
Et une notation définie:
Notation "G |- x <: y " := (SubtypeOf G x y) (at level 50).
Est-il possible que je peux apporter cette notation dans la portée de la définition de SubtypeOf
, donc Je pourrais faire quelque chose comme ceci:
Inductive SubtypeOf :
Gamma -> UnsafeType -> Type -> Set :=
| SubRefl :
forall (gamma : GammaEnv) (u : UnsafeType)
, gamma |- u <: u
| SubTrans :
forall (gamma : GammaEnv) (u1 u2 u3 : Type)
, gamma |- u1 <: u2
-> gamma |- u2 <: u3
-> gamma |- u1 <: u3.
Oui, recherchez 'Réservé Notation' et' où' dans le manuel Coq. – ejgallego
@ejgallego Parfait, mettez cela comme une réponse et je vais accepter! – jmite