%------------------------------------------------------------------------- % % Functions for traversing a well-ordered set. In particular, these % functions yield the first, last, and next elements of such a set. See % below for an explanation of the fairly useless function for yielding % the previous element of such a set. % % For PVS version 3.2. February 28, 2005 % --------------------------------------------------------------------- % Author: Jerry James (jamesj@acm.org), University of Kansas % % EXPORTS % ------- % prelude: orders[T], relation_props2[T, T, T, T], relations[T], sets[T] % finite_sets: finite_sets_inductions, finite_sets_minmax % orders: bounded_orders[T], closure_ops[T], indexed_sets_extra, % minmax_orders[T], ordered_subset[T], relation_iterate[T], % relations_extra[T], well_ordered_traversal[T] % %-------------------------------------------------------------------------
well_ordered_traversal[T: TYPE]: THEORY BEGIN
IMPORTING ordered_subset[T], minmax_orders[T]
t, r, s: VAR T
<: VAR (well_ordered?)
% ========================================================================== % The first element of a well-ordering % ==========================================================================
% All but the first element. This is often useful for stating the elements % which have a prev. See below.
nonfirst(<): set[T] = IF has_first?(<) THEN {t | t /= first(<)} ELSE emptyset[T] ENDIF
% ========================================================================== % The last element of a well-ordering % ==========================================================================
% All but the last element. This is often useful for stating the elements % which have a next.
nonlast(<): set[T] = IF has_last?(<) THEN {t | t /= last(<)} ELSE fullset[T] ENDIF
% ========================================================================== % The successor of a given element % ==========================================================================
% ========================================================================== % The predecessor of a given element % ==========================================================================
% The prev operator is defined in such a way that it is almost useless. % This is because prev is not well-defined for arbitrary well-ordered sets. % For example, consider the set of all even natural numbers, and the set of % all odd natural numbers. Both sets are well-ordered by <. Now consider % the set of all natural numbers, ordered as follows: % % order(x, y) = x < y if x and y are both even, or both odd % FALSE if x is odd and y is even % TRUE if x is even and y is odd % % One can easily show that that order is a well-ordering of the natural % numbers. Any given natural number has a well-defined next element in this % ordering. However, there is no well-defined previous element of 1. % % The following definitions are really placeholders. For any given well % ordering, give a JUDGEMENT stating the elements for which has_prev? is % satisfied.
has_prev?(<)(t): bool = EXISTS (r: (has_next?(<))): next(<)(r) = t
¤ 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.0.1Bemerkung:
(vorverarbeitet)
¤