【发布时间】:2017-07-03 12:13:32
【问题描述】:
以下代码:
Reserved Notation "g || t |- x < y" (at level 10).
Inductive SubtypeOf :
GammaEnv -> ThetaEnv -> UnsafeType -> UnsafeType -> Set :=
| SubRefl :
forall (gamma : GammaEnv) (theta : ThetaEnv) (u : UnsafeType) , gamma || theta |- u < u
where "g || t |- x < y" := (SubtypeOf g t x y).
给出以下错误:
Syntax error: '<' expected after [constr:operconstr level 200] (in [constr:operconstr])
如果我使用<: 代替<,我会收到类似的错误。
但是这段代码可以正常工作:
Reserved Notation "g || t |- x << y" (at level 10).
Inductive SubtypeOf :
GammaEnv -> ThetaEnv -> UnsafeType -> UnsafeType -> Set :=
| SubRefl :
forall (gamma : GammaEnv) (theta : ThetaEnv) (u : UnsafeType) , gamma || theta |- u << u
where "g || t |- x << y" := (SubtypeOf g t x y).
为什么?是否可以更改优先设置以允许< 或<: 使用符号?是否有我遇到的内置语法,并且在定义符号时需要注意?
【问题讨论】:
标签: parsing syntax operators coq notation