@@ -42,12 +42,12 @@ \chapter{Organizing Theories}{}
4242dependent types, coercions and canonical instances of structures. It
4343is only a `` simple matter of programming'' , albeit one that involves
4444some new formalisation idioms. This chapter describes the most
45- important: telescopes, packed classes, and phantom parameters.
45+ important ones : telescopes, packed classes, and phantom parameters.
4646% class coercions, and quotation.
4747
4848While some of these formalisation patterns are quite technical, casual
4949users do not need to master them all. Indeed the documented interface
50- of structures suffices to use and declare instances of structures. We
50+ of structures suffices for using and declaring instances of structures. We
5151describe these interfaces first, so only those who wish to extend old
5252or create new hierarchies need to read on.
5353
@@ -157,7 +157,7 @@ \section{Structure interface}\label{str:itf}
157157
158158Line 1 bundles the additive operations (0, $ +$ , $ -$ ) and their
159159properties in a \emph {mixin }, which is then used in line 2 to create a
160- canonical instance. After line 2 all the additive algebra provided in
160+ canonical instance. After line 2 all the additive algebra provided by
161161\lib {ssralg} becomes applicable to \lstinline /'I_p /; for example \C {0}
162162denotes the zero element, and \C {i + 1} denotes the successor of \C {i} mod $ p$ .
163163
@@ -570,7 +570,7 @@ \section{Packed classes}\label{sec:packed}
570570\begin {coq }{name=packed22}{}
571571Coercion base : class_of >-> Equality.class_of.
572572Coercion mixin : class_of >-> mixin_of.
573- Coercion sort : type >-> Sortclass .
573+ Coercion sort : type >-> SortClass .
574574Variables (T : Type) (cT : type).
575575Definition class := let: @Pack _ c as cT' := cT return class_of cT' in c.
576576Definition eqType := Equality.Pack class.
@@ -705,9 +705,9 @@ \section{Packed classes}\label{sec:packed}
705705Two structures extend rings independently: \C {comRingType} provides
706706multiplication commutativity, and \C {unitRingType} provides computable
707707inverses for all units (i.e., invertible elements) along with a test
708- of invertibility. These structures are incomparable, and there are reasonable
708+ of invertibility. These structures are incomparable, as there are reasonable
709709instances of each: $ 2 \times 2 $ matrices over $ \mathbb {Q}$ have
710- computable inverses but do not commute, while polynomials over
710+ computable inverses but do not commute, whereas polynomials over
711711$ \mathbb {Z}_p$ commute but do not have easily computable inverses.
712712The respective definitions of \C {comRingType} and \C {unitRingType} follow exactly
713713the pattern we have seen,
@@ -875,7 +875,7 @@ \section{Parameters and constructors}\label{sec:phant}
875875
876876For example, each packed class contains exactly the same definition of
877877the clone constructor\footnote {More precisely, the situation is slightly different
878- in the case of structure with a parameter, like modules.}, following the introduction of
878+ in the case of a structure with a parameter, like modules.}, following the introduction of
879879section variables \C {T} and~\C {cT}, and the definition of \C {class}:
880880
881881\begin {coq }{name=phant21}{}
@@ -912,7 +912,7 @@ \section{Parameters and constructors}\label{sec:phant}
912912The code for the instance constructor for \C {choiceType} is almost
913913identical, because it only extends \C {eqType} with a mixin that does
914914not depend on \C {eqType}.
915- Note that this definition allows \Coq {} to infer \C {T} from \C {m}.
915+ Note that this definition lets \Coq {} infer \C {T} from \C {m}.
916916
917917\begin {coq }{name=phant23}{}
918918Definition pack T m :=
@@ -981,7 +981,7 @@ \section{Linking a custom data type to the library}
981981\begin {coq }{}{}
982982Inductive windrose := N | S | E | W.
983983\end {coq }
984- The most naive way to show that \C {windrose} is a \C {finType} is
984+ The most na \" ive way to show that \C {windrose} is a \C {finType} is
985985to provide a comparison function, then a choice function, \ldots
986986finally an enumeration. Instead, it is much simpler to show one
987987can punt \C {windrose} in bijection with a pre-existing finite type,
@@ -1027,12 +1027,12 @@ \section{Linking a custom data type to the library}
10271027Definition windrose_finMixin := PcanFinMixin pcan_wo4.
10281028Canonical windrose_finType := FinType windrose windrose_finMixin.
10291029\end {coq }
1030- Only one tiny detail has been left on the side so far. To use
1030+ Only one tiny detail has been left aside so far. To use
10311031\C {windrose} in conjunction with the \C {\\ in} infix notation or with
10321032the notation \C {#|...|} for cardinality, the type declaration has to
10331033be tagged as an instance of the \C {predArgType} structure, for types
1034- which model a predicate, as it is the one which supports the latter
1035- notations. It can be done as follows. \index [coq]{\C {preArgType }}
1034+ which model a predicate, as it is the structure that supports the latter
1035+ notations. It can be done as follows. \index [coq]{\C {predArgType }}
10361036
10371037\begin {coq }{}{}
10381038Inductive windrose : predArgType := N | S | E | W.
@@ -1047,7 +1047,7 @@ \section{Linking a custom data type to the library}
10471047A generic technique is available in order to equip a data type with structures of
10481048\C {eqType}, \C {choiceType}, and \C {countType}. It consists in
10491049providing a correspondence with the generic tree data type
1050- \C {(GenTree.tree T)}: an n-ary tree with nodes labelled with
1050+ \C {(GenTree.tree T)}: an n-ary tree with nodes labeled with
10511051natural numbers and leaves carrying a value in \C {T}.
10521052\index [coq]{\C {GenTree.tree}}
10531053
0 commit comments