%----------------------------------------------------------------------------- % Finite and infinite sequences, and also the nonempty subtype, part of the % theory of sequences of countable length defined as coalgebraic datatypes. % % 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_props[T: TYPE]: THEORY BEGIN
IMPORTING csequence[T]
t: VAR T
p, q: VAR pred[T]
cseq, cseq_rest: VAR csequence
n, m: VAR nat
% This predicate is TRUE iff cseq is finite and of length n
has_length(cseq, n): RECURSIVE bool = IF empty?(cseq) THEN n = 0 ELSE n > 0 AND has_length(rest(cseq), n - 1) ENDIF MEASURE n
has_length_injective: THEOREM FORALL cseq, n, m:
has_length(cseq, n) AND has_length(cseq, m) IMPLIES n = m
% This predicate is TRUE iff cseq is finite
is_finite(cseq): INDUCTIVE bool = empty?(cseq) OR is_finite(rest(cseq))
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.