SAX: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Miraheze>Adám Brudzewsky
(Redirected page to SHARP APL)
 
Miraheze>Adám Brudzewsky
(Removed redirect to SHARP APL)
Line 1: Line 1:
#REDIRECT [[SHARP APL]]
{{Infobox array language
| array model              = [[Flat array model|flat]] with [[Box|boxes]]
| index origin            = 0 or 1
| function styles          = [[defined functions]], some [[tacit]] capabilities
| numeric types            = 64-bit float
| unicode support          = none
| released                = 1993
| withdrawn                = around 2017
| latest release          = 6.0 / 2000
| platforms                = S/390, x86
| operating systems        = UNIX (AIX, Solaris), Linux
| license                  = Free for personal use / Proprietary commercial software
| developer                = [[Soliton Associates]]
| influenced by            = [[APL*PLUS]]
| influenced              = [[J]], [[A+]], [[K]], [[Dyalog APL]]
| documentation            = [http://twinkfed.homedns.org/UsrDoc/sax/SAX6_Doc.pdf PDF]
| file ext                = .sw, .sf
}}
'''SAX''' ('''S'''HARP '''A'''PL for UNI'''X''') was a version of [[SHARP APL]] offered by [[Soliton Associates]]. Notable features of SAX include [[function rank]], the [[Rank operator]], and [[leading axis theory]], as well as relative [[comparison tolerance]] and [[close composition]] operators including [[Under]].
 
== Primitive functions ==
 
=== Arithmetic ===
 
==== Scalar ====
 
All scalar functions have rank zero.
 
{| class=wikitable
! Glyph                              !! Monadic                !! Dyadic
|-
| <source lang=apl inline>+</source> || [[Conjugate]]/Identity || [[Addition]]
|-
| <source lang=apl inline>-</source> || [[Negate]]            || [[Subtraction]]
|-
| <source lang=apl inline>×</source> || [[Signum]]            || [[Multiplication]]
|-
| <source lang=apl inline>÷</source> || [[Reciprocal]]        || [[Division]]
|-
| <source lang=apl inline>*</source> || [[Exponential]]        || [[Power function|Power]]
|-
| <source lang=apl inline>⍟</source> || [[Natural Logarithm]]  || [[Logarithm|Base-⍺ Logarithm]]
|-
| <source lang=apl inline>|</source> || [[Magnitude]]          || [[Residue]]
|-
| <source lang=apl inline>!</source> || [[Factorial]]          || Out-Of/[[Combinations]]
|-
| <source lang=apl inline>⌊</source> || [[Floor]]              || [[Minimum]]
|-
| <source lang=apl inline>⌈</source> || [[Ceiling]]            || [[Maximum]]
|-
| <source lang=apl inline>○</source> || [[Pi Times]]          || [[Circle functions]]
|-
| <source lang=apl inline>∧</source> ||                        || [[And]]/Least Common Multiple (LCM)
|-
| <source lang=apl inline>∨</source> ||                        || [[Or]]/Greatest Common Divisor (GCD)
|-
| <source lang=apl inline>⍲</source> ||                        || [[Nand]]
|-
| <source lang=apl inline>⍱</source> ||                        || [[Nor]]
|-
| <source lang=apl inline>~</source> || [[Not]]                || See [[#Miscellaneous|Miscellaneous]]
|-
| <source lang=apl inline>?</source> || [[Roll]]              || See [[#Non-Scalar|Non-scalar]]
|}
 
==== Non-scalar ====
 
{| class=wikitable
! Glyph                          !! Rank !! Monadic              !! Ranks !! Dyadic
|-
| <source lang=apl inline>⌹</source> || 2 || [[Matrix inverse]]    || ∞ 2 || [[Matrix divide]]
|-
| <source lang=apl inline>?</source> ||  || See [[#Scalar|Scalar]] || * * || [[Deal]]
|-
| <source lang=apl inline>⊤</source> ||  ||                        || ∞ ∞ || [[Encode]]
|-
| <source lang=apl inline>⊥</source> ||  ||                        || ∞ ∞ || [[Decode]]
|}
 
=== Relational ===
 
{| class=wikitable
! Glyph                          !! Rank !! Monadic                            !! Ranks !! Dyadic
|-
| <source lang=apl inline>=</source> ||  || See [[#Miscellaneous|Miscellaneous]] || 0 0 || [[Equals]]
|-
| <source lang=apl inline>≠</source> ||  || See [[#Miscellaneous|Miscellaneous]] || 0 0 || [[Not Equals]]
|-
| <source lang=apl inline><</source> ||  || See [[#Structural|Structural]]      || 0 0 || [[Less Than]]
|-
| <source lang=apl inline>≤</source> ||  ||                                      || 0 0 || [[Less Than or Equal]]
|-
| <source lang=apl inline>≥</source> ||  ||                                      || 0 0 || [[Greater Than or Equal]]
|-
| <source lang=apl inline>></source> ||  || See [[#Structural|Structural]]      || 0 0 || [[Greater Than]]
|-
| <source lang=apl inline>≡</source> ||  ||                                      || ∞ ∞ || [[Match]]
|-
| <source lang=apl inline>∊</source> ||  ||                                      || 0 ∞ || [[Membership]]
|-
| <source lang=apl inline>⍷</source> ||  ||                                      || ∞ ∞ || [[Find]]
|}
 
=== Indexing ===
 
{| class=wikitable
! Glyph                          !! Rank !! Monadic                            !! Ranks !! Dyadic
|-
| <source lang=apl inline>@</source> ||  || See [[#Miscellaneous|Miscellaneous]] || 0 ∞ || [[Squad Index|From]]
|-
| <source lang=apl inline>⍳</source> || 1 || [[Iota|Count]]                      || 1 0 || [[Index Of]]
|-
| <source lang=apl inline>⍸</source> ||  ||                                      || ∞ ∞ || [[Indices of Match|Index]]
|-
| <source lang=apl inline>⍋</source> || ∞ || Numeric [[Grade up]]                || ∞ ∞ || Character [[Grade up]]
|-
| <source lang=apl inline>⍒</source> || ∞ || Numeric [[Grade down]]              || ∞ ∞ || Character [[Grade down]]
|}
 
=== Structural ===
 
{| class=wikitable
! Glyph                          !! Rank !! Monadic                                !! Ranks !! Dyadic
|-
| <source lang=apl inline>⍴</source> || ∞ || [[Shape|Shape of]]                        || 1 ∞ || [[Reshape]]
|-
| <source lang=apl inline>↑</source> ||  || See [[#Miscellaneous|Miscellaneous]]      || 1 ∞ || [[Take]]
|-
| <source lang=apl inline>↓</source> || ∞ || [[Raze]]                                  || 1 ∞ || [[Drop]]
|-
| <source lang=apl inline><</source> || ∞ || [[Enclose]]/Box                          ||    || See [[#Relational|Relational]]
|-
| <source lang=apl inline>⊃</source> || ∞ || [[Enclose if simple|Conditional Enclose]] || ∞ ∞ || [[Link]]
|-
| <source lang=apl inline>></source> || 0 || [[Disclose]]/Open                        ||    || See [[#Relational|Relational]]
|-
| <source lang=apl inline>,</source> || ∞ || [[Ravel]]                                || ∞ ∞ || [[Catenate]]
|-
| <source lang=apl inline>⍪</source> || ∞ || [[Table]]                                || ∞ ∞ || [[Catenate First|Catenate-Down]]
|-
| <source lang=apl inline>⌽</source> || 1 || [[Reverse]]                              || 0 1 || [[Rotate]]
|-
| <source lang=apl inline>⊖</source> || ∞ || [[Reverse First|Reverse-Down]]            || ∞ ∞ || [[Rotate First|Rotate-Down]]
|-
| <source lang=apl inline>⍉</source> || ∞ || Monadic [[Transpose]]                    || 0 ∞ || Dyadic [[Transpose]]
|}
 
=== Miscellaneous ===
 
{| class=wikitable
! Glyph                          !! Rank !! Monadic                !! Ranks !! Dyadic
|-
| <source lang=apl inline>⊣</source> || ∞ || [[Stop]]                  || ∞ ∞ || [[Left Identity|Left]]
|-
| <source lang=apl inline>⊢</source> || ∞ || [[Identity|Pass]]        || ∞ ∞ || [[Right Identity|Right]]
|-
| <source lang=apl inline>≠</source> || ∞ || [[Nubsieve]]              ||    || See [[#Relational|Relational]]
|-
| <source lang=apl inline>↑</source> || ∞ || [[Nub]]                  ||    || See [[#Structural|Structural]]
|-
| <source lang=apl inline>=</source> || ∞ || [[Nubin]]                ||    || See [[#Relational|Relational]]
|-
| <source lang=apl inline>~</source> ||  || See [[#Scalar|Scalar]]    || ∞ ∞ || [[Without|Less]]
|-
| <source lang=apl inline>@</source> || 1 || [[Cartesian Product|All]] ||    || See [[#Indexing|Indexing]]
|-
| <source lang=apl inline>⍕</source> || ∞ || [[Monadic Format]]        || * ∞ || [[Dyadic Format]]
|-
| <source lang=apl inline>⍎</source> || * || [[Execute]]              ||    ||
|}
 
== Primitive Operators ==
 
{| class=wikitable
! Glyph !!colspan=2|Operands !!colspan=2|Ranks !! Monadic Call  !! Dyadic Call
|-
| <source lang=apl inline>/</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  ||                                        || [[Reduce]]                      ||
|-
| <source lang=apl inline>⌿</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  ||                                        || [[Reduce First|Reduce-down]]    ||
|-
| <source lang=apl inline>\</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  ||                                        || [[Scan]]                        ||
|-
| <source lang=apl inline>⍀</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  ||                                        || [[Scan First|Scan-down]]        ||
|-
| <source lang=apl inline>/</source> ||                                    || <source lang=apl inline>m</source> || <source lang=apl inline>∞</source>  ||                                        || [[Replicate|Copy]]/[[Compress]] ||
|-
| <source lang=apl inline>⌿</source> ||                                    || <source lang=apl inline>m</source> || <source lang=apl inline>∞</source>  ||                                        || [[Replicate|Copy]]-down/[[Compress]]-down ||
|-
| <source lang=apl inline>\</source> ||                                    || <source lang=apl inline>m</source> || <source lang=apl inline>∞</source>  ||                                        || [[Expand]]                      ||
|-
| <source lang=apl inline>⍀</source> ||                                    || <source lang=apl inline>m</source> || <source lang=apl inline>∞</source>  ||                                        || [[Expand First|Expand-down]]    ||
|-
| <source lang=apl inline>⊂</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  || <source lang=apl inline>rf lf</source> ||colspan=2| Swap
|-
| <source lang=apl inline>&</source> ||                                    || <source lang=apl inline>f</source> || <source lang=apl inline>∞</source>  || <source lang=apl inline>∞  ∞</source>  ||colspan=2| Select
|-
| <source lang=apl inline>⍤</source> || <source lang=apl inline>f</source> || <source lang=apl inline>g</source> || <source lang=apl inline>mg</source> || <source lang=apl inline>mg mg</source> ||colspan=2| On ([[close Over]])
|-
| <source lang=apl inline>⍤</source> || <source lang=apl inline>f</source> || <source lang=apl inline>n</source> || <source lang=apl inline>n</source>  || <source lang=apl inline>n  n</source>  ||colspan=2| [[Rank operator|Rank]]
|-
| <source lang=apl inline>⍤</source> || <source lang=apl inline>m</source> || <source lang=apl inline>g</source> || <source lang=apl inline>mg</source> || <source lang=apl inline>mg mg</source> ||colspan=2| [[Cut operator|Cut]]
|-
| <source lang=apl inline>⍥</source> || <source lang=apl inline>f</source> || <source lang=apl inline>g</source> || <source lang=apl inline>mg</source> || <source lang=apl inline>mg mg</source> ||colspan=2| Upon ([[close Atop]])
|-
| <source lang=apl inline>¨</source> || <source lang=apl inline>f</source> || <source lang=apl inline>g</source> || <source lang=apl inline>mg</source> || <source lang=apl inline>mg mg</source> ||colspan=2| [[close Under|Under]]
|-
| <source lang=apl inline>¨</source> || <source lang=apl inline>m</source> || <source lang=apl inline>g</source> || <source lang=apl inline>mg</source> ||                                        ||rowspan="2"|With ([[Bind]])    ||
|-
| <source lang=apl inline>¨</source> || <source lang=apl inline>f</source> || <source lang=apl inline>n</source> || <source lang=apl inline>mf</source> ||                                        ||
|-
| <source lang=apl inline>.</source> || <source lang=apl inline>f</source> || <source lang=apl inline>g</source> || <source lang=apl inline>2</source>  || <source lang=apl inline>∞  ∞</source>  || [[Alternant]]                  || [[Inner Product|Inner-product]]
|-
| <source lang=apl inline>.</source> || <source lang=apl inline>m</source> || <source lang=apl inline>g</source> ||                                    || <source lang=apl inline>∞  ∞</source>  ||                                || [[Tie]], [[Outer Product|Outer-product]]
|-
| <source lang=apl inline>.</source> || <source lang=apl inline>f</source> || <source lang=apl inline>m</source> || <source lang=apl inline>mf</source> ||                                        || [[Ply]]                        ||
|}
 
== Implementation ==
 
=== Numeric types ===
 
SHARP originally supported only real numbers using double (8-byte) precision. Numbers were stored in one of three types:
* Boolean, with one bit per value
* Integer, with four bytes per value
* Floating, with eight bytes per value
 
[https://www.jsoftware.com/papers/satn40.htm SATN-40] describes the addition of complex numbers to SHARP APL.
 
== External links ==
 
[https://en.wikipedia.org/wiki/I._P._Sharp_Associates Wikipedia]
 
{{APL programming language}}

Revision as of 08:04, 13 November 2019

SAX (SHARP APL for UNIX) was a version of SHARP APL offered by Soliton Associates. Notable features of SAX include function rank, the Rank operator, and leading axis theory, as well as relative comparison tolerance and close composition operators including Under.

Primitive functions

Arithmetic

Scalar

All scalar functions have rank zero.

Glyph Monadic Dyadic
+ Conjugate/Identity Addition
- Negate Subtraction
× Signum Multiplication
÷ Reciprocal Division
* Exponential Power
Natural Logarithm Base-⍺ Logarithm
| Magnitude Residue
! Factorial Out-Of/Combinations
Floor Minimum
Ceiling Maximum
Pi Times Circle functions
And/Least Common Multiple (LCM)
Or/Greatest Common Divisor (GCD)
Nand
Nor
~ Not See Miscellaneous
? Roll See Non-scalar

Non-scalar

Glyph Rank Monadic Ranks Dyadic
2 Matrix inverse ∞ 2 Matrix divide
? See Scalar * * Deal
∞ ∞ Encode
∞ ∞ Decode

Relational

Glyph Rank Monadic Ranks Dyadic
= See Miscellaneous 0 0 Equals
See Miscellaneous 0 0 Not Equals
< See Structural 0 0 Less Than
0 0 Less Than or Equal
0 0 Greater Than or Equal
> See Structural 0 0 Greater Than
∞ ∞ Match
0 ∞ Membership
∞ ∞ Find

Indexing

Glyph Rank Monadic Ranks Dyadic
@ See Miscellaneous 0 ∞ From
1 Count 1 0 Index Of
∞ ∞ Index
Numeric Grade up ∞ ∞ Character Grade up
Numeric Grade down ∞ ∞ Character Grade down

Structural

Glyph Rank Monadic Ranks Dyadic
Shape of 1 ∞ Reshape
See Miscellaneous 1 ∞ Take
Raze 1 ∞ Drop
< Enclose/Box See Relational
Conditional Enclose ∞ ∞ Link
> 0 Disclose/Open See Relational
, Ravel ∞ ∞ Catenate
Table ∞ ∞ Catenate-Down
1 Reverse 0 1 Rotate
Reverse-Down ∞ ∞ Rotate-Down
Monadic Transpose 0 ∞ Dyadic Transpose

Miscellaneous

Glyph Rank Monadic Ranks Dyadic
Stop ∞ ∞ Left
Pass ∞ ∞ Right
Nubsieve See Relational
Nub See Structural
= Nubin See Relational
~ See Scalar ∞ ∞ Less
@ 1 All See Indexing
Monadic Format * ∞ Dyadic Format
* Execute

Primitive Operators

Glyph Operands Ranks Monadic Call Dyadic Call
/ f Reduce
f Reduce-down
\ f Scan
f Scan-down
/ m Copy/Compress
m Copy-down/Compress-down
\ m Expand
m Expand-down
f rf lf Swap
& f ∞ ∞ Select
f g mg mg mg On (close Over)
f n n n n Rank
m g mg mg mg Cut
f g mg mg mg Upon (close Atop)
¨ f g mg mg mg Under
¨ m g mg With (Bind)
¨ f n mf
. f g 2 ∞ ∞ Alternant Inner-product
. m g ∞ ∞ Tie, Outer-product
. f m mf Ply

Implementation

Numeric types

SHARP originally supported only real numbers using double (8-byte) precision. Numbers were stored in one of three types:

  • Boolean, with one bit per value
  • Integer, with four bytes per value
  • Floating, with eight bytes per value

SATN-40 describes the addition of complex numbers to SHARP APL.

External links

Wikipedia

Template:APL programming language