The structural feature record for inductive types can be used to define record types. A derived declaration for this features consists of:
The syntax for a derived declaration of the record feature looks as follows:
record <name>(<parameter list>)
=
<out1>: <args1> ⟶ <tp1>
…
<outn>: <argsn> ⟶ <tpn>
Here we have the outgoing declarations <out1>
, …, <outn>
defining the names <out1>
, …, <outn>
and types <tp1>
, …, <tpn>
of the record fields. The types <tp1>
, …, <tpn>
may depend on the parameters given in <parameter list>
(similar to theory parameters).
There is an additional convenience feature record_term to construct instances of a record type. A derived declaration for this feature consists of:
<name>
of the derived declaration<parameter list>
of parameters of the derived declaration<recTp>
of which we want to construct an instance and values <parameters for recTp>
for the parameters of <recTp>
The syntax for a derived declaration of a record_term is as follows:
record <name>(<parameter list>): <recTp>(<parameters for recTp>)
=
<out1>
= <def1>
…
<outn>
= <defn>
Here we have the outgoing declarations <out1>
, …, <outn>
defining the values <def1>
, …, <defn>
of the record fields. These values, as well as the values in <parameters for recTp>
may depend on the parameters given in <parameter list>
.