Darren Duncan >
Muldis-D-0.148.0 >
Muldis::D::Core::Boolean

- NAME
- VERSION
- PREFACE
- DESCRIPTION
- FUNCTIONS IMPLEMENTING VIRTUAL ORDERED FUNCTIONS
- FUNCTIONS IMPLEMENTING VIRTUAL ORDINAL FUNCTIONS
- FUNCTIONS FOR BOOLEAN LOGIC
- sys.std.Core.Boolean.not
- sys.std.Core.Boolean.and
- sys.std.Core.Boolean.all
- sys.std.Core.Boolean.nand
- sys.std.Core.Boolean.or
- sys.std.Core.Boolean.any
- sys.std.Core.Boolean.nor
- sys.std.Core.Boolean.xnor
- sys.std.Core.Boolean.iff
- sys.std.Core.Boolean.xor
- sys.std.Core.Boolean.imp
- sys.std.Core.Boolean.implies
- sys.std.Core.Boolean.nimp
- sys.std.Core.Boolean.if
- sys.std.Core.Boolean.nif
- sys.std.Core.Boolean.not_all
- sys.std.Core.Boolean.none
- sys.std.Core.Boolean.not_any
- sys.std.Core.Boolean.one
- sys.std.Core.Boolean.not_one
- sys.std.Core.Boolean.exactly
- sys.std.Core.Boolean.not_exactly
- sys.std.Core.Boolean.true
- sys.std.Core.Boolean.false

- UPDATERS IMPLEMENTING VIRTUAL ORDINAL FUNCTIONS
- SEE ALSO
- AUTHOR
- LICENSE AND COPYRIGHT
- TRADEMARK POLICY
- ACKNOWLEDGEMENTS

Muldis::D::Core::Boolean - Muldis D boolean logic operators

This document is Muldis::D::Core::Boolean version 0.148.0.

This document is part of the Muldis D language specification, whose root document is Muldis::D; you should read that root document before you read this one, which provides subservient details. Moreover, you should read the Muldis::D::Core document before this current document, as that forms its own tree beneath a root document branch.

This document describes essentially all of the core Muldis D operators that are specific to the core data type `Bool`

,
a superset of all the generic ones that a typical programming language should have.

*This documentation is pending.*

```
function order (Order <-- topic : Bool,
other : Bool,
misc_args?
: Tuple,
is_reverse_order?
: Bool) implements sys.std.Core.Ordered.order {...}
```

This is a (total) `order-determination`

function specific to `Bool`

.
Its only valid `misc_args`

argument is `Tuple:D0`

.

`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 `Bool:False`

iff its argument is `Bool:True`

,
and `-Inf`

otherwise.

`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 `Bool:True`

iff its argument is `Bool:False`

,
and `Inf`

otherwise.

These functions implement commonly used boolean logic operations.

`function not (Bool <-- topic : Bool) {...}`

This function results in the logical *not* of its argument.
This function results in `Bool:True`

iff its argument is `Bool:False`

,
and `Bool:False`

otherwise.
Note that this operation is also known as *negation* or `¬`

or (prefix) `!`

.

There also exists conceptually the logical monadic operation called *so* or *proposition* which results simply in its argument; this is the complement operation of *not* or *negation*.
Now in practice any value expression that is an invocation of *so* can simply be replaced with its argument,
so there is no reason for *so* to exist as an actual function.

```
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 *and* (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 *and* of that pair is `Bool:True`

iff both input values are `Bool:True`

,
and `Bool:False`

otherwise.
If `topic`

has zero values,
then `and`

results in `Bool:True`

,
which is the identity value for logical *and*.
Note that this operation is also known as *all* or *every* or *conjunction* or `∧`

.

```
function all (Bool <-- topic?
: set_of.Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.and`

.
This function results in `Bool:True`

iff all of its input element values are `Bool:True`

(or it has no input values),
and `Bool:False`

otherwise (when it has at least one input value that is `Bool:False`

).

```
function nand (Bool <-- topic : Bool,
other : Bool) {...}
```

This symmetric function results in `Bool:False`

iff its 2 arguments are both `Bool:True`

,
and `Bool:True`

otherwise.
Note that this operation is also known as *not and* or *not both* or *alternative denial* or `⊼`

or `↑`

.

```
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 *or* of that pair is `Bool:False`

iff both input values are `Bool:False`

,
and `Bool:True`

otherwise.
If `topic`

has zero values,
then `or`

results in `Bool:False`

,
which is the identity value for logical inclusive-or.
Note that this operation is also known as *any* or *some* or *disjunction* or `∨`

.

```
function any (Bool <-- topic?
: set_of.Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.or`

.
This function results in `Bool:True`

iff any of its input element values are `Bool:True`

,
and `Bool:False`

otherwise (when all of its input values are `Bool:False`

or if it has no input values).

```
function nor (Bool <-- topic : Bool,
other : Bool) {...}
```

This symmetric function results in `Bool:True`

iff its 2 arguments are both `Bool:False`

,
and `Bool:False`

otherwise.
Note that this operation is also known as *not or* or *neither ...
nor* or *joint denial* or `⊽`

or `↓`

.

```
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 *xnor* of that pair is `Bool:True`

iff both input values are exactly the same value,
and `Bool:False`

otherwise.
If `topic`

has zero values,
then `xnor`

results in `Bool:True`

,
which is the identity value for logical xnor.
Note that this operation is also known as *not xor* or *iff* (*if and only if*) or *material equivalence* or *biconditional* or *equivalent* (dyadic usage) or *even parity* or `↔`

.
Note that a dyadic (2 input value) invocation of `xnor`

is exactly the same operation as a `sys.std.Core.Universal.is_same`

invocation whose arguments are both `Bool`

-typed.

```
function iff (Bool <-- topic?
: bag_of.Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.xnor`

.

```
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 *xor* of that pair is `Bool:False`

iff both input values are exactly the same value,
and `Bool:True`

otherwise.
If `topic`

has zero values,
then `xor`

results in `Bool:False`

,
which is the identity value for logical exclusive-or.
Note that this operation is also known as *exclusive disjunction* or *not equivalent* (dyadic usage) or *odd parity* or `⊻`

or `↮`

.
Note that a dyadic (2 input value) invocation of `xor`

is exactly the same operation as a `sys.std.Core.Universal.is_not_same`

invocation whose arguments are both `Bool`

-typed.

```
function imp (Bool <-- topic : Bool,
other : Bool) {...}
```

This function results in `Bool:False`

iff its `topic`

argument is `Bool:True`

and its `other`

argument is `Bool:False`

,
and `Bool:True`

otherwise.
Note that this operation is also known as *implies* or *material implication* or `→`

.

```
function implies (Bool <-- topic : Bool,
other : Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.imp`

.

```
function nimp (Bool <-- topic : Bool,
other : Bool) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.imp`

except that it results in the opposite boolean value when given the same arguments.
Note that this operation is also known as *not implies* or *material nonimplication* or `↛`

.

```
function if (Bool <-- topic : Bool,
other : Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.imp`

except that it transposes the `topic`

and `other`

arguments.
This function results in `Bool:False`

iff its `topic`

argument is `Bool:False`

and its `other`

argument is `Bool:True`

,
and `Bool:True`

otherwise.
Note that this operation is also known as *converse implication* or *reverse material implication* or `←`

.

```
function nif (Bool <-- topic : Bool,
other : Bool) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.if`

except that it results in the opposite boolean value when given the same arguments.
Note that this operation is also known as *not if* or *converse nonimplication* or `↚`

.

```
function not_all (Bool <-- topic?
: set_of.Bool) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.all`

except that it results in the opposite boolean value when given the same argument.
This function results in `Bool:True`

iff not all of its input element values are `Bool:True`

,
and `Bool:False`

otherwise (when all of its input values are `Bool:True`

or if it has no input values).

```
function none (Bool <-- topic?
: set_of.Bool) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.any`

except that it results in the opposite boolean value when given the same argument.
This function results in `Bool:True`

iff none of its input element values are `Bool:True`

(or it has no input values),
and `Bool:False`

otherwise (when it has at least one input value that is `Bool:True`

).
Note that this operation is also known as *not any*.

```
function not_any (Bool <-- topic?
: set_of.Bool) {...}
```

This function is an alias for `sys.std.Core.Boolean.none`

.

```
function one (Bool <-- topic?
: bag_of.Bool) {...}
```

This function results in `Bool:True`

iff exactly one of its input element values is `Bool:True`

,
and `Bool:False`

otherwise.
Note that in some contexts,
this operation would alternately be known as *xor*,
but in Muldis D it is not.

```
function not_one (Bool <-- topic?
: bag_of.Bool) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.one`

except that it results in the opposite boolean value when given the same argument.

```
function exactly (Bool <-- topic?
: bag_of.Bool,
count : NNInt) {...}>>
```

This function results in `Bool:True`

iff the count of its input element values that are `Bool:True`

matches the `count`

argument,
and `Bool:False`

otherwise.

```
function not_exactly (Bool <-- topic?
: bag_of.Bool,
count : NNInt) {...}
```

This function is exactly the same as `sys.std.Core.Boolean.exactly`

except that it results in the opposite boolean value when given the same argument.

```
function true (NNInt <-- topic?
: bag_of.Bool) {...}
```

This function results in the count of its input element values that are `Bool:True`

.

```
function false (NNInt <-- topic?
: bag_of.Bool) {...}
```

This function results in the count of its input element values that are `Bool:False`

.

`updater assign_pred (&topic : Bool) implements sys.std.Core.Ordered.Ordinal.assign_pred {...}`

This update operator is a short-hand for first invoking the `sys.std.Core.Boolean.pred`

function with the same argument,
and then assigning the result of that function to its argument.

`updater assign_succ (&topic : Bool) implements sys.std.Core.Ordered.Ordinal.assign_succ {...}`

This update operator is a short-hand for first invoking the `sys.std.Core.Boolean.succ`

function with the same argument,
and then assigning the result of that function to its argument.

Go to Muldis::D for the majority of distribution-internal references, and Muldis::D::SeeAlso for the majority of distribution-external references.

Darren Duncan (`darren@DarrenDuncan.net`

)

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 Muldis::D for details.

The TRADEMARK POLICY in Muldis::D applies to this file too.

The ACKNOWLEDGEMENTS in Muldis::D apply to this file too.

syntax highlighting: