diff --git a/chapters/arrays.tex b/chapters/arrays.tex index b410712fa..84060ade7 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -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} diff --git a/chapters/classes.tex b/chapters/classes.tex index 286c1e8a7..9eb7f4134 100644 --- a/chapters/classes.tex +++ b/chapters/classes.tex @@ -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. @@ -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} @@ -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] @@ -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. @@ -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. diff --git a/chapters/connectors.tex b/chapters/connectors.tex index b20e50a5d..0d1dcbf9e 100644 --- a/chapters/connectors.tex +++ b/chapters/connectors.tex @@ -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} diff --git a/chapters/equations.tex b/chapters/equations.tex index 5f1ff0e35..1e605da6a 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -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} diff --git a/chapters/functions.tex b/chapters/functions.tex index f91c8620b..10f485e3d 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -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 diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 70fa601bb..08ffd9fc3 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -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. @@ -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} diff --git a/chapters/statemachines.tex b/chapters/statemachines.tex index 7f93834bc..07747a61a 100644 --- a/chapters/statemachines.tex +++ b/chapters/statemachines.tex @@ -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.