Frame agreement: Difference between revisions

Jump to navigation Jump to search
40 bytes removed ,  18:09, 7 July 2023
m
Introduction rewording, and formatting fixes
m (Align comments)
m (Introduction rewording, and formatting 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]]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.
'''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, with frame length based on the function's dyadic [[function rank]], is a [[prefix]] of the other. The leading shape of the result is that of the [[argument]] with longer frame.
 
<syntaxhighlight lang=j inline>rf</syntaxhighlight>


== Description ==
== Description ==
A dyadic function <syntaxhighlight lang=j inline>f</syntaxhighlight> with left and right ranks <syntaxhighlight lang=j inline>lr</syntaxhighlight> and <syntaxhighlight lang=j inline>rr</syntaxhighlight>, respectively, splits its left argument <syntaxhighlight lang=j inline>x</syntaxhighlight> into <syntaxhighlight lang=j inline>lf</syntaxhighlight>-cells, and splits its right argument <syntaxhighlight lang=j inline>y</syntaxhighlight> into <syntaxhighlight lang=j inline>rf</syntaxhighlight>-cells. Each argument's shape is thus split into a frame and a cell shape. Given that one frame must be a prefix of the other, the prefix (i.e. shorter) frame is called the common frame (denoted here as <syntaxhighlight lang=j inline>cf</syntaxhighlight>), and the suffix of the longer frame relative to the common frame is called the surplus frame (denoted here as <syntaxhighlight lang=j inline>sf</syntaxhighlight>. "Cells" will be used here to denote the <syntaxhighlight lang=j inline>lr</syntaxhighlight>-cells (for the left argument <syntaxhighlight lang=j inline>a</syntaxhighlight>) or the <syntaxhighlight lang=j inline>rr</syntaxhighlight>-cells (for the right argument <syntaxhighlight lang=j inline>b</syntaxhighlight>). If the frames are identical, each cell of <syntaxhighlight lang=j inline>x</syntaxhighlight> is paired with the corresponding cell of <syntaxhighlight lang=j inline>y</syntaxhighlight> in a 1-to-1 pairing. For the case in which the frame lengths differ, we'll denote the shorter-framed argument as <syntaxhighlight lang=j inline>sa</syntaxhighlight> and the longer-framed argument as <syntaxhighlight lang=j inline>la</syntaxhighlight>. Each cell of <syntaxhighlight lang=j inline>sa</syntaxhighlight> is paired with each among the corresponding group of <syntaxhighlight lang=j inline>*/sf</syntaxhighlight> cells of <syntaxhighlight lang=j inline>la</syntaxhighlight>. The collective results among all applications of <syntaxhighlight lang=j inline>f</syntaxhighlight> are framed by the longer frame <syntaxhighlight lang=j inline>lf</syntaxhighlight>.
A dyadic function <syntaxhighlight lang=j inline>f</syntaxhighlight> with left and right ranks <syntaxhighlight lang=j inline>lr</syntaxhighlight> and <syntaxhighlight lang=j inline>rr</syntaxhighlight>, respectively, splits its left argument <syntaxhighlight lang=j inline>x</syntaxhighlight> into <syntaxhighlight lang=j inline>lf</syntaxhighlight>-[[cell]]s, and splits its right argument <syntaxhighlight lang=j inline>y</syntaxhighlight> into <syntaxhighlight lang=j inline>rf</syntaxhighlight>-cells. Each argument's shape is thus split into a frame and a cell shape. Given that one frame must be a prefix of the other, the prefix (i.e. shorter) frame is called the common frame (denoted here as <syntaxhighlight lang=j inline>cf</syntaxhighlight>), and the suffix of the longer frame relative to the common frame is called the surplus frame (denoted here as <syntaxhighlight lang=j inline>sf</syntaxhighlight>. "Cells" will be used here to denote the <syntaxhighlight lang=j inline>lr</syntaxhighlight>-cells (for the left argument <syntaxhighlight lang=j inline>a</syntaxhighlight>) or the <syntaxhighlight lang=j inline>rr</syntaxhighlight>-cells (for the right argument <syntaxhighlight lang=j inline>b</syntaxhighlight>). If the frames are identical, each cell of <syntaxhighlight lang=j inline>x</syntaxhighlight> is paired with the corresponding cell of <syntaxhighlight lang=j inline>y</syntaxhighlight> in a 1-to-1 pairing. For the case in which the frame lengths differ, we'll denote the shorter-framed argument as <syntaxhighlight lang=j inline>sa</syntaxhighlight> and the longer-framed argument as <syntaxhighlight lang=j inline>la</syntaxhighlight>. Each cell of <syntaxhighlight lang=j inline>sa</syntaxhighlight> is paired with each among the corresponding group of <syntaxhighlight lang=j inline>*/sf</syntaxhighlight> cells of <syntaxhighlight lang=j inline>la</syntaxhighlight>. The collective results among all applications of <syntaxhighlight lang=j inline>f</syntaxhighlight> are framed by the longer frame <syntaxhighlight lang=j inline>lf</syntaxhighlight>.
 


== Examples ==
== Examples ==

Navigation menu