Coq:释放宇宙

时间:2017-03-18 20:04:25

标签: coq

Coq中的Reset(或更普遍的,免费的)宇宙是否有办法?

Universe M.
Print Sorted Universes. (*M = Type.2*)
Fail Print M. (*Error: M not a defined object.*)
Reset M.
Print Sorted Universes. (*M = Type.2*)
Definition M := Type@{M}.
Print M. (*M = Type: Type*)
Print Sorted Universes. (*M = Type.2*)
Reset M.
Fail Print M. (*Error: M not a defined object.*)
Print Sorted Universes. (*M = Type.2*)

无论我做什么,M = Type.2。我在Coq 8.5

1 个答案:

答案 0 :(得分:0)

我找到了两种方法。 Reset Initial会破坏整个环境(通常不止一个人想要)。另一种方法是屏蔽具有模块的Universe

Universe M R. Constraint M < R.
Definition M := Type@{M}. Definition R := Type@{R}.
Check M:R. Fail Check R:M. (*the hierarchy holds*)

(*1. w/ modules:*)
Module i.
Universe M R. Constraint R < M.
Check M:R. Fail Check R:M. (*still holds*)
Definition M := Type@{M}. Definition R := Type@{R}. (*but now..*)
Fail Check M:R. Check R:M.  (*not any more*)
Print Sorted Universes. (*2 Rs and Ms, w/ the old hierarchy masked by the new one*)
End i.

(*outside the module the old hierarchy holds*)
Check M:R. Fail Check R:M.

(*2. w/ Reset Initial:*)
Reset Initial. Fail Check M:R. Fail Check R:M.
Print Sorted Universes. (*the def-d univ-s are gone*)