diff --git a/chapters/functions.tex b/chapters/functions.tex index 87bf5a57b..a5d6a8b4c 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -1670,6 +1670,7 @@ \subsection{Using the Inverse Annotation}\label{using-the-inverse-annotation} \section{Function Inlining and Event Generation}\label{function-inlining-and-event-generation} The annotations listed below affect inlining of functions and the related topic of event generation inside functions. +See \cref{notation-for-annotation-definitions} regarding the notation used to describe the annotations. \begin{center} \begin{tabular}{l|l l} \hline @@ -1689,8 +1690,8 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve Hence, one needs to find the right balance between inlining too early (loss of provided derivatives and inverses) and too late (earlier stages of symbolic processing cannot benefit from symbolic simplifications). \begin{annotationdefinition}[Inline] -\begin{synopsis}[grammar]\begin{lstlisting} -"Inline" "=" ( false | true ) +\begin{synopsis}\begin{lstlisting} +/*literal*/ constant Boolean Inline; \end{lstlisting}\end{synopsis} \begin{semantics} Has only an effect within a function declaration. @@ -1700,6 +1701,8 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve If {\lstinline!Inline = false!}, the model developer proposes to not inline the function. +The default for inlining is tool-specific. + \begin{nonnormative} {\lstinline!Inline = true!} is for example used in {\lstinline!Modelica.Mechanics.MultiBody.Frames!} and in functions of {\lstinline!Modelica.Media!} to have no overhead for function calls such as resolving a vector in a different coordinate system and at the same time the function can be analytically differentiated, e.g., for index reduction needed for mechanical systems. \end{nonnormative} @@ -1707,8 +1710,8 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve \end{annotationdefinition} \begin{annotationdefinition}[LateInline] -\begin{synopsis}[grammar]\begin{lstlisting} -"LateInline" "=" ( false | true ) +\begin{synopsis}\begin{lstlisting} +/*literal*/ constant Boolean LateInline = false; \end{lstlisting}\end{synopsis} \begin{semantics} Has only an effect within a function declaration. @@ -1735,8 +1738,8 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve \end{annotationdefinition} \begin{annotationdefinition}[InlineAfterIndexReduction] -\begin{synopsis}[grammar]\begin{lstlisting} -"InlineAfterIndexReduction" "=" ( false | true ) +\begin{synopsis}\begin{lstlisting} +/*literal*/ constant Boolean InlineAfterIndexReduction = false; \end{lstlisting}\end{synopsis} \begin{semantics} Has only an effect within a function declaration. @@ -1747,8 +1750,8 @@ \section{Function Inlining and Event Generation}\label{function-inlining-and-eve \end{annotationdefinition} \begin{annotationdefinition}[GenerateEvents] -\begin{synopsis}[grammar]\begin{lstlisting} -"GenerateEvents" "=" ( false | true ) +\begin{synopsis}\begin{lstlisting} +/*literal*/ constant Boolean GenerateEvents = false; \end{lstlisting}\end{synopsis} \begin{semantics} Has only an effect within a function declaration.