Frame agreement: Difference between revisions
Jump to navigation
Jump to search
(Create page to disambiguate between general frame agreement and prefix agreement for scalars) |
m (Link fixes) |
||
Line 1: | Line 1: | ||
'''Frame agreement''' is a [[conformability]] rule designed for [[leading axis theory]] and used by [[J]]. It states that a [[dyadic]] [[function]] can be applied between two [[array]]s only if one of their [[ | '''Frame agreement''' is a [[conformability]] rule designed for [[leading axis theory]] and used by [[J]]. It states that a [[dyadic]] [[function]] can be applied between two [[array]]s only if one of their [[frame]]s relative to the cells of the function's corresponding dyadic rank. is a [[prefix]] of the other. The shape of the result is that of the [[argument]] with longer frame. | ||
<syntaxhighlight lang=j inline>rf</syntaxhighlight> | <syntaxhighlight lang=j inline>rf</syntaxhighlight> | ||
Line 80: | Line 80: | ||
{{Works in|[[J]]}} | {{Works in|[[J]]}} | ||
In the example above, based on the ranks <syntaxhighlight lang=j inline>0 1</syntaxhighlight> of the verb <syntaxhighlight lang=j inline>+"0 1</syntaxhighlight>, <syntaxhighlight lang=j inline>a</syntaxhighlight>'s frame is <syntaxhighlight lang=j inline>,2</syntaxhighlight> and its cell shape is [ | In the example above, based on the ranks <syntaxhighlight lang=j inline>0 1</syntaxhighlight> of the verb <syntaxhighlight lang=j inline>+"0 1</syntaxhighlight>, <syntaxhighlight lang=j inline>a</syntaxhighlight>'s frame is <syntaxhighlight lang=j inline>,2</syntaxhighlight> and its cell shape is [[empty array|empty]] (<syntaxhighlight lang=j inline>0$0</syntaxhighlight>); b's frame is <syntaxhighlight lang=j inline>2 3</syntaxhighlight> and its cell shape is <syntaxhighlight lang=j inline>,2</syntaxhighlight>. The shorter of these, and thus the common frame, is <syntaxhighlight lang=j inline>,2</syntaxhighlight>, so each of the two <syntaxhighlight lang=j inline>0$0</syntaxhighlight>-shaped cells (atoms) of <syntaxhighlight lang=j inline>a</syntaxhighlight> is paired with each of the corresponding <syntaxhighlight lang=j inline>6</syntaxhighlight> (i.e. <syntaxhighlight lang=j inline>*/sf</syntaxhighlight>) corresponding <syntaxhighlight lang=j inline>b</syntaxhighlight> cells. | ||
[[Category:Leading axis theory]][[Category:Function characteristics]][[Category:Conformability]]{{APL features}} | [[Category:Leading axis theory]][[Category:Function characteristics]][[Category:Conformability]]{{APL features}} |