blob: 94d5bad79463920c09522d1b59adb8be59f58f8b [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.3.3.&nbsp;Unary Arithmetic Term</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_ASMArithmeticTerms.html" title="5.3.&nbsp;Arithmetic Terms"><link rel="prev" href="def_MultArithmeticTerm.html" title="5.3.2.&nbsp;Multiplicative Arithmetic Term"><link rel="next" href="def_BaseArithmeticTerm.html" title="5.3.4.&nbsp;Base Arithmetic Term"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">5.3.3.&nbsp;Unary Arithmetic Term</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_MultArithmeticTerm.html">Prev</a>&nbsp;</td><th align="center" width="60%">5.3.&nbsp;Arithmetic Terms</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="def_BaseArithmeticTerm.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_UnaryArithmeticTerm"></a>5.3.3.&nbsp;Unary Arithmetic Term</h4></div></div></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Description"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left"><a name="def_UnaryArithmeticTerm_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p>
A <span class="strong"><strong>unary arithmetic term</strong></span>
<a name="N126B6" class="indexterm"></a>
<a name="N126BB" class="indexterm"></a> is an ASM term
constituted from negation and minus operators.
</p></td></tr></table></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Syntax"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Important]" src="images/important.png"></td><th align="left"><a name="def_UnaryArithmeticTerm_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting">
UnaryArithmeticTermAST ::= BaseArithmeticTermAST
| <span class="token">-</span> BaseArithmeticTermAST
| <span class="token">!</span> BaseArithmeticTermAST
</pre><p>
A <span class="strong"><strong>unary arithmetic term</strong></span> is composed of
<a href="def_BaseArithmeticTerm.html" title="5.3.4.&nbsp;Base Arithmetic Term">base arithmetic terms</a> with a
negation (<code class="computeroutput">!</code>) and the (unary) minus (<code class="computeroutput">-</code>)
operators.
</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Semantics"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left"><a name="def_UnaryArithmeticTerm_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p>
The evaluation of unary arithmetic terms are evaluated according to
<a href="def_UnaryArithmeticTerm.html#tab_NegOp" title="Table&nbsp;2.10.&nbsp;Negation (!) operator">Table&nbsp;2.10, &ldquo;Negation (<code class="computeroutput">!</code>) operator &rdquo;</a> and <a href="def_UnaryArithmeticTerm.html#tab_MinusOp" title="Table&nbsp;2.11.&nbsp;Minus (-) operator">Table&nbsp;2.11, &ldquo;Minus (<code class="computeroutput">-</code>) operator &rdquo;</a>,
which shows the type of the output with respect to the types of each operand.
</p><p>
If any operation has an <code class="computeroutput">undef</code> value among its operands, the result
is always <code class="computeroutput">undef</code>, no matter what the type of the other operand is.
</p><div class="table"><a name="tab_NegOp"></a><p class="title"><b>Table&nbsp;2.10.&nbsp;Negation (<code class="computeroutput">!</code>) operator </b></p><div class="table-contents"><table summary="Negation (!) operator " border="1"><colgroup><col><col><col><col><col><col><col></colgroup><thead><tr><th align="center">Undef</th><th align="center">Boolean</th><th align="center">String</th><th align="center">Integer</th><th align="center">Double</th><th align="center">ModelElement</th><th align="center">Multiplicity</th></tr></thead><tbody><tr><td align="center">Undef</td><td align="center">Bool</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td></tr></tbody></table></div><p></p></div><br class="table-break"><div class="table"><a name="tab_MinusOp"></a><p class="title"><b>Table&nbsp;2.11.&nbsp;Minus (<code class="computeroutput">-</code>) operator </b></p><div class="table-contents"><table summary="Minus (-) operator " border="1"><colgroup><col><col><col><col><col><col><col></colgroup><thead><tr><th align="center">Undef</th><th align="center">Boolean</th><th align="center">String</th><th align="center">Integer</th><th align="center">Double</th><th align="center">ModelElement</th><th align="center">Multiplicity</th></tr></thead><tbody><tr><td align="center">Undef</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td><td align="center">Int</td><td align="center">Double</td><td align="center">&nbsp;</td><td align="center">&nbsp;</td></tr></tbody></table></div><p></p></div><br class="table-break"></td></tr></table></div><div class="highlights"><a name="def_UnaryArithmeticTerm_Remark"></a><p><b>Remark.&nbsp;</b>
There is no implicit type casting on the input of the operands; conversion
operators have to be used if casting is required.
</p></div><div class="highlights"><a name="def_UnaryArithmeticTerm_DefinedIn"></a><p><b>Defined In:&nbsp;</b>
<a href="def_MultArithmeticTerm.html" title="5.3.2.&nbsp;Multiplicative Arithmetic Term">multiplicative arithmetic term</a>
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="def_MultArithmeticTerm.html">Prev</a>&nbsp;</td><td align="center" width="20%"><a accesskey="u" href="sec_ASMArithmeticTerms.html">Up</a></td><td align="right" width="40%">&nbsp;<a accesskey="n" href="def_BaseArithmeticTerm.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">5.3.2.&nbsp;Multiplicative Arithmetic Term&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;5.3.4.&nbsp;Base Arithmetic Term</td></tr></table></div></body></html>