From f36103f0e8e601e62d5bab20d84190dfc65e9666 Mon Sep 17 00:00:00 2001 From: Mysaa Date: Fri, 12 Aug 2022 15:48:02 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20explication=20pour=20l'exemple?= =?UTF-8?q?=20des=20test=20interfaces=20inimpl=C3=A9mentables.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RapportStage.tex | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/RapportStage.tex b/RapportStage.tex index 661914b..c2a4a95 100644 --- a/RapportStage.tex +++ b/RapportStage.tex @@ -340,7 +340,12 @@ \end{fjlisting} \end{tabular} \end{center} - %TODO Ajouter une courte explication de pourquoi + \underline{La première} parce que la relation de sous-typage et transitive est antisymétrique + + \underline{La seconde} parce que si \fj{B} a un attribut de type \fj{A}, alors \fj{C} en hérite, et ne peut pas être construit sans attributs. + + \underline{La troisième} comme la précédente, \fj{C} doit avoir par héritange un attribut nommé \fj{f} + \caption{Exemples de \textit{test interfaces} implémentés par aucune \textit{class table}} \label{fig:tiUnsolvable} \end{figure} @@ -707,10 +712,14 @@ \begin{fjlisting} \fjclass{Int}{}{ \fjmethod{Bool}{isZero}{}{true} + \fjmethod{Bool}{gt}{Int other}{false} + \fjmethod{Bool}{lt}{Int other}{other.isZero().ite(false,true)} }\\ \fjclass{SInt}{\fjattr[Int]{prec}}{ \fjmethod{Bool}{isZero}{}{false} - } + \fjmethod{Bool}{gt}{Int other}{other.isZero().ite(true,this.prec.gt(((SInt)other).prec))} + \fjmethod{Bool}{lt}{Int other}{other.isZero().ite(false,this.prec.lt(((SInt)other).prec))} + } \end{fjlisting} On ajoute aussi la notation des nombres :