Chaining operators and relations: Difference between revisions
From Why start at x, y, z
mNo edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
[[Category:Needs filling in]] | [[Category:Needs filling in]] | ||
When you have several terms with operators in between, some kind of associativity is normally implied, so that the expression can be evaluated as a sequence of binary operations: | |||
<ref>[https://twitter.com/christianp/status/1046721351288000512 Tweet by Christian Lawson-Perfect]</ref> | \[ a \cdot b \cdot c = (a \cdot b) \cdot c \] | ||
That isn't usually the case when terms are joined with relation symbols<ref>[https://twitter.com/ZenoRogue/status/798923050842324992 Tweet by ZenoRogue]</ref><ref>[https://twitter.com/christianp/status/1046721351288000512 Tweet by Christian Lawson-Perfect]</ref>: | |||
<blockquote> | |||
Let \(a=1\), \(b=2\), \(c=3\). | |||
\( (a \lt b) \lt c = \text{True} \lt c \) | |||
</blockquote> | |||
It doesn't make sense to evaluate this as a sequence of binary operations. Instead, a chain of \(n\) relations could be interpreted as a set of \(n\) statements: | |||
\[ a \lt b \lt c \iff (a \lt b) \wedge (b \lt c) \] |
Revision as of 14:22, 14 July 2021
When you have several terms with operators in between, some kind of associativity is normally implied, so that the expression can be evaluated as a sequence of binary operations:
\[ a \cdot b \cdot c = (a \cdot b) \cdot c \]
That isn't usually the case when terms are joined with relation symbols[1][2]:
Let \(a=1\), \(b=2\), \(c=3\).
\( (a \lt b) \lt c = \text{True} \lt c \)
It doesn't make sense to evaluate this as a sequence of binary operations. Instead, a chain of \(n\) relations could be interpreted as a set of \(n\) statements:
\[ a \lt b \lt c \iff (a \lt b) \wedge (b \lt c) \]