Mathematical Editing Operator Reference

This section provides a reference for the editing behavior of different classes of mathematical operators and how you will interact with Zed when using these operators.


Associative Operators
Nary Operators
Array Operators

Mathematical operators represent a wide variety of styles of presentation, and so require a wide variety of conventions for two-dimensional input of mathematical expressions. The paragraphs that follow summarize groups of operations that work together to support the wide variety of input conventions needed for convenient two-dimensional input using these operators.

Different classes of operators supported by Zed include associative operators, which require operations for inserting and removing parentheses, nary operators, which require operations for inserting and removing additional arguments, and array operators, which require operations for inserting, removing, and navigating rows and columns.


Associative Operators

Associate Flatten
Associate Left
Associate Right
Associate Head
Associate Tail
Associate Insert
Associate Delete

An associative operator is one which can accept any number of child elements, and for which parentheses can be inserted and removed without changing the meaning of the expression. An operator in Zed can be declared as associative using the Bindings configuration dialog.

By default, the following elements are declared as associative:

<and>, <compose>, <or>, <plus>, <times>, <xor>

Other operators can be declared associative as appropriate.

The special operations that apply to associative operators all operate to either insert or remove levels of parentheses from an expression. The first three operate to reassociate an expression to a particular normalized form, while the rest are all more incremental operations that insert or remove one set of parentheses at a time.


Associate Flatten

This operation normalizes a tree of expressions involving an associative operator to remove all parentheses from the expression. This operation can be applied to the current expression by typing the Ctrl+Shift+Up key.


Associate Left

This operation normalizes a tree of expressions involving an associative operator to completely left associate the expression. This operation can be applied to the current expression by typing the Ctrl+Shift+Left key.


Associate Right

This operation normalizes a tree of expressions involving an associative operator to completely right associate the expression. This operation can be applied to the current expression by typing the Ctrl+Shift+Right key.


Associate Head

This operation inserts parentheses from the beginning of the parent element of the current expression to the current expression, with the effect that the first few child elements of the parent element of the current expression become the child elements of a new application of the associative operator This operation can be invoked by typing the Ctrl+) key in suffix input context.


Associate Tail

This operation inserts parentheses from the end of the parent element of the current expression to the current expression, with the effect that the last few child elements of the parent element of the current expression become the child elements of a new application of the associative operator This operation can be invoked by typing the Ctrl+( key in prefix input context.


Associate Insert

This operation inserts parentheses around the child elements contained in the extended selection, with the effect that those child elements become the child elements of a new application of the associative operator. This operation can be invoked by typing the Shift+Down key.


Associate Delete

This operation removes parentheses around the current expression when its parent element is an application of the same associative operator, with the effect that the child elements of the current expression become child elements of the parent element. This operation can be invoked by typing the Shift+Up key.


Nary Operators

Nary Insert Left
Nary Insert Right
Nary Delete Left
Nary Delete Right

An nary operator is one which can accept any number of child elements, or one which can accept optional qualifier elements, and for which additional arguments can be inserted and removed to further elaborate the content of the expression. An operator in Zed can be declared as an nary operator using the Bindings configuration dialog.

By default, the following elements are declared as an nary operator:

<and>, <apply>, <approx>, <cartesianproduct>, <compose>, <diff>, <eq>, <equivalent>, <exists>, <forall>, <gcd>, <geq>, <gt>, <int>, <intersect>, <lambda>, <lcm>, <leq>, <list>, <log>, <lt>, <max>, <mean>, <median>, <min>, <minus>, <mode>, <moment>, <neq>, <or>, <partialdiff>, <piecewise>, <plus>, <product>, <prsubset>, <root>, <sdev>, <select>, <selector>, <semantics>, <set>, <subset>, <sum>, <times>, <union>, <var>, <variance>, <vector>, <xor>

Other operators can be declared as nary operators as appropriate.

The special operations that apply to nary operators all operate to insert or remove child elements of the parent element of the current expression. The first two operate to insert a new placeholder element, while the last two operate to replace an expression with a placeholder element. These operations combine to provide a smooth sequence of insertion/deletion operations for nary operators.


Nary Insert Left

This operation inserts a new placeholder element to the left of the current expression, leaving the expression cursor on the new placeholder element. This operation can be invoked by typing the Insert key.


Nary Insert Right

This operation inserts a new placeholder element to the right of the current expression, leaving the expression cursor on the new placeholder element. This operation can be invoked by typing the , key.


Nary Delete Left

This operation first replaces the current expression with a new placeholder element, without moving the expression cursor, then removes the placeholder element, if repeated, moving the expression cursor to the expression to the left. This operation can be invoked by typing the Backspace key.


Nary Delete Right

This operation first replaces the current expression with a new placeholder element, without moving the expression cursor, then removes the placeholder element, if repeated, moving the expression cursor to the expression to the right. This operation can be invoked by typing the Backspace key.


Array Operators

Array Insert Column Left
Array Insert Column Right
Array Delete Column Left
Array Delete Column Right
Array Insert Row Left
Array Insert Row Right
Array Delete Row Left
Array Delete Row Right
Array Up
Array Down
Array Left
Array Right

An array operator is one which can accept any number of child elements, which are presented in a two-dimensional layout. Additional arguments for an array operator are inserted and removed by inserting and removing rows and columns of the array expression. An operator in Zed can be declared as an array operator using the Bindings configuration dialog.

By default, only the <matrix> elements is declared as an array operator. Other operators can be declared as array operators as appropriate.

The special operations that apply to array operators operate to insert or remove rows or columns of the array, or to navigate to other child elements of the array.


Array Insert Column Left

This operation inserts a new column to the left of the column containing the current expression, moving the expression cursor to the new element in the same row as the current expression. This operation can be invoked by typing the Insert key.


Array Insert Column Right

This operation works to add columns to an array of one row, or to move from left to right, top to bottom through the child elements of an array with more than one row. This operation can be invoked by typing the , key.


Array Delete Column Left

This operation works to remove columns from an array of one row, or to remove child elements of an array from right to left, bottom to top through the child elements of an array with more than one row. This operation can be invoked by typing the Backspace key.


Array Delete Column Right

This operation removes the column containing the current expression, moving the expression cursor to the element in the next column in the same row as the current expression. This operation can be invoked by typing the Delete key.


Array Insert Row Left

This operation inserts a new row before the row containing the current expression, moving the expression cursor to the new element in the same column as the current expression. This operation can be invoked by typing the Ctrl+Insert key.


Array Insert Row Right

This operation inserts a new row after the row containing the current expression, moving the expression cursor to the first element of the new row. This operation can be invoked by typing the Enter key or the ; key.


Array Delete Row Left

This operation removes the row containing the current expression, moving the expression cursor to the last element in the previous row. This operation can be invoked by typing the Ctrl+Backspace key.


Array Delete Row Right

This operation removes the row containing the current expression, moving the expression cursor to the element in the next row in the same column as the current expression. This operation can be invoked by typing the Ctrl+Delete key.


Array Up

This operation moves the expression cursor to the child element one row above the current expression in the array. This operator can be invoked by typing the Ctrl+Up key.


Array Down

This operation moves the expression cursor to the child element one row below the current expression in the array. This operator can be invoked by typing the Ctrl+Down key.


Array Left

This operation moves the expression cursor to the child element one column to the left of the current expression in the array. This operator can be invoked by typing the Ctrl+Left key.


Array Right

This operation moves the expression cursor to the child element one column to the right of the current expression in the array. This operator can be invoked by typing the Ctrl+Right key.