Angenommen, ich habe so etwas wie dies:Kann ich eine Notation für einen induktiven Typ verwenden, um diesen Typ in Coq zu definieren?
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.
Und eine Notation definiert:
Notation "G |- x <: y " := (SubtypeOf G x y) (at level 50).
Gibt es eine Möglichkeit, diese Notation in Rahmen für die Definition von SubtypeOf
bringen kann, so ich könnte so etwas tun:
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.
Ja, suchen Sie nach 'Reserved Notation' und' Where' im Coq-Handbuch. – ejgallego
@ejgallego Perfekt, setzen Sie dies als Antwort und ich werde akzeptieren! – jmite