Changes

Jump to navigation Jump to search
1,012 bytes added ,  13:38, 13 July 2020
no edit summary
(1 to 5)[. > 3] ! (. + 2)
</syntaxhighlight>
 
==Logic==
 
Boolean algebra (and set theory) comes with a set of laws that can all be applied to XQuery expressions.
 
{| class="wikitable"
|- valign="top"
| Expression
| Rewritten expression
| Rule
|- valign="top"
| <code>$a + 0</code>
| <code>$a</code>
| Identity
|- valign="top"
| <code>$a * 1</code>
| <code>$a</code>
| Identity
|- valign="top"
| <code>$a * 0</code>
| <code>0</code>
| Annihilator
|- valign="top"
| <code>$a and $a</code>
| <code>$a</code>
| Idempotence
|- valign="top"
| <code>$a and ($a or $b)</code>
| <code>$a</code>
| Absorption
|- valign="top"
| <code>($a and $b) or ($a and $c)</code>
| <code>$a and ($b or $c)</code>
| Distributivity
|- valign="top"
| <code>$a and not($a)</code>
| <code>true()</code>
| Tertium non datur
|- valign="top"
| <code>not($a) and not($b)</code>
| <code>not($a or $b)</code>
| De Morgan
|}
 
Please note that the listed rule cannot be applied to arbitrary input. For example, <code>xs:double('NaN') * 0<code> yields <code>NaN<code> instead of <code>0</code>
=Changelog=
Introduced with Version 9.4.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu