1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
|
<!DOCTYPE HTML SYSTEM>
<!-- Generated by Lisaac shorter / html style -->
<html>
<head>
<title>
Lisaac prototype interface
</title>
</head>
<body BGCOLOR="#FFFFFF">
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Header</font></strong>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">name</font></strong> := <a href="DICTIONARY.html"><font color="#008000">DICTIONARY</font></a>[<font color="#008000">V</font>, <font color="#008000">K</font>];
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">comment</font></strong> := <font color="#BC8F8F">"Associative memory. Values of type `V' are stored using Keys of type `K'."</font>;
<br><font FACE="Sans-serif" color="#000000"><B> To make a comparison with the well knowned ARRAY class, with a DICTIONARY, </B></font>
<br><font FACE="Sans-serif" color="#000000"><B> index used are not only INTEGER, you can use for example a STRING to access </B></font>
<br><font FACE="Sans-serif" color="#000000"><B> to your information.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Well knowned implementations, see HASHED_DICTIONARY and AVL_DICTIONARY.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> See also BIJECTIVE_DICTIONARY class.</B></font>
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Inherit</font></strong>
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">parent_traversable</font></strong>:<strong><font color="#A020F0">Expanded</font></strong> <a href="TRAVERSABLE.html"><font color="#008000">TRAVERSABLE</font></a>[<font color="#008000">V</font>];
<br><br><strong><font color="#A020F0">Section</font></strong> <strong><font color="#A020F0">Public</font></strong>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Counting:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">count</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><em><strong><font color="#707070">        Actual `count' of stored elements.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">is_empty</font></strong>:<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is it empty?</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Basic access:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">has</font></strong> k:<font color="#008000">K</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is there a value currently associated with key `k'?</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_has', `at'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">at</font></strong> k:<font color="#008000">K</font> :<font color="#008000">V</font> <-
<br><em><strong><font color="#707070">        Return the value associated to key `k'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_at', `reference_at', `has'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">reference_at</font></strong> k:<font color="#008000">K</font> :<font color="#008000">V</font> <-
<br><em><strong><font color="#707070">        Return NULL or the value associated with key `k'. Actually, this</font></strong></em>
<br><em><strong><font color="#707070">        feature is useful when the type of values (the type V) is a</font></strong></em>
<br><em><strong><font color="#707070">        reference type, to avoid using `has' just followed by `at' to get</font></strong></em>
<br><em><strong><font color="#707070">        the corresponding value.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_reference_at', `at', `has'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_has</font></strong> k:<font color="#008000">K</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is there a value currently associated with key `k'?</font></strong></em>
<br><em><strong><font color="#707070">        Using basic `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `has', `at', `fast_at'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_at</font></strong> k:<font color="#008000">K</font> :<font color="#008000">V</font> <-
<br><em><strong><font color="#707070">        Return the value associated to key `k' using basic `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `at', `reference_at', `fast_reference_at'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_reference_at</font></strong> k:<font color="#008000">K</font> :<font color="#008000">V</font> <-
<br><em><strong><font color="#707070">        Same work as `reference_at', but basic `=' is used for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `reference_at', `at', `has'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Modification.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">put</font></strong> v:<font color="#008000">V</font> <strong><font color="#0000FF">to</font></strong> k:<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Change some existing entry or `add' the new one. If there is as yet </font></strong></em>
<br><em><strong><font color="#707070">        no key `k' in the dictionary, enter it with item `v'. Otherwise </font></strong></em>
<br><em><strong><font color="#707070">        overwrite the item associated with key `k'.</font></strong></em>
<br><em><strong><font color="#707070">        As the `put' procedure actually uses `is_equal', you may consider </font></strong></em>
<br><em><strong><font color="#707070">        to use `fast_put' for expanded objects as well while trying to get</font></strong></em>
<br><em><strong><font color="#707070">        the very best performances.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_put', `add'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_put</font></strong> v:<font color="#008000">V</font> <strong><font color="#0000FF">to</font></strong> k:<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Same job as `put', but uses basic `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `put', `add'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">add</font></strong> v:<font color="#008000">V</font> <strong><font color="#0000FF">to</font></strong> k:<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        To add a new entry `k' with its associated value `v'.</font></strong></em>
<br><em><strong><font color="#707070">        Actually, this is equivalent to call `put', but it may run a little bit faster.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `put', `fast_put'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Looking and searching some value:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">occurrences</font></strong> v:<font color="#008000">V</font> :<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><em><strong><font color="#707070">        Number of occurrences using `is_equal' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_occurrences', `fast_has', `has'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_occurrences</font></strong> v:<font color="#008000">V</font> :<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><em><strong><font color="#707070">        Number of occurrences using basic `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `occurrences', `fast_has', `has'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">key_at</font></strong> v:<font color="#008000">V</font> :<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Retrieve the key used for value `v' using `is_equal' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_key_at', `at'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_key_at</font></strong> v:<font color="#008000">V</font> :<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Retrieve the key used for value `v' using `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `key_at', `at'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Removing:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">remove</font></strong> k:<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Remove entry `k' (which may exist or not before this call).</font></strong></em>
<br><em><strong><font color="#707070">        As the `remove' procedure actually uses `is_equal', you may </font></strong></em>
<br><em><strong><font color="#707070">        consider to use `fast_remove' for expanded objects as well </font></strong></em>
<br><em><strong><font color="#707070">        while trying to get the very best performances.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `fast_remove', `clear_count'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_remove</font></strong> k:<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Same job as `remove', but uses basic `=' for comparison.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `remove', `clear_count'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">clear_count</font></strong> <-
<br><em><strong><font color="#707070">        Discard all items (`is_empty' is True after that call). </font></strong></em>
<br><em><strong><font color="#707070">        The internal `capacity' is not changed by this call.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `clear_count_and_capacity', `remove'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">clear_count_and_capacity</font></strong> <-
<br><em><strong><font color="#707070">        Discard all items (`is_empty' is True after that call). </font></strong></em>
<br><em><strong><font color="#707070">        The internal `capacity' may also be reduced after this call.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `clear_count', `remove'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">capacity</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><em><strong><font color="#707070">        Approximation of the actual internal storage `capacity'. </font></strong></em>
<br><em><strong><font color="#707070">        The `capacity' will grow automatically when needed </font></strong></em>
<br><em><strong><font color="#707070">        (i.e. `capacity' is not a limit for the number of values stored). </font></strong></em>
<br><em><strong><font color="#707070">        Also note that the `capacity' value may not be always accurate </font></strong></em>
<br><em><strong><font color="#707070">        depending of the implementation (anyway, this `capacity' value </font></strong></em>
<br><em><strong><font color="#707070">        is at least equals to `count').</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> To provide iterating facilities:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">lower</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :=
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">upper</font></strong>:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">item</font></strong> i:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :<font color="#008000">V</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">first</font></strong>:<font color="#008000">V</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">last</font></strong>:<font color="#008000">V</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">key</font></strong> index:<a href="INTEGER.html"><font color="#008000">INTEGER</font></a> :<font color="#008000">K</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">key_map_in</font></strong> buffer:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">K</font>] <-
<br><em><strong><font color="#707070">        Append in `buffer', all available keys (this may be useful to</font></strong></em>
<br><em><strong><font color="#707070">        speed up the traversal).</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `item_map_in'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">item_map_in</font></strong> buffer:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">V</font>] <-
<br><em><strong><font color="#707070">        Append in `buffer', all available items (this may be useful to</font></strong></em>
<br><em><strong><font color="#707070">        speed up the traversal).</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `key_map_in'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Comparaison.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> '<font color="#B8860B">==</font>' other:<font color="#008000">SELF</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Do both dictionaries have the same set of associations?</font></strong></em>
<br><em><strong><font color="#707070">        Keys are compared with `is_equal' and values are comnpared</font></strong></em>
<br><em><strong><font color="#707070">        with the basic = operator.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `is_equal_map'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">is_equal_map</font></strong> other:<font color="#008000">SELF</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Do both dictionaries have the same set of associations?</font></strong></em>
<br><em><strong><font color="#707070">        Both keys and values are compared with `is_equal'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `is_equal'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">copy</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Reinitialize by copying all associations of `other'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Agents based features:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">do_all</font></strong> action:<a href="BLOCK.html"><font color="#008000">BLOCK</font></a> <-
<br><em><strong><font color="#707070">        Apply `action' to every [V, K] associations of `Current'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `for_all', `exist'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">for_all</font></strong> test:<a href="BLOCK.html"><font color="#008000">BLOCK</font></a> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Do all [V, K] associations satisfy `test'?</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `do_all', `exist'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">exists</font></strong> test:<a href="BLOCK.html"><font color="#008000">BLOCK</font></a> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Does at least one [V, K] association satisfy `test'?</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `for_all', `do_all'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Other features:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">internal_key</font></strong> k:<font color="#008000">K</font> :<font color="#008000">K</font> <-
<br><em><strong><font color="#707070">        Retrieve the internal key object which correspond to the existing</font></strong></em>
<br><em><strong><font color="#707070">        entry `k' (the one memorized into the `Current' dictionary).</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `has', `fast_has'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Creation.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">create</font></strong>:<font color="#008000">SELF</font> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">make</font></strong> <-
<br><em><strong><font color="#707070">        Creates an empty dictionary.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">key_safe_equal</font></strong> k1:<font color="#008000">K</font> <strong><font color="#0000FF">with</font></strong> k2:<font color="#008000">K</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Because keys are never NULL, we do not rely on the SAFE_EQUAL class.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> invariant</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> [ -? {capacity >= count}; ]</B></font>
</body>
</html>
|