=pod =encoding utf8 =head1 NAME Muldis::D::Core::Boolean - Muldis D boolean logic operators =head1 VERSION This document is Muldis::D::Core::Boolean version 0.148.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. Moreover, you should read the L document before this current document, as that forms its own tree beneath a root document branch. =head1 DESCRIPTION This document describes essentially all of the core Muldis D operators that are specific to the core data type C, a superset of all the generic ones that a typical programming language should have. I =head1 FUNCTIONS IMPLEMENTING VIRTUAL ORDERED FUNCTIONS =head2 sys.std.Core.Boolean.order C<< function order (Order <-- topic : Bool, other : Bool, misc_args? : Tuple, is_reverse_order? : Bool) implements sys.std.Core.Ordered.order {...} >> This is a (total) C function specific to C. Its only valid C argument is C. =head1 FUNCTIONS IMPLEMENTING VIRTUAL ORDINAL FUNCTIONS =head2 sys.std.Core.Boolean.pred C<< function pred (Bool <-- topic : Bool) implements sys.std.Core.Ordered.Ordinal.pred {...} >> This function results in the value that precedes its argument. It results in C iff its argument is C, and C<-Inf> otherwise. =head2 sys.std.Core.Boolean.succ C<< function succ (Bool <-- topic : Bool) implements sys.std.Core.Ordered.Ordinal.succ {...} >> This function results in the value that succeeds its argument. It results in C iff its argument is C, and C otherwise. =head1 FUNCTIONS FOR BOOLEAN LOGIC These functions implement commonly used boolean logic operations. =head2 sys.std.Core.Boolean.not C<< function not (Bool <-- topic : Bool) {...} >> This function results in the logical I of its argument. This function results in C iff its argument is C, and C otherwise. Note that this operation is also known as I or C<¬> or (prefix) C. There also exists conceptually the logical monadic operation called I or I which results simply in its argument; this is the complement operation of I or I. Now in practice any value expression that is an invocation of I can simply be replaced with its argument, so there is no reason for I to exist as an actual function. =head2 sys.std.Core.Boolean.and C<< function and (Bool <-- topic? : set_of.Bool) {...} >> This function is a reduction operator that recursively takes each pair of its N input element values and does a logical I (which is commutative, associative, and idempotent) on them until just one is left, which is the function's result. For each pair of input values, the I of that pair is C iff both input values are C, and C otherwise. If C has zero values, then C results in C, which is the identity value for logical I. Note that this operation is also known as I or I or I or C<∧>. =head2 sys.std.Core.Boolean.all C<< function all (Bool <-- topic? : set_of.Bool) {...} >> This function is an alias for C. This function results in C iff all of its input element values are C (or it has no input values), and C otherwise (when it has at least one input value that is C). =head2 sys.std.Core.Boolean.nand C<< function nand (Bool <-- topic : Bool, other : Bool) {...} >> This symmetric function results in C iff its 2 arguments are both C, and C otherwise. Note that this operation is also known as I or I or I or C<⊼> or C<↑>. =head2 sys.std.Core.Boolean.or C<< function or (Bool <-- topic? : set_of.Bool) {...} >> This function is a reduction operator that recursively takes each pair of its N input element values and does a logical inclusive-or (which is commutative, associative, and idempotent) on them until just one is left, which is the function's result. For each pair of input values, the I of that pair is C iff both input values are C, and C otherwise. If C has zero values, then C results in C, which is the identity value for logical inclusive-or. Note that this operation is also known as I or I or I or C<∨>. =head2 sys.std.Core.Boolean.any C<< function any (Bool <-- topic? : set_of.Bool) {...} >> This function is an alias for C. This function results in C iff any of its input element values are C, and C otherwise (when all of its input values are C or if it has no input values). =head2 sys.std.Core.Boolean.nor C<< function nor (Bool <-- topic : Bool, other : Bool) {...} >> This symmetric function results in C iff its 2 arguments are both C, and C otherwise. Note that this operation is also known as I or I or I or C<⊽> or C<↓>. =head2 sys.std.Core.Boolean.xnor C<< function xnor (Bool <-- topic? : bag_of.Bool) {...} >> This function is a reduction operator that recursively takes each pair of its N input element values and does a logical xnor (which is both commutative and associative) on them until just one is left, which is the function's result. For each pair of input values, the I of that pair is C iff both input values are exactly the same value, and C otherwise. If C has zero values, then C results in C, which is the identity value for logical xnor. Note that this operation is also known as I or I (I) or I or I or I (dyadic usage) or I or C<↔>. Note that a dyadic (2 input value) invocation of C is exactly the same operation as a C invocation whose arguments are both C-typed. =head2 sys.std.Core.Boolean.iff C<< function iff (Bool <-- topic? : bag_of.Bool) {...} >> This function is an alias for C. =head2 sys.std.Core.Boolean.xor C<< function xor (Bool <-- topic? : bag_of.Bool) {...} >> This function is a reduction operator that recursively takes each pair of its N input element values and does a logical exclusive-or (which is both commutative and associative) on them until just one is left, which is the function's result. For each pair of input values, the I of that pair is C iff both input values are exactly the same value, and C otherwise. If C has zero values, then C results in C, which is the identity value for logical exclusive-or. Note that this operation is also known as I or I (dyadic usage) or I or C<⊻> or C<↮>. Note that a dyadic (2 input value) invocation of C is exactly the same operation as a C invocation whose arguments are both C-typed. =head2 sys.std.Core.Boolean.imp C<< function imp (Bool <-- topic : Bool, other : Bool) {...} >> This function results in C iff its C argument is C and its C argument is C, and C otherwise. Note that this operation is also known as I or I or C<→>. =head2 sys.std.Core.Boolean.implies C<< function implies (Bool <-- topic : Bool, other : Bool) {...} >> This function is an alias for C. =head2 sys.std.Core.Boolean.nimp C<< function nimp (Bool <-- topic : Bool, other : Bool) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same arguments. Note that this operation is also known as I or I or C<↛>. =head2 sys.std.Core.Boolean.if C<< function if (Bool <-- topic : Bool, other : Bool) {...} >> This function is an alias for C except that it transposes the C and C arguments. This function results in C iff its C argument is C and its C argument is C, and C otherwise. Note that this operation is also known as I or I or C<←>. =head2 sys.std.Core.Boolean.nif C<< function nif (Bool <-- topic : Bool, other : Bool) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same arguments. Note that this operation is also known as I or I or C<↚>. =head2 sys.std.Core.Boolean.not_all C<< function not_all (Bool <-- topic? : set_of.Bool) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same argument. This function results in C iff not all of its input element values are C, and C otherwise (when all of its input values are C or if it has no input values). =head2 sys.std.Core.Boolean.none C<< function none (Bool <-- topic? : set_of.Bool) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same argument. This function results in C iff none of its input element values are C (or it has no input values), and C otherwise (when it has at least one input value that is C). Note that this operation is also known as I. =head2 sys.std.Core.Boolean.not_any C<< function not_any (Bool <-- topic? : set_of.Bool) {...} >> This function is an alias for C. =head2 sys.std.Core.Boolean.one C<< function one (Bool <-- topic? : bag_of.Bool) {...} >> This function results in C iff exactly one of its input element values is C, and C otherwise. Note that in some contexts, this operation would alternately be known as I, but in Muldis D it is not. =head2 sys.std.Core.Boolean.not_one C<< function not_one (Bool <-- topic? : bag_of.Bool) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same argument. =head2 sys.std.Core.Boolean.exactly C<< function exactly (Bool <-- topic? : bag_of.Bool, count : NNInt) {...}>> This function results in C iff the count of its input element values that are C matches the C argument, and C otherwise. =head2 sys.std.Core.Boolean.not_exactly C<< function not_exactly (Bool <-- topic? : bag_of.Bool, count : NNInt) {...} >> This function is exactly the same as C except that it results in the opposite boolean value when given the same argument. =head2 sys.std.Core.Boolean.true C<< function true (NNInt <-- topic? : bag_of.Bool) {...} >> This function results in the count of its input element values that are C. =head2 sys.std.Core.Boolean.false C<< function false (NNInt <-- topic? : bag_of.Bool) {...} >> This function results in the count of its input element values that are C. =head1 UPDATERS IMPLEMENTING VIRTUAL ORDINAL FUNCTIONS =head2 sys.std.Core.Boolean.assign_pred C This update operator is a short-hand for first invoking the C function with the same argument, and then assigning the result of that function to its argument. =head2 sys.std.Core.Boolean.assign_succ C This update operator is a short-hand for first invoking the C function with the same argument, and then assigning the result of that function to its argument. =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-2011, Muldis Data Systems, Inc. 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