Total array ordering: Difference between revisions

Jump to navigation Jump to search
1,791 bytes added ,  20:55, 24 November 2020
We don't know if this is the reason NARS2000 excludes them.
Miraheze>Marshall
(Created page with "In APL, a '''total array ordering''', or '''TAO''', is an ordering on all arrays which is used by Grade and Interval Index. Traditionally ordering is defined only...")
 
(We don't know if this is the reason NARS2000 excludes them.)
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In APL, a '''total array ordering''', or '''TAO''', is an [[ordering]] on all arrays which is used by [[Grade]] and [[Interval Index]]. Traditionally ordering is defined only for [[simple]] arrays of the same [[shape]], so TAO refers to the extension to [[Nested array|nested]] or [[Box|boxed]] arrays of arbitrary [[shape]] and [[rank]]. While [[J]] has had such an ordering since an early version, total array ordering in APL was first seen in [[Dyalog APL 17.0]].
In APL, a '''total array ordering''', or '''TAO''', is an [[ordering]] on all arrays which is used primarily by [[Grade]] and [[Interval Index]], but optionally also by the [[comparison function]]s. Traditionally ordering is defined only for [[simple]] arrays of the same [[shape]] and [[type]], so ''TAO'' refers to the extension to [[Nested array|nested]] or [[box]]ed arrays of arbitrary [[rank]], shape, and type.


Dyalog's ordering is not a true total order because it does not handle arrays containing [[simple scalars]] other than [[numbers]] or [[characters]], such as [[namespaces]] or [[objects]]. [[Roger Hui]] has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering.
[[J]] has had such an ordering since 1996 (release 3.01). [[Dyalog APL]] added a total array ordering with [[Dyalog APL 17.0|version 17.0]]. Both of these are based on a [[wikipedia:lexicographic order|lexicographic order]]ing.<ref>[[Roger Hui|Hui, R.]]. [https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J].</ref><ref>Hui, R. and [[Morten Kromberg|M. Kromberg]]. [https://dl.acm.org/doi/abs/10.1145/3386319 ''APL since 1978'']. ACM HOPL IV. 2020-06.</ref> [[GNU APL]] and [[NARS2000]] also implement total ordering, but based on [[wikipedia:shortlex order|shortlex order]]ing instead, comparing first [[rank]], then [[shape]], then [[type]], and finally value.


The name "total array ordering" is taken partly from the mathematical concept of a [https://en.wikipedia.org/wiki/Total_order total order], which must order any two elements, with elements ordering equally only if they are identical. This concept is transferred to APL by specifying that arrays should only order equally if they [[match]].
The name ''total array ordering'' is taken partly from the mathematical concept of a [[wikipedia:total order|total order]], which must order any two elements, with elements ordering equally only if they are identical. This concept is transferred to APL by specifying that arrays should only order equally if they [[match]].
== Exceptions from the ordering ==
Some dialects do not implement a true ''total'' order because they support arrays without defining an order for them.


== External links ==
Dyalog APL excludes [[simple scalar]]s other than nulls, [[number]]s or [[character]]s (namely [[namespace]]s, [[object]]s, and [[object representation]]s), because ordering those was considered "contentious but of little incremental benefit."<ref name=bfh>[[Adám Brudzewsky|Brudzewsky, A.]], [[Jay Foad|J. Foad]], and R. Hui. [https://www.jsoftware.com/papers/TAOaxioms.htm TAO Axioms]. 2018-02-02.</ref> [[Roger Hui]] has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering. However, the [[dfns workspace]] includes an APL model which is truly total, though it differs from the native implementation in ordering characters before numbers instead of the opposite.<ref>[[Dfns workspace]]. [http://dfns.dyalog.com/n_le.htm <source lang=apl inline>le</source>] ― Total array ordering (TAO) comparison.</ref>


[https://www.jsoftware.com/papers/TAOaxioms.htm TAO Axioms] for [[Dyalog APL]]
NARS2000's  excludes [[complex number]]s (including quaternions and octonions) from the ordering. It should be noted that these numbers do not belong to any [[wikipedia:ordered field|ordered field]]: any ordering that remains the same after adding a constant could not be compatible with multiplication in the sense that the product of any two numbers greater than zero is greater than zero.<ref name=bfh/>


[http://dfns.dyalog.com/n_le.htm n_le], a [[dfn]] implementation of a total array ordering
== Documentation ==
* [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Grade%20Up%20Monadic.htm Dyalog APL]
* [https://code.jsoftware.com/wiki/Vocabulary/slashco#Details J]
* [https://www.gnu.org/software/apl/apl.html#Section-3_002e4 GNU APL]


[https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J]
== References ==
<references/>
 
{{APL features}}[[Category:Paradigms]]

Navigation menu