indexing
	description: "Partially deterministic finite state automata"
	legal: "See notice at end of class."
	comment: "See comment at end of class"
	status: "See notice at end of class."
	date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
	revision: "$Revision: 56675 $"

class interface
	PDFA

create 
	make (n, i: INTEGER_32)
			-- Make a PDFA with `n' states, and `i' + 1 inputs.

feature -- Initialization

	make (n, i: INTEGER_32)
			-- Make a PDFA with `n' states, and `i' + 1 inputs.

	array_make (min_index, max_index: INTEGER_32)
			-- Allocate array; set index interval to
			-- `min_index' .. `max_index'; set all values to default.
			-- (Make array empty if `min_index' = `max_index' + 1).
			-- (from ARRAY)
		require -- from ARRAY
			valid_bounds: min_index <= max_index + 1
		ensure -- from ARRAY
			lower_set: lower = min_index
			upper_set: upper = max_index
			items_set: all_default

	make_from_array (a: ARRAY [LINKED_LIST [INTEGER_32]])
			-- Initialize from the items of `a'.
			-- (Useful in proper descendants of class `ARRAY',
			-- to initialize an array-like object from a manifest array.)
			-- (from ARRAY)
		require -- from ARRAY
			array_exists: a /= Void

	make_from_cil (na: NATIVE_ARRAY [like item])
			-- Initialize array from `na'.
			-- (from ARRAY)
		require -- from ARRAY
			is_dotnet: {PLATFORM}.is_dotnet
			na_not_void: na /= Void
	
feature -- Access

	ack: INTEGER_32 is 6
			-- (from ASCII)

	ampersand: INTEGER_32 is 38
			-- (from ASCII)

	area: SPECIAL [LINKED_LIST [INTEGER_32]]
			-- Special data zone
			-- (from TO_SPECIAL)

	back_space: INTEGER_32 is 8
			-- (from ASCII)

	backslash: INTEGER_32 is 92
			-- (from ASCII)

	bar: INTEGER_32 is 124
			-- (from ASCII)

	bel: INTEGER_32 is 7
			-- (from ASCII)

	blank: INTEGER_32 is 32
			-- (from ASCII)

	break: INTEGER_32 is -7
			-- (from ASCII)

	bs: INTEGER_32 is 8
			-- (from ASCII)

	buf_overflow: INTEGER_32 is -9
			-- (from ASCII)

	can: INTEGER_32 is 24
			-- (from ASCII)

	carriage_return: INTEGER_32 is 13
			-- (from ASCII)

	case_diff: INTEGER_32 is 32
			-- Lower_a - Upper_a
			-- (from ASCII)

	character_set_size: INTEGER_32 is 128
			-- (from ASCII)

	circumflex: INTEGER_32 is 94
			-- (from ASCII)

	closing_brace: INTEGER_32 is 125
			-- (from ASCII)

	colon: INTEGER_32 is 58
			-- (from ASCII)

	comma: INTEGER_32 is 44
			-- (from ASCII)

	commercial_at: INTEGER_32 is 64
			-- (from ASCII)

	cr: INTEGER_32 is 13
			-- (from ASCII)

	ctrl_a: INTEGER_32 is 1
			-- (from ASCII)

	ctrl_b: INTEGER_32 is 2
			-- (from ASCII)

	ctrl_backslash: INTEGER_32 is 28
			-- (from ASCII)

	ctrl_c: INTEGER_32 is 3
			-- (from ASCII)

	ctrl_circumflex: INTEGER_32 is 30
			-- (from ASCII)

	ctrl_d: INTEGER_32 is 4
			-- (from ASCII)

	ctrl_e: INTEGER_32 is 5
			-- (from ASCII)

	ctrl_f: INTEGER_32 is 6
			-- (from ASCII)

	ctrl_g: INTEGER_32 is 7
			-- (from ASCII)

	ctrl_h: INTEGER_32 is 8
			-- (from ASCII)

	ctrl_i: INTEGER_32 is 9
			-- (from ASCII)

	ctrl_j: INTEGER_32 is 10
			-- (from ASCII)

	ctrl_k: INTEGER_32 is 11
			-- (from ASCII)

	ctrl_l: INTEGER_32 is 12
			-- (from ASCII)

	ctrl_lbracket: INTEGER_32 is 27
			-- (from ASCII)

	ctrl_m: INTEGER_32 is 13
			-- (from ASCII)

	ctrl_n: INTEGER_32 is 14
			-- (from ASCII)

	ctrl_o: INTEGER_32 is 15
			-- (from ASCII)

	ctrl_p: INTEGER_32 is 16
			-- (from ASCII)

	ctrl_q: INTEGER_32 is 17
			-- (from ASCII)

	ctrl_questmark: INTEGER_32 is 127
			-- (from ASCII)

	ctrl_r: INTEGER_32 is 18
			-- (from ASCII)

	ctrl_rbracket: INTEGER_32 is 29
			-- (from ASCII)

	ctrl_s: INTEGER_32 is 19
			-- (from ASCII)

	ctrl_t: INTEGER_32 is 20
			-- (from ASCII)

	ctrl_u: INTEGER_32 is 21
			-- (from ASCII)

	ctrl_underlined: INTEGER_32 is 31
			-- (from ASCII)

	ctrl_v: INTEGER_32 is 22
			-- (from ASCII)

	ctrl_w: INTEGER_32 is 23
			-- (from ASCII)

	ctrl_x: INTEGER_32 is 24
			-- (from ASCII)

	ctrl_y: INTEGER_32 is 25
			-- (from ASCII)

	ctrl_z: INTEGER_32 is 26
			-- (from ASCII)

	dc1: INTEGER_32 is 17
			-- (from ASCII)

	dc2: INTEGER_32 is 18
			-- (from ASCII)

	dc3: INTEGER_32 is 19
			-- (from ASCII)

	dc4: INTEGER_32 is 20
			-- (from ASCII)

	del: INTEGER_32 is 127
			-- (from ASCII)

	dfa: FIXED_DFA
			-- DFA built by routine construct_dfa,
			-- which recognizes the same language.
			-- (from NDFA)

	dle: INTEGER_32 is 16
			-- (from ASCII)

	dollar: INTEGER_32 is 36
			-- (from ASCII)

	dot: INTEGER_32 is 46
			-- (from ASCII)

	doublequote: INTEGER_32 is 34
			-- (from ASCII)

	down_arrow: INTEGER_32 is -3
			-- (from ASCII)

	eight: INTEGER_32 is 56
			-- (from ASCII)

	em: INTEGER_32 is 25
			-- (from ASCII)

	enq: INTEGER_32 is 5
			-- (from ASCII)

	entry (i: INTEGER_32): LINKED_LIST [INTEGER_32]
			-- Entry at index `i', if in index interval
			-- (from ARRAY)
		require -- from ARRAY
			valid_key: valid_index (i)

	eot: INTEGER_32 is 4
			-- (from ASCII)

	equal_sign: INTEGER_32 is 61
			-- (from ASCII)

	esc: INTEGER_32 is 27
			-- (from ASCII)

	etb: INTEGER_32 is 23
			-- (from ASCII)

	etx: INTEGER_32 is 3
			-- (from ASCII)

	exclamation: INTEGER_32 is 33
			-- (from ASCII)

	final_array: ARRAY [INTEGER_32]
			-- The `final' value for each state
			-- (regular expression, if any, for which it is final).

	first_printable: INTEGER_32 is 32
			-- (from ASCII)

	five: INTEGER_32 is 53
			-- (from ASCII)

	four: INTEGER_32 is 52
			-- (from ASCII)

	fs: INTEGER_32 is 28
			-- (from ASCII)

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)

	grave_accent: INTEGER_32 is 96
			-- (from ASCII)

	greaterthan: INTEGER_32 is 62
			-- (from ASCII)

	greatest_input: INTEGER_32
			-- Greatest input used for the transitions from state
			-- to state (the smallest one is zero)
			-- (from AUTOMATON)

	gs: INTEGER_32 is 29
			-- (from ASCII)

	has (v: LINKED_LIST [INTEGER_32]): BOOLEAN
			-- Does `v' appear in array?
			-- (Reference or object equality,
			-- based on object_comparison.)
			-- (from ARRAY)
		ensure -- from CONTAINER
			not_found_in_empty: Result implies not is_empty

	has_letters: BOOLEAN
			-- Are there any letters among the active transitions?

	home_arrow: INTEGER_32 is -6
			-- (from ASCII)

	ht: INTEGER_32 is 9
			-- (from ASCII)

	input_array: ARRAY [FIXED_INTEGER_SET]
			-- For each input, set of the states which have
			-- a transition on this input to the following state

	item alias "[]" (i: INTEGER_32): LINKED_LIST [INTEGER_32] assign put
			-- Entry at index `i', if in index interval
			-- Was declared in ARRAY as synonym of infix "@".
			-- (from ARRAY)
		require -- from TABLE
			valid_key: valid_index (i)
		require -- from TO_SPECIAL
			valid_index: valid_index (i)

	keywords_list: LINKED_LIST [STRING_8]
			-- Keywords associated with current automaton.

	last_ascii: INTEGER_32 is 127
			-- (from ASCII)

	last_printable: INTEGER_32 is 126
			-- (from ASCII)

	lbracket: INTEGER_32 is 91
			-- (from ASCII)

	lcurly: INTEGER_32 is 40
			-- (from ASCII)

	left_arrow: INTEGER_32 is -4
			-- (from ASCII)

	lessthan: INTEGER_32 is 60
			-- (from ASCII)

	letter_layout: INTEGER_32 is 70
			-- (from ASCII)

	line_feed: INTEGER_32 is 10
			-- (from ASCII)

	lower_a: INTEGER_32 is 97
			-- (from ASCII)

	lower_b: INTEGER_32 is 98
			-- (from ASCII)

	lower_c: INTEGER_32 is 99
			-- (from ASCII)

	lower_d: INTEGER_32 is 100
			-- (from ASCII)

	lower_e: INTEGER_32 is 101
			-- (from ASCII)

	lower_f: INTEGER_32 is 102
			-- (from ASCII)

	lower_g: INTEGER_32 is 103
			-- (from ASCII)

	lower_h: INTEGER_32 is 104
			-- (from ASCII)

	lower_i: INTEGER_32 is 105
			-- (from ASCII)

	lower_j: INTEGER_32 is 106
			-- (from ASCII)

	lower_k: INTEGER_32 is 107
			-- (from ASCII)

	lower_l: INTEGER_32 is 108
			-- (from ASCII)

	lower_m: INTEGER_32 is 109
			-- (from ASCII)

	lower_n: INTEGER_32 is 110
			-- (from ASCII)

	lower_o: INTEGER_32 is 111
			-- (from ASCII)

	lower_p: INTEGER_32 is 112
			-- (from ASCII)

	lower_q: INTEGER_32 is 113
			-- (from ASCII)

	lower_r: INTEGER_32 is 114
			-- (from ASCII)

	lower_s: INTEGER_32 is 115
			-- (from ASCII)

	lower_t: INTEGER_32 is 116
			-- (from ASCII)

	lower_u: INTEGER_32 is 117
			-- (from ASCII)

	lower_v: INTEGER_32 is 118
			-- (from ASCII)

	lower_w: INTEGER_32 is 119
			-- (from ASCII)

	lower_x: INTEGER_32 is 120
			-- (from ASCII)

	lower_y: INTEGER_32 is 121
			-- (from ASCII)

	lower_z: INTEGER_32 is 122
			-- (from ASCII)

	minus: INTEGER_32 is 45
			-- (from ASCII)

	nak: INTEGER_32 is 21
			-- (from ASCII)

	nine: INTEGER_32 is 57
			-- (from ASCII)

	nl: INTEGER_32 is 10
			-- (from ASCII)

	np: INTEGER_32 is 12
			-- (from ASCII)

	nul: INTEGER_32 is 0
			-- (from ASCII)

	number_sign: INTEGER_32 is 35
			-- (from ASCII)

	one: INTEGER_32 is 49
			-- (from ASCII)

	opening_brace: INTEGER_32 is 123
			-- (from ASCII)

	overflow: INTEGER_32 is -8
			-- (from ASCII)

	percent: INTEGER_32 is 37
			-- (from ASCII)

	plus: INTEGER_32 is 43
			-- (from ASCII)

	questmark: INTEGER_32 is 63
			-- (from ASCII)

	rbracket: INTEGER_32 is 93
			-- (from ASCII)

	rcurly: INTEGER_32 is 41
			-- (from ASCII)

	right_arrow: INTEGER_32 is -5
			-- (from ASCII)

	rs: INTEGER_32 is 30
			-- (from ASCII)

	semicolon: INTEGER_32 is 59
			-- (from ASCII)

	seven: INTEGER_32 is 55
			-- (from ASCII)

	si: INTEGER_32 is 15
			-- (from ASCII)

	singlequote: INTEGER_32 is 39
			-- (from ASCII)

	six: INTEGER_32 is 54
			-- (from ASCII)

	slash: INTEGER_32 is 47
			-- (from ASCII)

	so: INTEGER_32 is 14
			-- (from ASCII)

	soh: INTEGER_32 is 1
			-- (from ASCII)

	sp: INTEGER_32 is 32
			-- (from ASCII)

	star: INTEGER_32 is 42
			-- (from ASCII)

	start_number: INTEGER_32
			-- Unique start state used for the beginning of
			-- the automaton's operation
			-- (from AUTOMATON)

	stx: INTEGER_32 is 2
			-- (from ASCII)

	sub: INTEGER_32 is 26
			-- (from ASCII)

	syn: INTEGER_32 is 22
			-- (from ASCII)

	tabulation: INTEGER_32 is 9
			-- (from ASCII)

	three: INTEGER_32 is 51
			-- (from ASCII)

	tilde: INTEGER_32 is 126
			-- (from ASCII)

	two: INTEGER_32 is 50
			-- (from ASCII)

	underlined: INTEGER_32 is 95
			-- (from ASCII)

	up_arrow: INTEGER_32 is -2
			-- (from ASCII)

	upper_a: INTEGER_32 is 65
			-- (from ASCII)

	upper_b: INTEGER_32 is 66
			-- (from ASCII)

	upper_c: INTEGER_32 is 67
			-- (from ASCII)

	upper_d: INTEGER_32 is 68
			-- (from ASCII)

	upper_e: INTEGER_32 is 69
			-- (from ASCII)

	upper_f: INTEGER_32 is 70
			-- (from ASCII)

	upper_g: INTEGER_32 is 71
			-- (from ASCII)

	upper_h: INTEGER_32 is 72
			-- (from ASCII)

	upper_i: INTEGER_32 is 73
			-- (from ASCII)

	upper_j: INTEGER_32 is 74
			-- (from ASCII)

	upper_k: INTEGER_32 is 75
			-- (from ASCII)

	upper_l: INTEGER_32 is 76
			-- (from ASCII)

	upper_m: INTEGER_32 is 77
			-- (from ASCII)

	upper_n: INTEGER_32 is 78
			-- (from ASCII)

	upper_o: INTEGER_32 is 79
			-- (from ASCII)

	upper_p: INTEGER_32 is 80
			-- (from ASCII)

	upper_q: INTEGER_32 is 81
			-- (from ASCII)

	upper_r: INTEGER_32 is 82
			-- (from ASCII)

	upper_s: INTEGER_32 is 83
			-- (from ASCII)

	upper_t: INTEGER_32 is 84
			-- (from ASCII)

	upper_u: INTEGER_32 is 85
			-- (from ASCII)

	upper_v: INTEGER_32 is 86
			-- (from ASCII)

	upper_w: INTEGER_32 is 87
			-- (from ASCII)

	upper_x: INTEGER_32 is 88
			-- (from ASCII)

	upper_y: INTEGER_32 is 89
			-- (from ASCII)

	upper_z: INTEGER_32 is 90
			-- (from ASCII)

	us: INTEGER_32 is 31
			-- (from ASCII)

	vt: INTEGER_32 is 11
			-- (from ASCII)

	zero: INTEGER_32 is 48
			-- (from ASCII)

	infix "@" (i: INTEGER_32): LINKED_LIST [INTEGER_32] assign put
			-- Entry at index `i', if in index interval
			-- Was declared in ARRAY as synonym of item.
			-- (from ARRAY)
		require -- from TABLE
			valid_key: valid_index (i)
		require -- from TO_SPECIAL
			valid_index: valid_index (i)
	
feature -- Measurement

	additional_space: INTEGER_32
			-- Proposed number of additional items
			-- (from RESIZABLE)
		ensure -- from RESIZABLE
			at_least_one: Result >= 1

	capacity: INTEGER_32
			-- Number of available indices
			-- Was declared in ARRAY as synonym of count.
			-- (from ARRAY)
		require -- from  BOUNDED
			True
		ensure then -- from ARRAY
			consistent_with_bounds: Result = upper - lower + 1

	count: INTEGER_32
			-- Number of available indices
			-- Was declared in ARRAY as synonym of capacity.
			-- (from ARRAY)
		require -- from  FINITE
			True
		ensure then -- from ARRAY
			consistent_with_bounds: Result = upper - lower + 1

	growth_percentage: INTEGER_32 is 50
			-- Percentage by which structure will grow automatically
			-- (from RESIZABLE)

	index_set: INTEGER_INTERVAL
			-- Range of acceptable indexes
			-- (from ARRAY)
		require -- from  INDEXABLE
			True
		ensure -- from INDEXABLE
			not_void: Result /= Void
		ensure then -- from ARRAY
			same_count: Result.count = count
			same_bounds: ((Result.lower = lower) and (Result.upper = upper))

	lower: INTEGER_32
			-- Minimum index
			-- (from ARRAY)

	minimal_increase: INTEGER_32 is 5
			-- Minimal number of additional items
			-- (from RESIZABLE)

	nb_states: INTEGER_32
			-- Number of states in the automaton
			-- (from AUTOMATON)

	occurrences (v: LINKED_LIST [INTEGER_32]): INTEGER_32
			-- Number of times `v' appears in structure
			-- (from ARRAY)
		ensure -- from BAG
			non_negative_occurrences: Result >= 0

	upper: INTEGER_32
			-- Maximum index
			-- (from ARRAY)
	
feature -- Comparison

	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from ANY
			shallow_implies_deep: standard_equal (some, other) implies Result
			both_or_none_void: (some = Void) implies (Result = (other = Void))
			same_type: (Result and (some /= Void)) implies some.same_type (other)
			symmetric: Result implies deep_equal (other, some)

	frozen equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

	is_equal (other: like Current): BOOLEAN
			-- Is array made of the same items as `other'?
			-- (from ARRAY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result

	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

	frozen standard_is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	all_default: BOOLEAN
			-- Are all items set to default values?
			-- (from ARRAY)
		ensure -- from ARRAY
			definition: Result = (count = 0 or else ((item (upper) = Void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

	changeable_comparison_criterion: BOOLEAN
			-- May object_comparison be changed?
			-- (Answer: yes by default.)
			-- (from CONTAINER)

	conforms_to (other: ANY): BOOLEAN
			-- Does type of current object conform to type
			-- of `other' (as per Eiffel: The Language, chapter 13)?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void

	extendible: BOOLEAN
			-- May items be added?
			-- (Answer: no, although array may be resized.)
			-- (from ARRAY)

	full: BOOLEAN
			-- Is structure filled to capacity? (Answer: yes)
			-- (from ARRAY)
		require -- from  BOX
			True

	is_empty: BOOLEAN
			-- Is structure empty?
			-- (from FINITE)
		require -- from  CONTAINER
			True

	is_inserted (v: LINKED_LIST [INTEGER_32]): BOOLEAN
			-- Has `v' been inserted by the most recent insertion?
			-- (By default, the value returned is equivalent to calling 
			-- `has (v)'. However, descendants might be able to provide more
			-- efficient implementations.)
			-- (from COLLECTION)

	object_comparison: BOOLEAN
			-- Must search operations use equal rather than `='
			-- for comparing references? (Default: no, use `='.)
			-- (from CONTAINER)

	prunable: BOOLEAN
			-- May items be removed? (Answer: no.)
			-- (from ARRAY)

	resizable: BOOLEAN
			-- May capacity be changed? (Answer: yes.)
			-- (from RESIZABLE)

	same_items (other: like Current): BOOLEAN
			-- Do `other' and Current have same items?
			-- (from ARRAY)
		require -- from ARRAY
			other_not_void: other /= Void
		ensure -- from ARRAY
			definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

	same_type (other: ANY): BOOLEAN
			-- Is type of current object identical to type of `other'?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			definition: Result = (conforms_to (other) and other.conforms_to (Current))

	valid_index (i: INTEGER_32): BOOLEAN
			-- Is `i' within the bounds of the array?
			-- (from ARRAY)
		require -- from  TABLE
			True
		require -- from  TO_SPECIAL
			True
		ensure then -- from INDEXABLE
			only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

	valid_index_set: BOOLEAN
			-- (from ARRAY)
	
feature -- Status setting

	compare_objects
			-- Ensure that future search operations will use equal
			-- rather than `=' for comparing references.
			-- (from CONTAINER)
		require -- from CONTAINER
			changeable_comparison_criterion: changeable_comparison_criterion
		ensure -- from CONTAINER
			object_comparison

	compare_references
			-- Ensure that future search operations will use `='
			-- rather than equal for comparing references.
			-- (from CONTAINER)
		require -- from CONTAINER
			changeable_comparison_criterion: changeable_comparison_criterion
		ensure -- from CONTAINER
			reference_comparison: not object_comparison

	set_e_transition (source, target: INTEGER_32)
			-- Set epsilon transition from `source' to `target'.
		require -- from NDFA
			source_in_automaton: source >= 1 and source <= nb_states
			target_in_automaton: target >= 1 and target <= nb_states

	set_final (s, r: INTEGER_32)
			-- Make `s' the final state of regular expression `r'.

	set_letters
			-- Direct the active transitions to include letters.

	set_start (n: INTEGER_32)
			-- Select state `n' as the starting state.
			-- (from AUTOMATON)
		require -- from AUTOMATON
			no_other_start: start_number = 0 or start_number = n
			is_in_automaton: n <= nb_states and n >= 1

	set_transition (source, input_doc, target: INTEGER_32)
			-- Set transition from `source' to `target' on `input_doc'.
		require -- from  AUTOMATON
			True
		require else -- from NDFA
			source_in_automaton: source >= 1 and source <= nb_states
			target_in_automaton: target >= 1 and target <= nb_states
			possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
		require else
			source_in_automaton: source >= 1 and source <= nb_states
			target_in_automaton: target >= 1 and target <= nb_states
			possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
			good_successor: target = source + 1
	
feature -- Element change

	add_keyword (word: STRING_8)
			-- Insert `word' in the keyword list.

	enter (v: like item; i: INTEGER_32)
			-- Replace `i'-th entry, if in index interval, by `v'.
			-- (from ARRAY)
		require -- from ARRAY
			valid_key: valid_index (i)

	fill (other: CONTAINER [LINKED_LIST [INTEGER_32]])
			-- Fill with as many items of `other' as possible.
			-- The representations of `other' and current structure
			-- need not be the same.
			-- (from COLLECTION)
		require -- from COLLECTION
			other_not_void: other /= Void
			extendible: extendible

	force (v: like item; i: INTEGER_32)
			-- Assign item `v' to `i'-th entry.
			-- Always applicable: resize the array if `i' falls out of
			-- currently defined bounds; preserve existing items.
			-- (from ARRAY)
		ensure -- from ARRAY
			inserted: item (i) = v
			higher_count: count >= old count

	include (fa: PDFA; shift: INTEGER_32)
			-- Copy `fa' with state numbers shifted
			-- by `shift' positions in the transitions.
			-- Do not preserve the `final' values.
		require
			same_inputs: greatest_input = fa.greatest_input
			nb_states_large_enough: nb_states >= fa.nb_states + shift

	put (v: like item; i: INTEGER_32)
			-- Replace `i'-th entry, if in index interval, by `v'.
			-- (from ARRAY)
		require -- from TABLE
			valid_key: valid_index (i)
		require -- from TO_SPECIAL
			valid_index: valid_index (i)
		ensure then -- from INDEXABLE
			insertion_done: item (i) = v
		ensure -- from TO_SPECIAL
			inserted: item (i) = v

	remove_case_sensitiveness
			-- Remove case sensitiveness.
		require
			z_possible: greatest_input >= lower_z

	subcopy (other: ARRAY [like item]; start_pos, end_pos, index_pos: INTEGER_32)
			-- Copy items of `other' within bounds `start_pos' and `end_pos'
			-- to current array starting at index `index_pos'.
			-- (from ARRAY)
		require -- from ARRAY
			other_not_void: other /= Void
			valid_start_pos: other.valid_index (start_pos)
			valid_end_pos: other.valid_index (end_pos)
			valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
			valid_index_pos: valid_index (index_pos)
			enough_space: (upper - index_pos) >= (end_pos - start_pos)
	
feature -- Removal

	clear_all
			-- Reset all items to default values.
			-- (from ARRAY)
		ensure -- from ARRAY
			stable_lower: lower = old lower
			stable_upper: upper = old upper
			default_items: all_default

	delete_transition (source, input_doc, target: INTEGER_32)
			-- Delete transition from `source' to `target' on `input_doc'.
		require -- from NDFA
			source_in_automaton: source >= 1 and source <= nb_states
			target_in_automaton: target >= 1 and target <= nb_states
			possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
		require else
			source_in_automaton: source >= 1 and source <= nb_states
			target_in_automaton: target >= 1 and target <= nb_states
			possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
			good_successor: target = source + 1

	discard_items
			-- Reset all items to default values with reallocation.
			-- (from ARRAY)
		ensure -- from ARRAY
			default_items: all_default

	prune_all (v: LINKED_LIST [INTEGER_32])
			-- Remove all occurrences of `v'.
			-- (Reference or object equality,
			-- based on object_comparison.)
			-- (from COLLECTION)
		require -- from COLLECTION
			prunable: prunable
		ensure -- from COLLECTION
			no_more_occurrences: not has (v)
	
feature -- Resizing

	automatic_grow
			-- Change the capacity to accommodate at least
			-- Growth_percentage more items.
			-- (from RESIZABLE)
		ensure -- from RESIZABLE
			increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

	conservative_resize (min_index, max_index: INTEGER_32)
			-- Rearrange array so that it can accommodate
			-- indices down to `min_index' and up to `max_index'.
			-- Do not lose any previously entered item.
			-- (from ARRAY)
		require -- from ARRAY
			good_indices: min_index <= max_index
		ensure -- from ARRAY
			no_low_lost: lower = min_index or else lower = old lower
			no_high_lost: upper = max_index or else upper = old upper

	grow (i: INTEGER_32)
			-- Change the capacity to at least `i'.
			-- (from ARRAY)
		ensure -- from RESIZABLE
			new_capacity: capacity >= i
	
feature -- Transformation

	construct_dfa
			-- Create an equivalent deterministic finite automaton.
			-- (from NDFA)
		require -- from NDFA
			start_number_designated: start_number > 0
	
feature -- Conversion

	linear_representation: LINEAR [LINKED_LIST [INTEGER_32]]
			-- Representation as a linear structure
			-- (from ARRAY)

	to_cil: NATIVE_ARRAY [LINKED_LIST [INTEGER_32]]
			-- Address of actual sequence of values,
			-- for passing to external (non-Eiffel) routines.
			-- (from ARRAY)
		require -- from ARRAY
			is_dotnet: {PLATFORM}.is_dotnet
		ensure -- from ARRAY
			to_cil_not_void: Result /= Void

	to_special: SPECIAL [LINKED_LIST [INTEGER_32]]
			-- 'area'.
			-- (from ARRAY)
		ensure -- from ARRAY
			to_special_not_void: Result /= Void
	
feature -- Duplication

	copy (other: like Current)
			-- Reinitialize by copying all the items of `other'.
			-- (This is also used by clone.)
			-- (from ARRAY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)
		ensure then -- from ARRAY
			equal_areas: area.is_equal (other.area)

	frozen deep_copy (other: like Current)
			-- Effect equivalent to that of:
			--		copy (`other' . deep_twin)
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			deep_equal: deep_equal (Current, other)

	frozen deep_twin: like Current
			-- New object structure recursively duplicated from Current.
			-- (from ANY)
		ensure -- from ANY
			deep_equal: deep_equal (Current, Result)

	frozen standard_copy (other: like Current)
			-- Copy every field of `other' onto corresponding field
			-- of current object.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_standard_equal: standard_is_equal (other)

	frozen standard_twin: like Current
			-- New object field-by-field identical to `other'.
			-- Always uses default copying semantics.
			-- (from ANY)
		ensure -- from ANY
			standard_twin_not_void: Result /= Void
			equal: standard_equal (Result, Current)

	subarray (start_pos, end_pos: INTEGER_32): ARRAY [LINKED_LIST [INTEGER_32]]
			-- Array made of items of current array within
			-- bounds `start_pos' and `end_pos'.
			-- (from ARRAY)
		require -- from ARRAY
			valid_start_pos: valid_index (start_pos)
			valid_end_pos: end_pos <= upper
			valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
		ensure -- from ARRAY
			lower: Result.lower = start_pos
			upper: Result.upper = end_pos

	frozen twin: like Current
			-- New object equal to `Current'
			-- twin calls copy; to change copying/twining semantics, redefine copy.
			-- (from ANY)
		ensure -- from ANY
			twin_not_void: Result /= Void
			is_equal: Result.is_equal (Current)
	
feature -- Basic operations

	frozen default: like Current
			-- Default value of object's type
			-- (from ANY)

	frozen default_pointer: POINTER
			-- Default value of type `POINTER'
			-- (Avoid the need to write `p'.default for
			-- some `p' of type `POINTER'.)
			-- (from ANY)

	default_rescue
			-- Process exception for routines with no Rescue clause.
			-- (Default: do nothing.)
			-- (from ANY)

	frozen do_nothing
			-- Execute a null action.
			-- (from ANY)
	
feature -- Iteration

	do_all (action: PROCEDURE [ANY, TUPLE [LINKED_LIST [INTEGER_32]]])
			-- Apply `action' to every item.
			-- Semantics not guaranteed if `action' changes the structure;
			-- in such a case, apply iterator to clone of structure instead.
			-- (from ARRAY)
		require -- from ARRAY
			action_not_void: action /= Void

	do_if (action: PROCEDURE [ANY, TUPLE [LINKED_LIST [INTEGER_32]]]; test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN])
			-- Apply `action' to every item that satisfies `test'.
			-- Semantics not guaranteed if `action' or `test' changes the structure;
			-- in such a case, apply iterator to clone of structure instead.
			-- (from ARRAY)
		require -- from ARRAY
			action_not_void: action /= Void
			test_not_void: test /= Void

	for_all (test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN]): BOOLEAN
			-- Is `test' true for all items?
			-- (from ARRAY)
		require -- from ARRAY
			test_not_void: test /= Void

	there_exists (test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN]): BOOLEAN
			-- Is `test' true for at least one item?
			-- (from ARRAY)
		require -- from ARRAY
			test_not_void: test /= Void
	
feature -- Output

	io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)

	out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of tagged_out.
			-- (from ANY)

	print (some: ANY)
			-- Write terse external representation of `some'
			-- on standard output.
			-- (from ANY)

	frozen tagged_out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of out.
			-- (from ANY)

	trace
			-- Output an internal representation
			-- of the current automaton.
	
feature -- Platform

	operating_environment: OPERATING_ENVIRONMENT
			-- Objects available from the operating system
			-- (from ANY)
	
invariant
		-- from ARRAY
	area_exists: area /= Void
	consistent_size: capacity = upper - lower + 1
	non_negative_count: count >= 0
	index_set_has_same_count: valid_index_set

		-- from RESIZABLE
	increase_by_at_least_one: minimal_increase >= 1

		-- from BOUNDED
	valid_count: count <= capacity
	full_definition: full = (count = capacity)

		-- from FINITE
	empty_definition: is_empty = (count = 0)
	non_negative_count: count >= 0

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

		-- from INDEXABLE
	index_set_not_void: index_set /= Void

indexing
	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		356 Storke Road, Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class PDFA