%----------------------------------------------------------------------------- % Conversions between sequences of countable length and the prelude list type. % % 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_list[T: TYPE]: THEORY BEGIN
% Convert a list to a finite_csequence
from_list(l): RECURSIVE finite_csequence = IF null?(l) THEN empty_cseq ELSE add(car(l), from_list(cdr(l))) ENDIF MEASURE l BY <<
% Convert a finite_csequence to a list
to_list(fseq): RECURSIVE list = IF empty?(fseq) THEN null ELSE cons(first(fseq), to_list(rest(fseq))) ENDIF MEASURE length(fseq)
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.