 Eval - Maple Help

Ordinals

 Eval
 substitute values for parameters in an ordinal Calling Sequence Eval(o, x=v) Eval(o, l) Parameters

 o - x - name v - integer or polynomial with integer coefficients l - list or set of equations of type x=v Description

 • The Eval(o, x=v) calling sequence substitutes the value $v$ for the parameter $x$ in the ordinal $o$, returning either an ordinal data structure, a nonnegative integer, or a polynomial with positive integer coefficients.
 • It is possible for $v$ to be a negative integer or a polynomial with some negative integer coefficients, provided that the result is a valid ordinal, which means it does not have any negative integer coefficients.
 • The resulting ordinal is simplified, namely, any coefficients that become zero are removed, and if only a single term with exponent $0$ is left after that, a nonnegative integer or a polynomial with positive integer coefficients is returned.
 • The Eval(o, l) calling sequence performs all the substitutions in l simultaneously.
 • This command can also be applied to a polynomial with positive integer coefficients representing a nonnegative integer ordinal. Examples

 > $\mathrm{with}\left(\mathrm{Ordinals}\right)$
 $\left[{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{<}}{,}{\mathrm{<=}}{,}{\mathrm{Add}}{,}{\mathrm{Base}}{,}{\mathrm{Dec}}{,}{\mathrm{Decompose}}{,}{\mathrm{Div}}{,}{\mathrm{Eval}}{,}{\mathrm{Factor}}{,}{\mathrm{Gcd}}{,}{\mathrm{Lcm}}{,}{\mathrm{LessThan}}{,}{\mathrm{Log}}{,}{\mathrm{Max}}{,}{\mathrm{Min}}{,}{\mathrm{Mult}}{,}{\mathrm{Ordinal}}{,}{\mathrm{Power}}{,}{\mathrm{Split}}{,}{\mathrm{Sub}}{,}{\mathrm{^}}{,}{\mathrm{degree}}{,}{\mathrm{lcoeff}}{,}{\mathrm{log}}{,}{\mathrm{lterm}}{,}{\mathrm{\omega }}{,}{\mathrm{quo}}{,}{\mathrm{rem}}{,}{\mathrm{tcoeff}}{,}{\mathrm{tdegree}}{,}{\mathrm{tterm}}\right]$ (1)
 > $\mathrm{o1}≔\mathrm{Ordinal}\left(\left[\left[\mathrm{ω},x\right],\left[2,3\right],\left[1,y+1\right],\left[0,4\right]\right]\right)$
 ${\mathrm{o1}}{≔}{{\mathbf{\omega }}}^{{\mathbf{\omega }}}{\cdot }{x}{+}{{\mathbf{\omega }}}^{{2}}{\cdot }{3}{+}{\mathbf{\omega }}{\cdot }\left({y}{+}{1}\right){+}{4}$ (2)
 > $\genfrac{}{}{0}{}{\mathrm{o1}}{\phantom{x=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o1}}}{x=0}$
 ${{\mathbf{\omega }}}^{{2}}{\cdot }{3}{+}{\mathbf{\omega }}{\cdot }\left({y}{+}{1}\right){+}{4}$ (3)

Several substitutions can be done at once. It is also possible to substitute a polynomial for a parameter and not just an integer.

 > $\mathrm{Eval}\left(\mathrm{o1},\left[x={x}^{2}+1,y=4\right]\right)$
 ${{\mathbf{\omega }}}^{{\mathbf{\omega }}}{\cdot }\left({{x}}^{{2}}{+}{1}\right){+}{{\mathbf{\omega }}}^{{2}}{\cdot }{3}{+}{\mathbf{\omega }}{\cdot }{5}{+}{4}$ (4)

The result need not be an ordinal data structure.

 > $\mathrm{o2}≔\mathrm{Ordinal}\left(\left[\left[2,{x}^{2}+x\right],\left[1,x\right],\left[0,4\right]\right]\right)$
 ${\mathrm{o2}}{≔}{{\mathbf{\omega }}}^{{2}}{\cdot }\left({{x}}^{{2}}{+}{x}\right){+}{\mathbf{\omega }}{\cdot }{x}{+}{4}$ (5)
 > $\genfrac{}{}{0}{}{\mathrm{o2}}{\phantom{x=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o2}}}{x=0}$
 ${4}$ (6)
 > $\genfrac{}{}{0}{}{\mathrm{.}\left(\mathrm{ω},x\right)}{\phantom{x=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{.}\left(\mathrm{ω},x\right)}}{x=0}$
 ${0}$ (7)

The attempt to substitute a negative integer or a polynomial with negative coefficients may result in an error if the result has negative coefficients.

 > $\mathrm{o3}≔\mathrm{Ordinal}\left(\left[\left[1,2x+2\right],\left[0,3\right]\right]\right)$
 ${\mathrm{o3}}{≔}{\mathbf{\omega }}{\cdot }\left({2}{}{x}{+}{2}\right){+}{3}$ (8)
 > $\genfrac{}{}{0}{}{\mathrm{o3}}{\phantom{x=-1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o3}}}{x=-1}$
 ${3}$ (9)
 > $\genfrac{}{}{0}{}{\mathrm{o3}}{\phantom{x=-2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o3}}}{x=-2}$
 > $\genfrac{}{}{0}{}{\mathrm{o3}}{\phantom{x=x-1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o3}}}{x=x-1}$
 ${\mathbf{\omega }}{\cdot }\left({2}{}{x}\right){+}{3}$ (10)
 > $\genfrac{}{}{0}{}{\mathrm{o3}}{\phantom{x=x-2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{o3}}}{x=x-2}$

The Eval command can also be applied to a polynomial with positive integer coefficients representing a constant ordinal.

 > $\genfrac{}{}{0}{}{\left({x}^{2}+1\right)}{\phantom{x=3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{|}\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\left({x}^{2}+1\right)}}{x=3}=\genfrac{}{}{0}{}{\left({x}^{2}+1\right)}{\phantom{x=3}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\left({x}^{2}+1\right)}}{x=3}$
 ${10}{=}{10}$ (11) Compatibility

 • The Ordinals[Eval] command was introduced in Maple 2015.