=pod =encoding utf8 =head1 NAME Muldis::D::Ext::Bag - Muldis D extension for Bag specific operators =head1 VERSION This document is Muldis::D::Ext::Bag version 0.25.0. =head1 PREFACE This document is part of the Muldis D language specification, whose root document is L; you should read that root document before you read this one, which provides subservient details. =head1 DESCRIPTION Muldis D has a mandatory core set of system-defined (eternally available) entities, which is referred to as the I or the I; they are the minimal entities that all Muldis D implementations need to provide; they are mutually self-describing and are used to bootstrap the language; any entities outside the core, called I, are non-mandatory and are defined in terms of the core or each other, but the reverse isn't true. This current C document describes the system-defined I, which consists of generic operators that are specific to the C parameterized relation type, and said operators are short-hands for generic relational operators in the language core. This current document does not describe the polymorphic operators that all types, or some types including core types, have defined over them; said operators are defined once for all types in L. I =head1 SYSTEM-DEFINED BAG-CONCERNING FUNCTIONS Each C parameter is optional and defaults to the zero-attribute tuple if no explicit argument is given to it. =over =item C This function is like C but that it accounts for the greater-than-one multiplicity of values in its argument; it results in the sum of the C attribute of its argument. =item C This function is the same as C, including that matching of C is done against the C attribute, except that it works with a C rather than a C. =item C This function is exactly the same as C except that it results in the opposite boolean value when given the same arguments. =item C This function results in the multiplicity / count of occurrances of C in C; if a tuple exists in C whose C attribute is C, then the result is its C attribute; otherwise the result is zero. =item C This function is the same as C as per C but that its result differs depending on whether C already exists in C; if it does, then no new tuple is added, but the C attribute for the matching tuple is incremented by 1; if it does not, then a new tuple is added where its C is C and its C is 1. =item C This function is the same as C as per C but that its result differs depending on what the C for any tuple matching C that already exists in C is; if the C is greater than 1, then it is decremented by 1; if it is equal to 1, then the tuple whose C is C is deleted. =item C This function is the same as C, including that input values for the reduction come from the C attribute of C, except that it works with a C rather than a C; C is invoked extra times, where both its C and C arguments might be different instances of the same value having >= 2 multiplicity. =item C This function is to C as C is to C. =item C This function results in the C that is the projection of the C attribute of its C argument. =item C This function results in the C that is the extension of its C argument with a new C attribute whose value for every tuple is 1. =item C This function results in a C whose C attribute is tuple-typed and that attribute's values are all the tuples of C; is a short-hand for a relational wrap of all attributes of C such that the new tuple-valued attribute is named C, and then that result is extended with a C attribute whose value for every tuple is 1. =item C This function results in a C consisting of all the values of the attribute of C named by C. It is a short-hand for first doing a relational group on all attributes of C besides C to produce a new relation-typed attribute, and then extending the result of the group with a new positive integer attribute whose values are the cardinality of the relation-valued attribute's values, and then doing a binary projection of the named attribute and the new integer attribute plus their renaming to C and C respectively. =item C This function is like C but that it accounts for the greater-than-one multiplicity of values in its arguments; this function returns C iff the multiplicity of each C value is less than or equal to the multiplicity of its counterpart C value. =item C This function is like C as per C. =item C This function is like C as per C. I =item C This function is like C as per C. I =item C This function is like C but that it just looks at the C attribute of its argument elements when determining what element tuples correspond; then for each tuple in the result, its C attribute value is the maximum of the C attribute values of its corresponding input element tuples. =item C This function is like C as C is like C; the minimum of C attribute values is used rather than the maximum. =item C This function is like C as C is like C; for corresponding input tuples, the result only has a tuple with the same C if the C of the C tuple is greater than the C of the C tuple, and the C of the result tuple is the difference of those two. =back =head1 SEE ALSO Go to L for the majority of distribution-internal references, and L for the majority of distribution-external references. =head1 AUTHOR Darren Duncan (C) =head1 LICENSE AND COPYRIGHT This file is part of the formal specification of the Muldis D language. Muldis D is Copyright © 2002-2008, Darren Duncan. See the LICENSE AND COPYRIGHT of L for details. =head1 TRADEMARK POLICY The TRADEMARK POLICY in L applies to this file too. =head1 ACKNOWLEDGEMENTS The ACKNOWLEDGEMENTS in L apply to this file too. =cut