sort_seq[T: TYPE, <= : (total_order?[T]) ]: THEORY %------------------------------------------------------------------------ % % sort_seq (basic definitions and properties) % ------------------------------------------- % % Author: Ricky W. Butler % % This theory defines the sort function over an seq of % values. Most of the text of this theory is scaffolding to % demonstrate that the definition of "sort" is sound. In particular, % the function "asort" is a witness function and not intended % to be used externally. % % The following definitions should be used exclusively: % % is_permutation(A1,A2): bool = (EXISTS (f: [below(N) -> below(N)]): % bijective?(f) AND (FORALL ii: A1(ii) = A2(f(ii)))) % % increasing(A): bool = (FORALL i,j: 0 <= i AND i < j AND j < N % IMPLIES A(i) <= A(j)) % % sort(A): {a: seqs | is_permutation(A,a) AND increasing(a)} % % Note: % The properties of sort are readily obtained via % TYPEPRED "sort" or through use of sort_lem. % %------------------------------------------------------------------------
EXPORTING ALL BUT seq_to_array % i.e. do not export sort_array WITH permutations_seq[T,<=], seqs[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.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.