bags_aux[T:TYPE]:THEORY %------------------------------------------------------------------------ % % Additional properties about bags % % Author: David Griffioen (CWI Amsterdam and KUN) % %------------------------------------------------------------------------ BEGIN
IMPORTING bags[T], bags_to_sets[T]
x,y,e: VAR T
b: VAR bag
n,xn: VAR nat
p,q: VAR pred[T]
insert_choose_rest: LEMMA nonempty_bag?(b) => insert(choose(b),rest(b)) = b
%% ===== on filters ===== % Definition of filter for bags, it takes a bag and a predicate and % returns the bag of those elements that satisfy the predicate.
filter(b,p):bag = (LAMBDA x: IF p(x) THEN b(x) ELSE 0 ENDIF)
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.