csequence_nth.pvs
Interaktion und Portierbarkeitunbekannt
%----------------------------------------------------------------------------- % Last and nth elements of a sequence of countable length, as well as the % valid indexes. % % 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_nth[T: TYPE]: THEORY BEGIN
IMPORTING csequence_length[T]
n: VAR nat
p: VAR pred[T]
cseq, cseq1, cseq2: VAR csequence
fseq: VAR finite_csequence
nseq: VAR nonempty_csequence
nfseq: VAR nonempty_finite_csequence
iseq: VAR infinite_csequence
% The valid indexes of a csequence.
index?(cseq)(n): RECURSIVE bool = nonempty?(cseq) AND (n = 0 OR index?(rest(cseq))(n - 1)) MEASURE n