diff --git a/chapters/classes.tex b/chapters/classes.tex index 51551b401..1da926a84 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -928,15 +928,9 @@ \section{Balanced Models}\label{balanced-models} The local number of unknowns of a \lstinline!model! or \lstinline!block! class is the sum based on the components: \begin{itemize} \item - For each declared component of specialized class \lstinline!type! (Real, Integer, - String, Boolean, enumeration and arrays of those, etc.) or \lstinline!record!, or - \lstinline!operator record! not declared as \lstinline!outer!, it is the number of unknown - variables inside it (i.e., excluding parameters and constants and - counting the elements after expanding all records, operator record, - and arrays to a set of scalars of primitive types). + For each declared component of specialized class \lstinline!type! (\lstinline!Real!, \lstinline!Integer!, \lstinline!String!, \lstinline!Boolean!, enumeration and arrays of those, etc.) or \lstinline!record!, or \lstinline!operator record! not declared as \lstinline!outer!, it is the number of unknown variables inside it (i.e., excluding parameters and constants and counting the elements after expanding all records, operator record, and arrays to a set of scalars of primitive types). \item - Each declared component of specialized class \lstinline!type! or record declared - as \lstinline!outer! is ignored. + Each declared component of specialized class \lstinline!type! or \lstinline!record! declared as \lstinline!outer! is ignored. \begin{nonnormative} I.e., all variables inside the component are treated as known. \end{nonnormative} diff --git a/chapters/connectors.tex b/chapters/connectors.tex index 789411018..28d60cea3 100644 --- a/chapters/connectors.tex +++ b/chapters/connectors.tex @@ -76,7 +76,7 @@ \subsection{Connection Sets}\label{connection-sets} \subsection{Inside and Outside Connectors}\label{inside-and-outside-connectors} -In an element instance \lstinline!M!, each connector element of \lstinline!M! is called an \firstuse(outside connector} with respect to \lstinline!M!. Any other connector elements that is hierarchically inside \lstinline!M!, but not in one of the outside connectors of \lstinline!M!, is called an \firstuse{inside connector} with respect to \lstinline!M!. This is done before resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones. +In an element instance \lstinline!M!, each connector element of \lstinline!M! is called an \firstuse{outside connector} with respect to \lstinline!M!. Any other connector elements that is hierarchically inside \lstinline!M!, but not in one of the outside connectors of \lstinline!M!, is called an \firstuse{inside connector} with respect to \lstinline!M!. This is done before resolving \lstinline!outer! elements to corresponding \lstinline!inner! ones. \begin{example} \begin{figure}[H] diff --git a/chapters/inheritance.tex b/chapters/inheritance.tex index 993af0097..b138f38eb 100644 --- a/chapters/inheritance.tex +++ b/chapters/inheritance.tex @@ -354,7 +354,7 @@ \subsection{Merging of Modifications}\label{merging-of-modifications} it is an error if this overrides a final prefix for a component, or if value for a simple component would override part of the value of a non-simple component. When merging modifiers each modification keeps its -own each-prefix. +own \lstinline!each! prefix. \begin{example} The following larger example demonstrates several aspects: diff --git a/chapters/overloaded.tex b/chapters/overloaded.tex index 7d76bef31..a5f5bcda7 100644 --- a/chapters/overloaded.tex +++ b/chapters/overloaded.tex @@ -220,9 +220,8 @@ \section{Overloaded Binary Operations}\label{overloaded-binary-operations} class \lstinline!B!. \begin{enumerate} -\item - If \lstinline!A! and \lstinline!B! are predefined types of such, then the - corresponding built-in operation is performed. +\item\label{overloaded-binary-predefined} + If \lstinline!A! and \lstinline!B! are predefined types of such, then the corresponding built-in operation is performed. \item Otherwise, if there exists \emph{exactly one} function $f$ in the union of \lstinline!A.$\theop$! and \lstinline!B.$\theop$! such that @@ -245,39 +244,32 @@ \section{Overloaded Binary Operations}\label{overloaded-binary-operations} gives the unique match. If the sum of the sizes is larger than one it is an error. \begin{nonnormative} - Informally, this means: If there is no direct match of \lstinline!a $\theop$ b!, then it is tried to find a direct match by automatic type casts - of \lstinline!a! or \lstinline!b!, by converting either \lstinline!a! or \lstinline!b! to the needed - type using an appropriate constructor function from one of the - operator record classes used as arguments of the overloaded \lstinline!op! - functions. Example using the Complex-definition below: + Informally, this means: If there is no direct match of \lstinline!a $\theop$ b!, then it is tried to find a direct match by automatic type casts of \lstinline!a! or \lstinline!b!, by converting either \lstinline!a! or \lstinline!b! to the needed type using an appropriate constructor function from one of the operator record classes used as arguments of the overloaded \lstinline!op! functions. Example using the \lstinline!Complex!-definition below: \begin{lstlisting}[language=modelica] Real a; Complex b; -Complex c = a*b; // interpreted as: +Complex c = a * b; // interpreted as: // Complex.'*'.multiply(Complex.'constructor'.fromReal(a),b); \end{lstlisting} \end{nonnormative} -\item +\item\label{overloaded-binary-arrays} Otherwise, if \lstinline!a! or \lstinline!b! is an array expression, then the expression is conceptually evaluated according to the rules of \cref{scalar-vector-matrix-and-array-operator-functions} with the following exceptions concerning \cref{matrix-and-vector-multiplication-of-numeric-arrays}: \begin{enumerate} \def\labelenumii{(\alph{enumii})} \item - vector*vector should be left undefined. + \lstinline!$\mathit{vector}$ * $\mathit{vector}$! should be left undefined. \begin{nonnormative} The scalar product of \cref{tab:product} does not generalize to the expected linear and conjugate linear scalar product of complex numbers. \end{nonnormative} \item - vector*matrix should be left undefined. + \lstinline!$\mathit{vector}$ * $\mathit{matrix}$! should be left undefined. \begin{nonnormative} The corresponding definition of \cref{tab:product} does not generalize to complex numbers in the expected way. \end{nonnormative} \item - If the inner dimension for matrix*vector or matrix*matrix is zero, - this uses the overloaded \lstinline!'0'! operator of the result array element - type. If the operator \lstinline!'0'! is not defined for that class it is an - error if the inner dimension is zero. + If the inner dimension for \lstinline!$\mathit{matrix}$ * $\mathit{vector}$! or \lstinline!$\mathit{matrix}$ * $\mathit{matrix}$! is zero, this uses the overloaded \lstinline!'0'! operator of the result array element type. If the operator \lstinline!'0'! is not defined for that class it is an error if the inner dimension is zero. \end{enumerate} \begin{nonnormative} @@ -286,12 +278,11 @@ \section{Overloaded Binary Operations}\label{overloaded-binary-operations} multiplicative identity. \end{nonnormative} -\item +\item\label{overloaded-binary-error} Otherwise the expression is erroneous. \end{enumerate} -%henrikt-ma: Insane to refer to items by hard-coded numbers. -For an element-wise operator, \lstinline!a .op b!, items 1, 4, and 5 are used; e.g.\ the operator \lstinline!.+! will always be defined in terms of \lstinline!'+'!. +For an element-wise operator, \lstinline!a .op b!, items~\ref{overloaded-binary-predefined}, \ref{overloaded-binary-arrays}, and~\ref{overloaded-binary-error} are used; e.g.\ the operator \lstinline!.+! will always be defined in terms of \lstinline!'+'!. Restrictions: \begin{itemize}