Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 45 kB image not shown  

Quelle  FMap.vdmpp

  Sprache: VDM
 

\subsection{FHashtable}
写像に関わる関数を定義する。

\begin{vdm_al}
--"$Id"
class FMap

functions
\end{vdm_al}

Getは、写像にaKeyがあれば、対応する値域の値を返し、無ければnilを返す。
\begin{vdm_al}
static public Get[@T1, @T2] : map @T1 to @T2 -> @T1 -> [@T2]
Get(aMap)(aKey) ==
 if aKey in set dom aMap then
  aMap(aKey)
 else
  nil;
\end{vdm_al}

Containsは、aValueが写像aMapの値域に含まれているか否かを返す。
\begin{vdm_al}
static public Contains[@T1, @T2] : map @T1 to @T2 -> @T2 -> bool
Contains(aMap)(aValue) == aValue in set rng aMap;
\end{vdm_al}

ContainsKeyは、aKeyが写像aMapの定義域に含まれているか否かを返す。
\begin{vdm_al}
static public ContainsKey[@T1, @T2] : map @T1 to @T2 -> @T1 -> bool
ContainsKey(aMap)(aKey) == aKey in set dom aMap;
 
end FMap
\end{vdm_al}

\begin{rtinfo}
[FMap]{vdm.tc}[FMap]
\end{rtinfo}

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-06) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.