Skip to content

Commit

Permalink
adapt hydras text about Comparable typeclass
Browse files Browse the repository at this point in the history
  • Loading branch information
palmskog authored and Casteran committed Sep 20, 2021
1 parent 85e6515 commit b5e1999
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/part-hydras.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1701,24 +1701,25 @@ \section{Ordinal Notations}



\subsection{A class for ordinal notations}
\subsection{Classes for ordinal notations}

From the \coq{} user's point of view, an ordinal notation is
a structure allowing to compare two ordinals by computation, and proving by well-founded induction.

\subsubsection{The \texttt{Comparable class}}
\subsubsection{The \texttt{Comparison} and \texttt{Comparable} classes}

The following class, contributed by Jérémy Damour and Théo Zimmermann, allows us to apply generic lemmas and tactics
about decidable strict orders.
We use the operational class \texttt{Comparison} of comparison functions to define the \texttt{Comparable} class, contributed by Jérémy Damour and Théo Zimmermann, which allows us to apply generic lemmas and tactics about decidable strict orders.
The correctness of the comparison function is expressed through Stdlib's type
\texttt{Datatypes.CompareSpec}.

\texttt{Datatypes.CompareSpec} as specialized by \texttt{Datatypes.CompSpec}.

\begin{Coqsrc}
Inductive CompareSpec (Peq Plt Pgt : Prop) : comparison -> Prop :=
CompEq : Peq -> CompareSpec Peq Plt Pgt Eq
| CompLt : Plt -> CompareSpec Peq Plt Pgt Lt
| CompGt : Pgt -> CompareSpec Peq Plt Pgt Gt.

Definition CompSpec {A} (eq lt : A->A->Prop)(x y:A) : comparison -> Prop :=
CompareSpec (eq x y) (lt x y) (lt y x).
\end{Coqsrc}

\emph{From Module~\href{../theories/html/hydras.Prelude/mparable.html\#Hvariant}{Prelude.Comparable}}
Expand Down

0 comments on commit b5e1999

Please sign in to comment.