Skip to content

Commit

Permalink
Merge pull request modelica#3386 from henrikt-ma/evaluable-attributes
Browse files Browse the repository at this point in the history
Specify attributes of built-in types that are evaluable
  • Loading branch information
HansOlsson committed Jul 3, 2023
2 parents ed5daa0 + 9e1eec2 commit 810534d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1552,11 +1552,18 @@ \subsection{Real Type}\label{real-type}
\index{unbounded@\robustinline{unbounded}!attribute of \robustinline{Real}}%
\index{stateSelect@\robustinline{stateSelect}!attribute of \robustinline{Real}}

The following attributes shall be evaluable: \lstinline!quantity!, \lstinline!unit!, \lstinline!displayUnit!, \lstinline!fixed!, and \lstinline!stateSelect!.

The \lstinline!unit! and \lstinline!displayUnit! attributes may be either the empty string or a string matching \lstinline[language=grammar]!unit-expression! in \cref{unit-expressions}.
The meaning of the empty string depends on the context.
For the input and output components of a function, the empty string allows different units to be used in different calls to the function.
For a non-function component, the empty string allows the unit (or display unit) to be inferred by the tool.

\begin{nonnormative}
That \lstinline!displayUnit! is evaluable allows tools to verify that the default display unit is consistent with the \lstinline!unit!.
Unlike the \lstinline!unit!, \lstinline!displayUnit! is just a default, tools may allow using other compatible display units for a translated model.
\end{nonnormative}

The \lstinline!nominal! attribute is meant to be used for scaling purposes and to
define tolerances in relative terms, see \cref{attributes-start-fixed-nominal-and-unbounded}.

Expand Down Expand Up @@ -1588,6 +1595,8 @@ \subsection{Integer Type}\label{integer-type}
\index{start@\robustinline{start}!attribute of \robustinline{Integer}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{Integer}}

The following attributes shall be evaluable: \lstinline!quantity!, and \lstinline!fixed!.

The minimal recommended number range for \lstinline!IntegerType! is from -2147483648 to +2147483647, corresponding to a two's-complement 32-bit integer implementation.

The fallback value is the closest value to $0$ consistent with the \lstinline!min! and \lstinline!max! bounds.
Expand All @@ -1608,6 +1617,8 @@ \subsection{Boolean Type}\label{boolean-type}
\index{start@\robustinline{start}!attribute of \robustinline{Boolean}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{Boolean}}%

The following attributes shall be evaluable: \lstinline!quantity!, and \lstinline!fixed!.

The fallback value is \lstinline!false!.

\subsection{String Type}\label{string-type}
Expand All @@ -1626,6 +1637,8 @@ \subsection{String Type}\label{string-type}
\index{start@\robustinline{start}!attribute of \robustinline{String}}%
\index{fixed@\robustinline{fixed}!attribute of \robustinline{String}}

The following attributes shall be evaluable: \lstinline!quantity!, and \lstinline!fixed!.

A \lstinline!StringType! value (such as $\langle\mathit{value}\rangle$ or other textual attributes of built-in types) may contain any Unicode data (and nothing else).

The fallback value is \lstinline!""!.
Expand Down Expand Up @@ -1752,6 +1765,8 @@ \subsubsection{Attributes of Enumeration Types}\label{attributes-of-enumeration-
end E;
\end{lstlisting}

The following attributes shall be evaluable: \lstinline!quantity!, and \lstinline!fixed!.

The fallback value is the \lstinline!min! bound.

\begin{nonnormative}
Expand Down

0 comments on commit 810534d

Please sign in to comment.