%----------------------------------------------------------------------------- % Suffixes 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_suffix[T: TYPE]: THEORY BEGIN
p: VAR pred[T]
n, m: VAR nat
cseq, cseq1, cseq2: VAR csequence
fseq, fseq1, fseq2: VAR finite_csequence
iseq: VAR infinite_csequence
nseq: VAR nonempty_csequence
eseq: VAR empty_csequence
suffix?(cseq1, cseq2): INDUCTIVE bool =
cseq1 = cseq2 OR (nonempty?(cseq2) AND suffix?(cseq1, rest(cseq2)))
% Note that suffix? is not a partial order, because it is not % antisymmetric. These two sequences are suffixes of each other, % but are not equal: % % 1, 2, 1, 2, 1, 2, ... % 2, 1, 2, 1, 2, 1, ...
% A dichotomous?-like property for suffixes of a given sequence.
suffix?_order: THEOREM FORALL cseq, cseq1, cseq2:
suffix?(cseq1, cseq) AND suffix?(cseq2, cseq) IMPLIES
suffix?(cseq1, cseq2) OR suffix?(cseq2, cseq1)
% The suffix of cseq after skipping over n elements
suffix(cseq, n): RECURSIVE (suffix?(cseq)) = IF n = 0 OR empty?(cseq) THEN cseq ELSE suffix(rest(cseq), n - 1) ENDIF MEASURE n
suffix_concatenate: THEOREM FORALL cseq1, cseq2, n:
suffix(cseq1 o cseq2, n) = IF index?(cseq1)(n) THEN suffix(cseq1, n) o cseq2 ELSE suffix(cseq2, n - length(cseq1)) ENDIF
suffix_some: THEOREM FORALL cseq, n, p:
some(p)(suffix(cseq, n)) IFF
(EXISTS (i: indexes(cseq)): i >= n AND p(nth(cseq, i)))
suffix_every: THEOREM FORALL cseq, n, p:
every(p)(suffix(cseq, n)) IFF
(FORALL (i: indexes(cseq)): i >= n IMPLIES p(nth(cseq, i)))
END csequence_suffix
¤ 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)
¤
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.