Math.Arithmetic.Multiplication
Math.Arithmetic.Multiplication is the tag for the expression representing the mathematical multiplication.
Contents
Definition
Math.Arithmetic.Multiplication is the tag for the expression representing the mathematical multiplication.
Behavior
This expression must have at least two children.
Children names
The subexpressions should be named "Factor 1", "Factor 2", etc. First factor must be numbered as one, contrary to several programming languages, in which first element is numbered as zero.
Localization packages could be created in order to provide the names in languages other than English.
Visualization
There could be different visualizations, being the most popular the infix one, that us, using the multiplication symbol between each consecutive pair of factors, followed by the prefix form and rarely the postfix form.
The following symbols are commonly used for infix visualization:
Symbol | Example | Use |
---|---|---|
Arithmetic | ||
Algebra | ||
(a single space) | High mathematics |
Edition
There could be several editions. The most obvious is: Given a selected expression, it is replaced by a new multiplication expression with two children, the first one is the expressions that was selected, and the second one is a new Null expression. The latter becomes the new selected expression.
Reduction
Ther could be several reductions, see below.
Known implementations
The Standard Arithmetic Package
Visualization
There are three visualizations on this package. All of them are infix.
These visualizations align the horizontal baselines of the factors, such like the following example:
Infix cross (×) symbol among factors
This visualization shows the multiplication in infix form, using a cross (×) as a symbol, such the following example:
Infix dot (•) symbol among factors
This visualization shows the multiplication in infix form, using a dot (•) as a symbol, such the following example:
Infix space among factors
This visualization shows the multiplication in infix form, using a single space as a symbol, such the following example:
Parentheses awareness
The visualizations in this package awares whether some of its children belong to the parentheses category Parentheses as operator or it is also a Math.Arithmetic.Multiplication. In such that case, these children are drawn between parentheses.
In the following example, the second factor is an addition. Because this expression belongs to the parentheses category Parentheses as operator the parent multiplication shows this subexpression between parentheses.
In the next example, the second factor is also a multiplication, so the parent multiplication shows this subexpression between parentheses.
Parentheses categories
The visualizations in this package belongs to the category Parentheses as super/subscripted. It means that if this visualization is a child of a parent visualization that awares of this, that such parent expression will show this child between parentheses.
In the following example, the Math.Arithmetic.Exponentiation visualization awares of either its base or exponent to belong of that category, to show either the base or the exponente between parentheses (in this case is the base):
Edition
There are several editions in this package, which are the combinations of a default edition with two variantions:
Variation | Meaning |
---|---|
default (no variation) | Creates a new Math.Arithmetic.Multiplication Expression, the current selected expression becomes the first factor, a new Null expression is created and becomes the second factor. |
Before | The new expression (usually a Null expression) will be created as the first factor, instead of the second one |
Forced | Usually, if the current selected expression is already a Math.Arithmetic.Multiplication expression, or a factor of a Math.Arithmetic.Multiplication expression, a new factor is not created. With this option a multiplication is always created. |
In the following examples, the selected expression is neither a Math.Arithmetic.Multiplication or a factor, so the "Forced" variant behaves as the default edition.
Example | Edition performed | Result |
---|---|---|
Multiplication | ||
Multiplication (forced) | ||
Multiplication (before) | ||
Multiplication (forced, before) |
In the following examples, the selected expression is a Math.Arithmetic.Multiplication or a factor, so the "Forced" variation applies:
Reduction
Multiplication of numeric factors
This reducer searches on the Math.Arithmetic.Multiplication children, for numeric expressions. If there are more than one, performs a numeric multiplication. According to Arithmetic canon, a numeric expression is either:
- A Math.Number expression.
- A Math.Arithmetic.Negative expression, containing a Math.Number expression as its child. It represents a negative number.
- A Math.Arithmetic.Division expression, containing two Math.Number expressions representing integer numbers, as its children. Ir represents a rational number.
- A Math.Arithmetic.Negative expression, containing a Math.Arithmetic.Division expression, containing two Math.Number expressions representing integer numbers, as its children. It represents a negative rational number.
The following are examples. In these examples, expressions , and are supposed not to be numeric expressions.
Expression before reduction | Expression after reduction | Explanation |
---|---|---|
The same | It does not reduce, there are no numeric expressions as addends. | |
The same | It does not reduce, there are not two or more numeric expressions as addends. | |
According to Arithmetic canon, if any operand is a decimal number, the result must be either. | ||
According to Arithmetic canon, if any operand is a decimal number, the result must be either. | ||
If there is a reduction, and the numeric result of this reduction is one, it will be removed of the Math.Arithmetic.Multiplication expression, unless it remains as the only expression.
The following are examples. Again, and are supposed not to be numeric expressions.
Expression before reduction | Expression after reduction | Explanation |
---|---|---|
One is removed. | ||
One is not removed, it remains as the only child.
According to Arithmetic canon, if any operand is a decimal number, the result must be either. |
Flatten nested factors
This reducer searches into the current Math.Arithmetic.Multiplication for children being also Math.Arithmetic.Multiplication expressions. For each one of them, it integrates their factors as factors of the current Math.Arithmetic.Multiplication expression.
For example, the following -three factor- multiplication:
reduces to the following -five factor- multiplication:
In the above example, and expressions are supposed not to be Math.Arithmetic.Multiplication expressions.
Elimination of negative factors, maybe producing a negative multiplication
This reducer searches into the current Math.Arithmetic.Multiplication for children being a Math.Arithmetic.Negative expression and removing it (the Math.Arithmetic.Negative, not the entire expression). If there were an odd number of such these removals, the entire current Math.Arithmetic.Multiplication will be put under a Math.Arithmetic.Negative.
The following are examples. , , and are supposed not to be negative expressions.
Expression before reduction | Expression after reduction | Explanation |
---|---|---|
The same | No negative factors | |
An even number of negative factors removed | ||
An odd number of negative factors removed |
Numeric factors first
This reducer searches for factors being numeric expressions to move to the beginning, so the following expression (, and are suppose not to be numeric expressions):
Will be reduced to
Left distributivity of numeric factors
This reducer searches for expression of the following form ( and are suppose not to be numeric expressions):
To be converted to
The Standard list package
This package contains neither visualizers nor editors for the Math.Arithmetic.Multiplication expression.
Reduction
Matrix multiplication
In mathematics, A matrix is an array of rows and columns. It is also said that this is a matrix. According to the List canon in the Fōrmulæ framework, a matrix is represented as a Structure.List expression containing Structure.List expressions, each one with elements. In other words, it is a list of equal-size sublists.
Matrix multiplication between an matrix and a matrix results in a matrix.
This reducer searches for contiguous pairs of expression representing matrices as previously defined --a list of equal-size sublists-- that match the size requeriments, and performs a matrix multiplication, substituting them by the new resulting multiplaction matrix.
The following are examples. In these examples, expressions , and are supposed not to be matrices, according to the definition already given.
Expression before reduction | Expression after reduction | Explanation |
---|---|---|
The same | It does not reduce, there are no matrix expressions as factors. | |
The same | It does not reduce, there are not two or more matrix expressions as factors. | |
The same | It does not reduce, number of columns in the first matrix is not equal to the number of rows of the second one. | |
The expressions shown in orange color are the result given by this reducer. If these expression are reduced to another expressions will be the result of application of other reducers, but not by this. |