Total array ordering: Difference between revisions
m (Paradigms category) |
No edit summary |
||
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]]ed arrays of arbitrary | 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. | ||
[[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. [[GNU APL]] and [[NARS2000] also implement total ordering, but based on [[wikipedia:shortlex order]]ing instead. | |||
The name | Dyalog's ordering is not a true ''total'' order because it does not handle arrays containing [[simple scalar]]s other than nulls, [[number]]s or [[character]]s, namely [[namespace]]s and [[object]]s. [[Roger Hui]] has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering. | ||
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]]. | |||
== 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] | |||
== External links == | == External links == | ||
[https://www.jsoftware.com/papers/TAOaxioms.htm TAO Axioms] for [[Dyalog APL]] | * [https://www.jsoftware.com/papers/TAOaxioms.htm TAO Axioms] for [[Dyalog APL]] | ||
[http://dfns.dyalog.com/n_le.htm n_le], a [[dfn]] implementation of a total array ordering | * [http://dfns.dyalog.com/n_le.htm n_le], a [[dfn]] implementation of a total array ordering | ||
[https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J] | * [https://code.jsoftware.com/wiki/Essays/The_TAO_of_J The TAO of J] | ||
{{APL features}}[[Category:Paradigms]] | {{APL features}}[[Category:Paradigms]] |
Revision as of 10:24, 22 November 2020
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 functions. Traditionally ordering is defined only for simple arrays of the same shape and type, so TAO refers to the extension to nested or boxed arrays of arbitrary rank, shape, and type.
J has had such an ordering since 1996 (release 3.01). Dyalog APL added a total array ordering with version 17.0. Both of these are based on a lexicographic ordering. GNU APL and [[NARS2000] also implement total ordering, but based on wikipedia:shortlex ordering instead.
Dyalog's ordering is not a true total order because it does not handle arrays containing simple scalars other than nulls, numbers or characters, namely namespaces and objects. Roger Hui has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering.
The name total array ordering is taken partly from the mathematical concept of a 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.
Documentation
External links
- TAO Axioms for Dyalog APL
APL features [edit] | |
---|---|
Built-ins | Primitives (functions, operators) ∙ Quad name |
Array model | Shape ∙ Rank ∙ Depth ∙ Bound ∙ Index (Indexing) ∙ Axis ∙ Ravel ∙ Ravel order ∙ Element ∙ Scalar ∙ Vector ∙ Matrix ∙ Simple scalar ∙ Simple array ∙ Nested array ∙ Cell ∙ Major cell ∙ Subarray ∙ Empty array ∙ Prototype |
Data types | Number (Boolean, Complex number) ∙ Character (String) ∙ Box ∙ Namespace ∙ Function array |
Concepts and paradigms | Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity element ∙ Complex floor ∙ Array ordering (Total) ∙ Tacit programming (Function composition, Close composition) ∙ Glyph ∙ Leading axis theory ∙ Major cell search ∙ First-class function |
Errors | LIMIT ERROR ∙ RANK ERROR ∙ SYNTAX ERROR ∙ DOMAIN ERROR ∙ LENGTH ERROR ∙ INDEX ERROR ∙ VALUE ERROR ∙ EVOLUTION ERROR |