Skip to content
2 changes: 1 addition & 1 deletion chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ \subsection{Concatenation}\label{array-concatenation}\label{concatenation}
The maximally expanded types should be equivalent.
\lstinline!Real! and \lstinline!Integer! subtypes can be mixed resulting in a \lstinline!Real! result array where the \lstinline!Integer! numbers have been transformed to \lstinline!Real! numbers.
\item
$k$ has to characterize an existing dimension, i.e., $1 \leq k \leq \text{\lstinline!ndims(A)!} = \text{\lstinline!ndims(B)!} = \text{\lstinline!ndims(C)!}$; $k$ shall be a parameter expression of \lstinline!Integer! type.
$k$ has to characterize an existing dimension, i.e., $1 \leq k \leq \text{\lstinline!ndims(A)!} = \text{\lstinline!ndims(B)!} = \text{\lstinline!ndims(C)!}$; $k$ shall be an evaluable expression of \lstinline!Integer! type.
\item
Size matching: Arrays \lstinline!A!, \lstinline!B!, \lstinline!C!, \ldots must have identical array sizes with the exception of the size of dimension $k$, i.e., \lstinline!size(A, $j$)! = \lstinline!size(B, $j$)!, for $1 \leq j \leq \text{\lstinline!ndims(A)!}$ and $j \neq k$.
\end{itemize}
Expand Down
13 changes: 6 additions & 7 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ \section{Component Declarations}\label{component-declarations}
Component declarations are described in this section.

A \firstuse[component!declaration]{component declaration} is an element of a class definition that generates a component.
A component declaration specifies (1) a component name, i.e., an identifier, (2) the class to be flattened in order to generate the component, and (3) an optional \lstinline!Boolean! parameter expression.
Generation of the component is suppressed if this parameter expression evaluates to false.
A component declaration specifies (1) a component name, i.e., an identifier, (2) the class to be flattened in order to generate the component, and (3) an optional condition.
A component declaration may be overridden by an element-redeclaration.

A \firstuse{component} or \firstuse{variable} is an instance (object) generated by a component declaration.
Expand Down Expand Up @@ -182,7 +181,7 @@ \subsection{Static Semantics}\label{component-declaration-static-semantics}
parameter Real b[2, 0] = ones(2, 0); // Size 0 is allowed
parameter Real c[:] = ones(0); // Unspecified size for variable
parameter Integer n = 0;
Real z[n*2] = cat(1, ones(n), zeros(n));// Parameter expressions are allowed
Real z[n*2] = cat(1, ones(n), zeros(n));// Evaluable expressions are allowed
Boolean notV[Boolean] = {true, false}; // Indexing with type
end ArrayVariants;
\end{lstlisting}
Expand Down Expand Up @@ -354,7 +353,7 @@ \subsection{Acyclic Bindings of Constants and Parameters}\label{acyclic-bindings

\subsection{Conditional Component Declaration}\label{conditional-component-declaration}

A component declaration can have a \lstinline!condition-attribute!: \lstinline!if!~\emph{expression}.
A component declaration can have a \lstinline[language=grammar]!condition-attribute! of the form \lstinline!if $\mathit{condition}$!.

\begin{example}
\begin{lstlisting}[language=modelica]
Expand All @@ -374,7 +373,7 @@ \subsection{Conditional Component Declaration}\label{conditional-component-decla
\end{lstlisting}
\end{example}

The \emph{expression} must be a \lstinline!Boolean! scalar expression, and must be an evaluable expression.
The $\mathit{condition}$ must be a scalar \lstinline!Boolean! evaluable expression.

\begin{nonnormative}
An evaluable expression is required since it shall be evaluated at compile time.
Expand All @@ -383,10 +382,10 @@ \subsection{Conditional Component Declaration}\label{conditional-component-decla
A redeclaration of a component shall not include a condition attribute; and the condition attribute is kept from the original declaration (see
\cref{interface-compatibility-or-subtyping}).

If the \lstinline!Boolean! expression is \lstinline!false!, the component (including its modifier) is removed from the flattened DAE, and connections to/from the component are removed.
If $\mathit{condition}$ is \lstinline!false!, the component (including its modifier) is removed from the flattened DAE, and connections to/from the component are removed.
Such a component can only be modified, used in connections, and/or used in a modifier of another conditional component with a \lstinline!false! condition.

There are no restrictions on the component if the \lstinline!Boolean! expression is \lstinline!true!.
There are no restrictions on the component if $\mathit{condition}$ is \lstinline!true!.

\begin{nonnormative}
Adding the component and then removing it ensures that the component is valid.
Expand Down
2 changes: 1 addition & 1 deletion chapters/connectors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ \subsection{Connection Graphs and Their Operators}\label{overconstrained-equatio
The overdetermined type or record instance \lstinline!R! in connector instance \lstinline!a! is a \firstuse[definite root node]{(definite) root node}\index{root node!definite} in a virtual connection graph.

\begin{nonnormative}
This definition shall be used if in a model with connector \lstinline!a! the overdetermined record \lstinline!a.R! is (consistently) assigned, e.g., from a parameter expressions.
This definition shall be used if in a model with connector \lstinline!a!, the overdetermined record \lstinline!a.R! is (consistently) assigned.
\end{nonnormative}
\end{semantics}
\end{operatordefinition}
Expand Down
2 changes: 1 addition & 1 deletion chapters/equations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ \subsubsection{Equations within When-Equations}\label{restrictions-on-equations-
The different branches of \lstinline!when!/\lstinline!elsewhen! must have the same set of component references on the left-hand side.
Here, the destination variable of a \lstinline!reinit! (including when inside a \lstinline!when!-clause activated with \lstinline!initial()!) is not considered a left-hand side, and hence \lstinline!reinit! is unaffected by this requirement (as are \lstinline!assert! and \lstinline!terminate!).
\item
The branches of an \lstinline!if!-equation inside \lstinline!when!-equations must have the same set of component references on the left-hand side, unless all switching conditions of the \lstinline!if!-equation are parameter expressions.
The branches of an \lstinline!if!-equation inside \lstinline!when!-equations must have the same set of component references on the left-hand side, unless all switching conditions of the \lstinline!if!-equation are evaluable expressions.
\item
Any left-hand side reference, (\lstinline!v!, \lstinline!out1!, \ldots), in a \lstinline!when!-clause must be a component reference, and any indices must be evaluable expressions.
\end{itemize}
Expand Down
2 changes: 1 addition & 1 deletion chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ \section{Function as a Specialized Class}\label{function-as-a-specialized-class}
\item
There are many Modelica built-in operators that are not allowed to be used in functions, including \lstinline!der!, \lstinline!initial!, \lstinline!terminal!, \lstinline!sample!, \lstinline!pre!, \lstinline!edge!, \lstinline!change!, \lstinline!reinit!, \lstinline!delay!, \lstinline!cardinality!, \lstinline!inStream!, \lstinline!actualStream!, the operators of the built-in package \lstinline!Connections!, the operators defined in \cref{synchronous-language-elements} and \cref{state-machines}.
\item
The dimension \emph{sizes} not declared with colon (\lstinline!:!) of each array result or array local variable (i.e., a non-input component) of a function must be either given by the input formal parameters, or given by constant or parameter expressions, or by expressions containing combinations of those (\cref{initialization-and-binding-equations-of-components-in-functions}).
The dimension \emph{sizes} not declared with colon (\lstinline!:!) of each array result or array local variable (i.e., a non-input component) of a function must be either given by the input formal parameters, or given by constant or evaluable expressions, or by expressions containing combinations of those (\cref{initialization-and-binding-equations-of-components-in-functions}).
\item
For initialization of local variables of a function see \cref{initialization-and-binding-equations-of-components-in-functions}).
\item
Expand Down
4 changes: 2 additions & 2 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ \subsection{Event-Related Operators with Function Syntax}\label{event-related-op
\end{lstlisting}\end{synopsis}
\begin{semantics}
If $p \geq 0$ \lstinline!smooth($p$, $\mathit{expr}$)! returns $\mathit{expr}$ and states that $\mathit{expr}$ is $p$ times continuously differentiable, i.e., $\mathit{expr}$ is continuous in all \lstinline!Real! variables appearing in the expression and all partial derivatives with respect to all appearing real variables exist and are continuous up to order $p$.
The argument $p$ should be a scalar \lstinline!Integer! parameter expression.
The argument $p$ shall be a scalar \lstinline!Integer! evaluable expression.
The only allowed types for $\mathit{expr}$ in \lstinline!smooth! are: \lstinline!Real! expressions, arrays of allowed expressions, and records containing only components of allowed expressions.

\lstinline!smooth! should be used instead of \lstinline!noEvent! in order to avoid events for efficiency reasons.
Expand Down Expand Up @@ -1443,7 +1443,7 @@ \subsection{Event-Related Operators with Function Syntax}\label{event-related-op
Returns the \emph{left limit} $y(t^{-})$ of variable $y(t)$ at a time instant $t$.
At an event instant, $y(t^{-})$ is the value of $y$ after the last event iteration at time instant $t$ (see comment below).
% Warning "component expression" is a term defined for synchronous operator argument restrictions; this seems to conflict with also defining the present argument restriction below.
Any subscripts in the component expression $y$ must be parameter expressions.
Any subscripts in the component expression $y$ must be evaluable expressions.
The operator is not allowed inside \lstinline!function! classes.
\lstinline!pre! can be applied to the variable $y$ only if $y$ is a discrete-time expression and $y$ is either a subtype of a simple type or is a record component.
\begin{nonnormative}
Expand Down
2 changes: 1 addition & 1 deletion chapters/statemachines.tex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ \section{Transitions}\label{transitions}
\end{tabular}
\end{center}

The \lstinline!transition!- and \lstinline!initialState!-equations can only be used in equations, and cannot be used inside \lstinline!if!-equations with conditions that are not parameter expressions, or in \lstinline!when!-equations.
The \lstinline!transition!- and \lstinline!initialState!-equations can only be used in equations, and cannot be used inside \lstinline!if!-equations with conditions that are not evaluable expressions, or in \lstinline!when!-equations.

The operators listed below are used to query the status of the state machine.
None of these operators are allowed inside \lstinline!function! classes.
Expand Down