Automatic generation produced by ISE Eiffel
class SEQ [G -> attached ANY] General cluster: mathmodels description: "(1) Model contracts for finite sequences for elements of type G. (2) Queries are side effect free and return sequences via deep_twin; thus inefficient (use only for contracts). (3) Commands change the current sequence. (4) A valid index is 1..count. (5) Array notation can be used, as well as iteration (across). (6) Empty sequences can be created, or creation can be from an array. (7) Sequences have a first item (the head), a tail and last item. (8) Infix notation for prepended_by(x:G): seq1 |< x (9) Infix notation for appended_by(x:G): seq1 |> x (10) For concatenation may use infix: seq1 |++| seq2 (11) For queries, to assert that the state is not changed, the postcondition is Current ~ old Current.deep_twin" create: make_empty, make_from_array Ancestors DEBUG_OUTPUT* ITERABLE* [G] Queries appended alias "|->" (v: G): [like Current] attached SEQ [G] as_array: ARRAY [G] as_function: FUN [INTEGER_32, G] comprehension alias "|" (exp: PREDICATE [PAIR [INTEGER_32, G]]): [like Current] attached SEQ [G] concatenated alias "|++|" (other: [like Current] attached SEQ [G]): [like Current] attached SEQ [G] count alias "#": INTEGER_32 debug_output: STRING_8 first: G front: [like Current] attached SEQ [G] has (v: G): BOOLEAN hold_count (exp: PREDICATE [PAIR [INTEGER_32, G]]): INTEGER_32 inserted (v: G; i: INTEGER_32): [like Current] attached SEQ [G] is_contiguous_subseq_of (other: [like Current] attached SEQ [G]): BOOLEAN is_empty: BOOLEAN is_equal (other: [like Current] attached SEQ [G]): BOOLEAN is_subsequence_of alias "|<:" (other: [like Current] attached SEQ [G]): BOOLEAN item alias "[]" (i: INTEGER_32): G last: G lower: INTEGER_32 new_cursor: ITERATION_CURSOR [G] out: STRING_8 overriden (v: G; i: INTEGER_32): [like Current] attached SEQ [G] prepended alias "|<-" (v: G): [like Current] attached SEQ [G] removed (i: INTEGER_32): [like Current] attached SEQ [G] reversed: [like Current] attached SEQ [G] slice (a_start, a_end, a_step: INTEGER_32): [like Current] attached SEQ [G] subsequenced (i, j: INTEGER_32): [like Current] attached SEQ [G] tail: [like Current] attached SEQ [G] twin2: [like Current] attached SEQ [G] upper: INTEGER_32 valid_position (pos: INTEGER_32): BOOLEAN Commands append (v: G) concatenate (other: [like Current] attached SEQ [G]) insert (v: G; i: INTEGER_32) make_empty make_from_array (a: ARRAY [G]) override (v: G; i: INTEGER_32) prepend (v: G) remove (i: INTEGER_32) reverse subsequence (i, j: INTEGER_32) Constraints value semantics value semantics value semantics value semantics properties -- Generated by ISE Eiffel --
For more details: www.eiffel.com