7

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
  • There are other meanings to the :> symbol. It's better to make the title of your question more precise, unless you are interested in all the meanings. Commented Dec 17, 2016 at 7:55

1 Answer 1

9

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

1
  • Ah, I suspected it was a type of inheritance, thanks
    – davik
    Commented Dec 16, 2016 at 20:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.