Skip to content

Commit

Permalink
Merge remote-tracking branch 'central/master' into cleanup/style-miss…
Browse files Browse the repository at this point in the history
…ingInnerMessage
  • Loading branch information
henrikt-ma committed May 15, 2022
2 parents dbebe1b + b3e4138 commit 6033119
Show file tree
Hide file tree
Showing 28 changed files with 446 additions and 279 deletions.
2 changes: 1 addition & 1 deletion .CI/Jenkinsfile
Expand Up @@ -18,7 +18,7 @@ pipeline {
stage('build') {
agent {
docker {
image 'modelicaspec/latexml:20210330'
image 'modelicaspec/latexml:20220405'
label 'linux'
alwaysPull true
}
Expand Down
4 changes: 2 additions & 2 deletions .CI/latexml/Dockerfile
Expand Up @@ -10,7 +10,7 @@ RUN sed -i s,http://archive.ubuntu.com/ubuntu/,mirror://mirrors.ubuntu.com/mirro
&& REMOTE="http://mirror.ctan.org/systems/texlive/tlnet" \
&& INSTALL="/tmp/install-texlive" \
&& mkdir -p $INSTALL \
&& echo "export PATH=$PATH:/usr/local/texlive/2020/bin" >> /etc/environment \
&& echo "export PATH=$PATH:/usr/local/texlive/2022/bin" >> /etc/environment \
&& curl -sSL $REMOTE/install-tl-unx.tar.gz | tar -xzv -C $INSTALL --strip-components=1 \
&& echo selected_scheme scheme-basic > texlive.profile \
&& echo TEXDIR /usr/local/texlive/ >> texlive.profile \
Expand All @@ -23,7 +23,7 @@ RUN sed -i s,http://archive.ubuntu.com/ubuntu/,mirror://mirrors.ubuntu.com/mirro
&& $INSTALL/install-tl --profile texlive.profile \
&& rm texlive.profile \
&& tlmgr update --self --all --reinstall-forcibly-removed \
&& tlmgr install latexmk listings caption cleveref xcolor float multirow tocloft parskip etoolbox index biblatex biber newtxtt \
&& tlmgr install latexmk listings caption cleveref xcolor float multirow tocloft parskip etoolbox index biblatex biber newtxtt txfonts \
&& cpanm JSON \
&& cpanm LaTeXML \
&& apt-get autoremove -qy make gcc curl wget git cpanminus libxml2-dev libxslt-dev \
Expand Down
5 changes: 0 additions & 5 deletions .CI/latexml/Dockerfile.2.incremental

This file was deleted.

10 changes: 0 additions & 10 deletions .CI/latexml/Dockerfile.incremental

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
@@ -1,7 +1,8 @@
<img src="https://github.com/modelica/MA-Logos/raw/master/HighRes/Modelica_Language.svg?sanitize=true" width="250px"/>

# ModelicaSpecification
This repository contains the Modelica Language Specification, hosted at https://github.com/modelica/ModelicaSpecification. Development is organized within the [Modelica Association Project Language (MAP-LANG)](https://modelica.org/projects).
This repository contains the Modelica Language Specification, hosted at https://github.com/modelica/ModelicaSpecification.
Development is organized within the [Modelica Association Project Language (MAP-Lang)](https://modelica.org/projects) according to the [project rules](https://github.com/modelica/MAP-Lang_ProjectRules/blob/main/MAP-Lang-ProjectRules.md).

## Description

Expand Down
72 changes: 40 additions & 32 deletions chapters/annotations.tex
Expand Up @@ -388,7 +388,7 @@ \section{Simulations}\label{annotations-for-simulations}\label{simulations}
\hline
\hline
\lstinline!experiment! & Simulation experiment settings & \Cref{modelica:experiment}\\
\lstinline!HideResult! & Don't show component's simulator result & \Cref{modelica:HideResult}\\
\lstinline!HideResult! & Don't show component's simulation result & \Cref{modelica:HideResult}\\
\lstinline!TestCase! & Information for model used as test case & \Cref{modelica:TestCase}\\
\hline
\end{tabular}
Expand Down Expand Up @@ -417,7 +417,7 @@ \section{Simulations}\label{annotations-for-simulations}\label{simulations}
"HideResult" "=" ( false | true )
\end{lstlisting}\end{synopsis}
\begin{semantics}
\lstinline!HideResult = true! defines that the model developer proposes to not show the simulator results of the corresponding component.
\lstinline!HideResult = true! defines that the model developer proposes to not show the simulation results of the corresponding component.

\lstinline!HideResult = false! defines that the developer proposes to show the corresponding component.

Expand Down Expand Up @@ -587,9 +587,7 @@ \subsubsection{Coordinate Systems}\label{coordinate-systems}
i.e.\ a coordinate system with width 20 units and height 20 units.
\end{example}

The coordinate systems for the icon and diagram layers are by default
defined as follows; where the array of \lstinline!GraphicsItem! represents an
ordered list of graphical primitives.
The coordinate systems for the icon and diagram layers are by default defined as follows; where the array of \lstinline!GraphicItem! represents an ordered list of graphical primitives.

\begin{lstlisting}[language=modelica]
record Icon "Representation of the icon layer"
Expand Down Expand Up @@ -758,12 +756,19 @@ \subsection{Extends-Clause}\label{extends-clause}

\begin{itemize}
\item
If the extent of the \lstinline!extends!-clause defines a null region (the default), the base class contents is mapped to the same coordinates in the derived class, and the coordinate system (including \lstinline!preserveAspectRatio!) can be inherited as described in \cref{coordinate-systems}.
If the \lstinline!extent! is \lstinline!{{0, 0}, {0, 0}}! (the default), the base class contents is mapped to the same coordinates in the derived class, and the coordinate system (including \lstinline!preserveAspectRatio!) can be inherited as described in \cref{coordinate-systems}.
\item
If the extent of the \lstinline!extends!-clause defines a non-null region, the base class coordinate system is mapped to the region specified by the attribute extent, if \lstinline!preserveAspectRatio! is true for the base class the mapping shall preserve the aspect ratio.
For any other \lstinline!extent!, the base class coordinate system is mapped to this region, with the exception that \lstinline!preserveAspectRatio = true! in the base class requires that the mapping shall preserve the aspect ratio.
The base class coordinate system (and \lstinline!preserveAspectRatio!) is not inherited.
\end{itemize}

\begin{nonnormative}
A zero area \lstinline!extent! other than \lstinline!{{0, 0}, {0, 0}}! will result in none of the base class contents being visible.
By affecting components and connections as well as graphical primitives, this is different from setting \lstinline!primitivesVisible = false!.

Reversed corners of the \lstinline!extent! will result in mirrored (rotated if reversed in both direction) base class contents.
\end{nonnormative}

\begin{example}
\begin{lstlisting}[language=modelica]
model A
Expand Down Expand Up @@ -1153,7 +1158,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
\end{lstlisting}

The \fmtannotationindex{preferredView} annotation defines the default view when selecting the class.
The $\mathit{view}$ is a \lstinline!String! literal where \lstinline!"info"! means class documentation (``information''), \lstinline!"diagram"! means diagram view, \lstinline!"icon" means icon view, and \lstinline!"text"! means Modelica source code (``text'').
The $\mathit{view}$ is a \lstinline!String! literal where \lstinline!"info"! means class documentation (``information''), \lstinline!"diagram"! means diagram view, \lstinline!"icon"! means icon view, and \lstinline!"text"! means Modelica source code (``text'').

\begin{lstlisting}[language=grammar]
documentation-class-annotation:
Expand All @@ -1175,6 +1180,9 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
\annotationindex{defaultComponentName}

When creating a component of the given class, the recommended component name is \emph{name}.
If the default name cannot be used (e.g., since it is already in use) another name can be used automatically.
One way is to append the lowest strictly positive integer suffix giving a usable name - after removing any potential trailing \lstinline!1! from the default name.
However, see also below under \lstinline!defaultComponentPrefixes!.

\begin{lstlisting}[language=modelica]
annotation(defaultComponentPrefixes = "prefixes")
Expand Down Expand Up @@ -1644,9 +1652,9 @@ \subsection{Version Handling}\label{version-handling}
noneFromVersion = "3.1 Beta 1",
noneFromVersion = "3.1 Beta 2",
from(version = {"2.1", "2.2", "2.2.1"},
script = "convertTo3.mos"),
script = "convertTo3.mos"),
from(version = "1.5",
script = "convertFromModelica1_5.mos")
script = "convertFromModelica1_5.mos")
));
end Modelica;

Expand All @@ -1660,13 +1668,11 @@ \subsection{Version Handling}\label{version-handling}

model B
$\ldots$
annotation(uses(Modelica(version = "3.1 Beta 1")));
annotation(
uses(Modelica(version = "3.1 Beta 1")));
end B;
\end{lstlisting}
In this example the model \lstinline!A! uses an older version of the
Modelica library and can be upgraded using the given script, and model
\lstinline!B! uses an older version of the Modelica library but no changes are
required when upgrading.
In this example the model \lstinline!A! uses an older version of the Modelica library and can be upgraded using the given script, and model \lstinline!B! uses an older version of the Modelica library but no changes are required when upgrading.
\end{example}


Expand Down Expand Up @@ -1837,14 +1843,13 @@ \subsubsection{Conversion Rules}\label{conversion-rules}
convertModifiers("Modelica.Blocks.Math.LinearDependency",
{"y0=0", "k1=0", "k2=0"}, {"y0=%y0%", "k1=%y0%*%k1%", "k2=%y0%*%k2%"},
true);
convertClass(
"Modelica.Electrical.Machines.BasicMachines.QuasiStationaryDCMachines",
"Modelica.Electrical.Machines.BasicMachines.QuasiStaticDCMachines");
convertElement("Modelica.Electrical.Machines.Interfaces.PartialBasicDCMachine",
"quasiStationary", "quasiStatic");
convertElement("Modelica.Electrical.Machines.BasicMachines." +
"QuasiStationaryDCMachines.DC_ElectricalExcited",
"quasiStationary", "quasiStatic");

convertClass("My.Library.BadPackage",
"My.Library.Package");
convertElement("My.Library.BadPackage.PartialBase",
"bad", "correct");
convertElement("My.Library.BadPackage.ActualClass",
"bad", "correct");
\end{lstlisting}
converts
\begin{lstlisting}[language=modelica]
Expand All @@ -1853,12 +1858,12 @@ \subsubsection{Conversion Rules}\label{conversion-rules}
Value = 10, hideConnector = true);
Modelica.Blocks.Math.LinearDependency linearDep(y0 = 2, k2 = 1);
model A
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStationaryDCMachines.DC_ElectricalExcited;
import My.Library;
extends Library.BadPackage.ActualClass;
end A;
model B
extends A;
Boolean b = quasiStationary;
Boolean b = bad;
end B;
\end{lstlisting}
to
Expand All @@ -1868,16 +1873,17 @@ \subsubsection{Conversion Rules}\label{conversion-rules}
number = 10, use_numberPort = not true);
Modelica.Blocks.Math.LinearDependency linearDep(y0 = 2, k1 = 0, k2 = 2);
model A
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStaticDCMachines.DC_ElectricalExcited;
import My.Library;
extends Library.Package.ActualClass;
end A;
model B
extends A;
Boolean b = a.quasiStatic;
Boolean b = correct;
end B;
\end{lstlisting}
The \lstinline!convertElement! call for \lstinline!DC_ElectricalExcited! is needed to avoid relying on base classes in the original library where \lstinline!DC_ElectricalExcited! inherits from \lstinline!PartialBasicDCMachine!.
The \lstinline!convertElement! call for \lstinline!ActualClass! is needed to avoid relying on base classes in the original library where \lstinline!ActualClass! inherits from \lstinline!PartialBase!.
However, the inheritance among the models to convert (in this case \lstinline!B! inherits from \lstinline!A!) should be handled.
Note that conversion works regardless of the import of \lstinline!My.Library!.
\end{example}

\paragraph*{convertMessage("OldClass", "Failed Message")}\label{convertmessageoldclass-failed-message}\annotationindex{convertMessage}
Expand Down Expand Up @@ -2001,11 +2007,13 @@ \subsection{Version Date and Build Information}\label{version-date-and-build-inf
end Modelica;

model M1
annotation(uses(Modelica(version = "3.0.1"))); // Common case
annotation(
uses(Modelica(version = "3.0.1"))); // Common case
end M1

model M2
annotation(uses(Modelica(version = "3.0.1", versionBuild = 4)));
annotation(
uses(Modelica(version = "3.0.1", versionBuild = 4)));
end M2
\end{lstlisting}
\end{example}
Expand Down
8 changes: 4 additions & 4 deletions chapters/arrays.tex
Expand Up @@ -1010,7 +1010,7 @@ \section{Indexing}\label{array-indexing}\label{indexing}
\end{center}
\end{table}

\subsection{Indexing with Boolean or Enumeration Values}\label{indexing-with-boolean-or-enumeration-values}
\subsection{Boolean or Enumeration Indices}\label{boolean-or-enumeration-indices}

Arrays can be indexed using values of enumeration types or the \lstinline!Boolean! type, not only by \lstinline!Integer!. The type of the index should correspond to
the type used for declaring the dimension of the array.
Expand Down Expand Up @@ -1079,7 +1079,7 @@ \subsection{Equality and Assignment}\label{equality-and-assignment}
\end{center}
\end{table}

\subsection{Element-wise Addition, Subtraction, and String Concatenation}\label{array-element-wise-addition-subtraction-and-string-concatenation}\label{element-wise-addition-subtraction-and-string-concatenation}
\subsection{Addition, Subtraction, and String Concatenation}\label{array-element-wise-addition-subtraction-and-string-concatenation}\label{addition-subtraction-and-string-concatenation}

Addition \lstinline!a + b! and subtraction \lstinline!a - b! of numeric scalars, vectors, matrices,
and arrays is defined element-wise and require \lstinline!size(a) = size(b)! and a
Expand Down Expand Up @@ -1222,7 +1222,7 @@ \subsection{Multiplication of Matrices and Vectors}\label{matrix-and-vector-mult
\end{lstlisting}
\end{example}

\subsection{Division of Scalars or Numeric Arrays by Numeric Scalars}\label{division-of-scalars-or-numeric-arrays-by-numeric-scalars}
\subsection{Division by Numeric Scalars}\label{division-by-numeric-scalars}

Division \lstinline!a / s! of numeric scalars, vectors, matrices, or arrays \lstinline!a! and numeric scalars \lstinline!s! is defined element-wise.
The result is always of \lstinline!Real! type. In order to get integer division with truncation, use the function \lstinline!div!.
Expand Down Expand Up @@ -1278,7 +1278,7 @@ \subsection{Element-wise Division}\label{array-element-wise-division}\label{elem
This is a consequence of the parsing rules, since `\lstinline!2.!' is a lexical unit. Using a space after the literal solves the problem.
\end{example}

\subsection{Exponentiation of Scalars of Numeric Elements}\label{exponentiation-of-scalars-of-numeric-elements}
\subsection{Element-wise Exponentiation}\label{element-wise-exponentiation}

Exponentiation \lstinline!a ^ b! is defined as \lstinline[language=C]!pow(double a, double b)! in the ANSI~C library if both \lstinline!a! and \lstinline!b! are
\lstinline!Real! scalars. A \lstinline!Real! scalar value is returned. If \lstinline!a! or \lstinline!b! are \lstinline!Integer! scalars, they are
Expand Down

0 comments on commit 6033119

Please sign in to comment.