%----------------------------------------------------------------------------- % Subsequences of sequences of countable length. % % Author: Jerry James <loganjerry@gmail.com> % % This file and its accompanying proof file are distributed under the CC0 1.0 % Universal license: http://creativecommons.org/publicdomain/zero/1.0/. % % Version history: % 2007 Feb 14: PVS 4.0 version % 2011 May 6: PVS 5.0 version % 2013 Jan 14: PVS 6.0 version %-----------------------------------------------------------------------------
csequence_subsequence[T: TYPE]: THEORY BEGIN
% Note that subsequence? is not a partial order, because it is not % antisymmetric. These two sequences are subsequences of each other, % but are not equal: % % 1, 2, 1, 2, 1, 2, ... % 2, 1, 2, 1, 2, 1, ...
% An alternative characterization of subsequences: there exists a % monotonically increasing function from the indexes of the "smaller" % sequence to the indexes of the "larger" sequence such that the % mapped elements are equal
subsequence_func(cseq2, (cseq1: (subsequence?(cseq2))))
(n: indexes(cseq1)): RECURSIVE
indexes(cseq2) = LET index =
min[indexes(cseq2)]
({i: indexes(cseq2) | first(cseq1) = nth(cseq2, i)}) IN IF n = 0 THEN index ELSE index + 1 +
subsequence_func(suffix(cseq2, index + 1), rest(cseq1))(n - 1) ENDIF MEASURE n
subsequence_func_monotonic: LEMMA FORALL cseq1, cseq2, (n, m: indexes(cseq1)):
subsequence?(cseq1, cseq2) AND n < m IMPLIES
subsequence_func(cseq2, cseq1)(n) < subsequence_func(cseq2, cseq1)(m)
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.