Coq:作为变量的宇宙的符号或定义
Coq: Notation or Definition on a universe as a variable
是否可以在宇宙上定义一个符号或定义作为一个变量?以下
Universe x.
Notation "/ x" := Type@{x}.
结果左侧 x
为变量,右侧 x
为常量:
Check /u. (*Type@{x} : Type@{x+1}*)
您在找这样的东西吗?
Set Universe Polymorphism.
Definition in_type@{i} x := (x : Type@{i}).
Check in_type@{Set} nat.
请注意,定义必须是全域多态的才能起作用。
是否可以在宇宙上定义一个符号或定义作为一个变量?以下
Universe x.
Notation "/ x" := Type@{x}.
结果左侧 x
为变量,右侧 x
为常量:
Check /u. (*Type@{x} : Type@{x+1}*)
您在找这样的东西吗?
Set Universe Polymorphism.
Definition in_type@{i} x := (x : Type@{i}).
Check in_type@{Set} nat.
请注意,定义必须是全域多态的才能起作用。