what does the colon greater than sign mean in coq

浪尽此生 提交于 2019-12-10 17:25:29

问题


For example

Record posreal : Type := mkposreal {pos :> R; cond_pos : 0 < pos}.

what does the ":>" mean? I hope this isn't a duplicate, but a symbol is hard to search for.


回答1:


In this particular case it inserts a Coercion from the posreal record to its field pos. This means you can use a posreal for an R in most cases.

Try:

Definition idR (x : R) := x.
Variable (r : posreal).
Compute (idR r).

See https://coq.inria.fr/refman/Reference-Manual021.html#Coercions-and-records



来源:https://stackoverflow.com/questions/41191707/what-does-the-colon-greater-than-sign-mean-in-coq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!