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
|
<!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="SET.html"><font color="#008000">SET</font></a>[<font color="#008000">E</font>];
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">comment</font></strong> := <font color="#BC8F8F">"Definition of a mathematical set of objects."</font>;
<br><font FACE="Sans-serif" color="#000000"><B> All common operations on mathematical sets are available.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Well knowned implementations are HASHED_SET and AVL_SET.</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>:<a href="TRAVERSABLE.html"><font color="#008000">TRAVERSABLE</font></a>[<font color="#008000">E</font>] :=
<br><br><strong><font color="#FF0000">    +</font></strong> <strong><font color="#0000FF">parent_safe_equal</font></strong>:<a href="SAFE_EQUAL.html"><font color="#008000">SAFE_EQUAL</font></a>[<font color="#008000">E</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">        Cardinality of the set (i.e. 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 the set empty?</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Adding and 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">add</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Add new item `e' to the set. The mathematical definition of adding </font></strong></em>
<br><em><strong><font color="#707070">        in a set is followed, i.e. the element `e' is added only and only </font></strong></em>
<br><em><strong><font color="#707070">        if it is not yet present in the set.</font></strong></em>
<br><em><strong><font color="#707070">        As this `add' feature is actually using `is_equal', you may consider </font></strong></em>
<br><em><strong><font color="#707070">        to use `fast_add' 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><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_add</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Same job as `add', but uses basic `=' for comparison.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">remove</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Remove item `e' from the set: the mathematical definition of</font></strong></em>
<br><em><strong><font color="#707070">        removing from a set is followed.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_remove</font></strong> e:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Same job as `remove', but uses basic `=' for comparison.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">clear</font></strong> <-
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">clear_count</font></strong> <-
<br><em><strong><font color="#707070">        Empty the current set (`is_empty' is True after that call). </font></strong></em>
<br><em><strong><font color="#707070">        If possible, the actual implementation is supposed to keep </font></strong></em>
<br><em><strong><font color="#707070">        its internal storage area in order to refill `Current' in </font></strong></em>
<br><em><strong><font color="#707070">        an efficient way.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `clear_count_and_capacity' to select the most appropriate.</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">        Empty the current set (`is_empty' is True after that call). </font></strong></em>
<br><em><strong><font color="#707070">        If possible, the actual implementation is supposed to release </font></strong></em>
<br><em><strong><font color="#707070">        its internal storage area for this memory to be used by other objects.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `clear_count' to select the most appropriate.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Looking and searching:</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> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' in the set?</font></strong></em>
<br><em><strong><font color="#707070">        As this query is actually using `is_equal', you may consider to use </font></strong></em>
<br><em><strong><font color="#707070">        `fast_has' for expanded objects as well while trying to get the very </font></strong></em>
<br><em><strong><font color="#707070">        best performances.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">fast_has</font></strong> e:<font color="#008000">E</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is element `e' actually stored in the set?</font></strong></em>
<br><em><strong><font color="#707070">        Warning: this query is 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' when dealing with reference types.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">reference_at</font></strong> e:<font color="#008000">E</font> :<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        Non Void when `e' is in the set. In such a situation, `Result' is the </font></strong></em>
<br><em><strong><font color="#707070">        object which is actually stored in the `Current' set (see ensure assertion).</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">E</font> <-
<br><em><strong><font color="#707070">        Item at the corresponding index `i'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `lower', `upper', `valid_index'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        SETs are intrinsically unordered, so there is no guarantee that </font></strong></em>
<br><em><strong><font color="#707070">        `item'(i) after performing an `add' or `remove' operation is related </font></strong></em>
<br><em><strong><font color="#707070">        in any way to `item'(i) before that operation.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">first</font></strong>:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        The very `first' item.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `last', `item'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        SETs are intrinsically unordered, so there is no guarantee that </font></strong></em>
<br><em><strong><font color="#707070">        `first' after performing an `add' or `remove' operation is related </font></strong></em>
<br><em><strong><font color="#707070">        in any way to `first' before that operation.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">last</font></strong>:<font color="#008000">E</font> <-
<br><em><strong><font color="#707070">        The `last' item.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `first', `item'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        SETs are intrinsically unordered, so there is no guarantee that </font></strong></em>
<br><em><strong><font color="#707070">        `last' after performing an `add' or `remove' operation is related </font></strong></em>
<br><em><strong><font color="#707070">        in any way to `last' before that operation.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Mathematical operations:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">union</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Make the union of the `Current' set with `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> '<font color="#B8860B">+</font>' other:<font color="#008000">SELF</font> :<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Return the union of the `Current' set with `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">intersection</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Make the intersection of the `Current' set with `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> '<font color="#B8860B">^</font>' other:<font color="#008000">SELF</font> :<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Return the intersection of the `Current' set with `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">minus</font></strong> other:<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Make the set `Current' - `other'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> '<font color="#B8860B">-</font>' other:<font color="#008000">SELF</font> :<font color="#008000">SELF</font> <-
<br><em><strong><font color="#707070">        Return the set `Current' - `other'.</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Comparison:</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">is_subset_of</font></strong> other:<font color="#008000">SELF</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is the `Current' set a subset of `other'?</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">is_disjoint_from</font></strong> other:<font color="#008000">SELF</font> :<a href="BOOLEAN.html"><font color="#008000">BOOLEAN</font></a> <-
<br><em><strong><font color="#707070">        Is the `Current' set disjoint from `other' ?</font></strong></em>
<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">        Is the `Current' set equal to `other'?</font></strong></em>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<br><font FACE="Sans-serif" color="#000000"><B> Duplication.</B></font>
<br><font FACE="Sans-serif" color="#000000"><B></B></font>
<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">        Copy 'other' into the current set</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">from_collection</font></strong> model:<a href="COLLECTION.html"><font color="#008000">COLLECTION</font></a>[<font color="#008000">E</font>] <-
<br><em><strong><font color="#707070">        Add all items of `model'.</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 item of `Self'.</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `for_all', `exists'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">for_all</font></strong> predicate:<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 items satisfy `predicate'?</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `do_all', `exists'.</font></strong></em>
<br><br><strong><font color="#FF0000">    -</font></strong> <strong><font color="#0000FF">exists</font></strong> predicate:<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 item satisfy `predicate'?</font></strong></em>
<br><em><strong><font color="#707070">        </font></strong></em>
<br><em><strong><font color="#707070">        See also `do_all', `for_all'.</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">        Creation of an empty SET.</font></strong></em>
</body>
</html>
|