%------------------------------------------------------------------------ % % majority_array (basic definitions and properties) % ------------------------------------------- % % This theory defines the majority function over an array of % values. % % Defines: % % is_majority(mv,A) -- predicate that is true IFF mv is % the majority value of the array A. % % maj_exists(A) -- predicate that is true IFF a majority % of A exists. % % maj(A) -- function that returns the majority value % of A if a majority exists. If a majority % does not exist, the function returns an % unspecified value from the type T. % This value may not be in the array. % % inseq(x,A) -- predicate that is true IFF x is in % the array A. % %------------------------------------------------------------------------
majority_array[N: posnat, T: NONEMPTY_TYPE]: THEORY
maj_const: LEMMA maj_exists(constant_array(c)) AND
maj(constant_array(c)) = c
END majority_array
¤ 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.0Bemerkung:
(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.