Skip to content

Commit 0f11faa

Browse files
authored
Merge pull request #2551 from modelica/cleanup/nonnormative
Move nonnormative content to separate paragraphs Since there are lots of commits for different files with relevant commit messages I preferred to not squash.
2 parents ad7aebd + 8051866 commit 0f11faa

24 files changed

+2203
-2226
lines changed

Makefile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@
66

77
all: MLS.pdf MLS.html
88

9-
clean:
9+
.PHONY: clean-pdf
10+
clean-pdf:
1011
rm *.aux MLS.log MLS.toc MLS.pdf
11-
rm MLS.xml *.html
1212

13-
MLS.pdf: *.tex
13+
.PHONY: clean-html
14+
clean-html:
15+
rm MLS.xml LaTeXML.cache *.html
16+
17+
.PHONY: clean
18+
clean: clean-pdf clean-html
19+
20+
MLS.pdf: *.tex chapters/*.tex
1421
pdflatex MLS.tex
1522

1623
# Seems to be some issue with graphicpath, so set path here as well
17-
MLS.html: *.tex
18-
$(LATEXMLPREFIX)latexml MLS.tex --path=media --dest MLS.xml
19-
$(LATEXMLPREFIX)latexmlpost MLS.xml -format html -pmml --splitat=chapter --splitnaming=labelrelative --javascript=css/LaTeXML-maybeMathJax.js --navigationtoc=context --css=css/LaTeXML-navbar-left.css --dest MLS.html
24+
%.html: %.tex chapters/*.tex
25+
$(LATEXMLPREFIX)latexml $*.tex --path=media --dest $*.xml
26+
$(LATEXMLPREFIX)latexmlpost $*.xml -format html -pmml --splitat=chapter --splitnaming=labelrelative --javascript=css/LaTeXML-maybeMathJax.js --navigationtoc=context --css=css/LaTeXML-navbar-left.css --dest $@

chapters/annotations.tex

Lines changed: 255 additions & 225 deletions
Large diffs are not rendered by default.

chapters/arrays.tex

Lines changed: 79 additions & 88 deletions
Large diffs are not rendered by default.

chapters/classes.tex

Lines changed: 238 additions & 232 deletions
Large diffs are not rendered by default.

chapters/connectors.tex

Lines changed: 150 additions & 200 deletions
Large diffs are not rendered by default.

chapters/dae.tex

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ \chapter{Modelica DAE Representation}\doublelabel{modelica-dae-representation}
77
Modelica simulation model into a ``flat'' set of Modelica
88
``statements'', consisting of the equation and algorithm sections of all
99
used components by:
10-
1110
\begin{itemize}
1211
\item
1312
expanding all class definitions (flattening the inheritance tree) and
@@ -41,19 +40,19 @@ \chapter{Modelica DAE Representation}\doublelabel{modelica-dae-representation}
4140

4241
\begin{longtable}[]{|p{2cm}|p{12cm}|}
4342
\hline \endhead
44-
\textbf{p} & Modelica variables declared as \emph{parameter} or
45-
\emph{constant}, i.e., variables without any
43+
\textbf{p} & Modelica variables declared as \lstinline!parameter! or
44+
\lstinline!constant!, i.e., variables without any
4645
time-dependency.\\ \hline
47-
\emph{t} & Modelica variable \emph{time}, the independent (real)
46+
\emph{t} & Modelica variable \lstinline!time!, the independent (real)
4847
variable.\\ \hline
49-
\textbf{x}(t) & Modelica variables of type \emph{Real}, appearing
48+
\textbf{x}(t) & Modelica variables of type \lstinline!Real!, appearing
5049
differentiated.\\ \hline
5150
\textbf{m}(t\textsubscript{e}) & Modelica variables of type
52-
\emph{discrete Real, Boolean, Integer} which are unknown. These
51+
\lstinline!discrete Real!, \lstinline!Boolean!, \lstinline!Integer! which are unknown. These
5352
variables change their value only at event instants t\textsubscript{e}.
5453
\lstinline!pre(m)! are the values of m immediately before the current event
5554
occurred.\\ \hline
56-
\textbf{y}(t) & Modelica variables of type \emph{Real} which do not fall
55+
\textbf{y}(t) & Modelica variables of type \lstinline!Real! which do not fall
5756
into any other category (= algebraic variables).\\ \hline
5857
c\textbf{(}t\textsubscript{e}) & The conditions of all if-expressions
5958
generated including when-clauses after conversion, see \autoref{when-equations}).\\ \hline
@@ -74,7 +73,6 @@ \chapter{Modelica DAE Representation}\doublelabel{modelica-dae-representation}
7473
have discontinuities, a variable structure and/or which are controlled
7574
by a discrete-event system. Such types of systems are called
7675
\emph{hybrid DAEs}. Simulation is performed in the following way:
77-
7876
\begin{enumerate}
7977
\item
8078
The DAE (\ref{eq:dae}) is solved by a numerical integration method. In this
@@ -111,7 +109,6 @@ \chapter{Modelica DAE Representation}\doublelabel{modelica-dae-representation}
111109

112110
At an event instant, including the initial event, the model equations
113111
are reinitialized according to the following iteration procedure:
114-
115112
\begin{lstlisting}[language=modelica]
116113
known variables: x, t, p
117114
unkown variables: dx/dt, y, m, pre(m), c

chapters/derivationofstream.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ \subsection{Connection of 3 stream connectors where two mass flow rates are posi
212212
the required flow direction should be defined in the connector instance
213213
with the \lstinline!min! attribute (the \lstinline!max! attribute could be also defined,
214214
however it does not lead to simplifications):
215-
216215
\begin{lstlisting}[language=modelica]
217216
model m2
218217
Fluidport c(m_flow(min=0));

chapters/equations.tex

Lines changed: 115 additions & 130 deletions
Large diffs are not rendered by default.

chapters/functions.tex

Lines changed: 240 additions & 213 deletions
Large diffs are not rendered by default.

chapters/inheritance.tex

Lines changed: 83 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ \section{Inheritance---Extends Clause}\doublelabel{inheritance-extends-clause}
1818
The extends-clause is used to specify inheritance from a base class into
1919
an (enclosing) class containing the extends-clause. The syntax of the
2020
extends-clause is as follows:
21-
2221
\begin{lstlisting}[language=grammar]
2322
extends-clause :
2423
extends name [ class-modification ] [annotation]
@@ -79,12 +78,11 @@ \section{Inheritance---Extends Clause}\doublelabel{inheritance-extends-clause}
7978
yields an instance with \lstinline!bcomp.b = 3!, which overrides \lstinline!b = 2!.
8079
\end{nonnormative}
8180

82-
The declaration elements of the flattened base class shall either
83-
81+
The declaration elements of the flattened base class shall either:
8482
\begin{itemize}
8583
\item
8684
Not already exist in the partially flattened enclosing class
87-
{[}\emph{i.e., have different names}{]} .
85+
(i.e., have different names).
8886
\item
8987
The new element is a long form of redeclare or uses the \lstinline!class extends A! syntax, see \autoref{redeclaration}.
9088
\item
@@ -118,9 +116,11 @@ \section{Inheritance---Extends Clause}\doublelabel{inheritance-extends-clause}
118116
to equations in the flattened enclosing class are discarded. This
119117
feature is deprecated, and it is recommend to give a warning when
120118
discarding them and for the future give a warning about all forms of
121-
equivalent equations due to inheritance. {[}\emph{Note: equations that
122-
are mathematically equivalent but not syntactically equivalent are not
123-
discarded, hence yield an overdetermined system of equations.}{]}
119+
equivalent equations due to inheritance.
120+
121+
\begin{nonnormative}
122+
Equations that are mathematically equivalent but not syntactically equivalent are not discarded, hence yield an overdetermined system of equations.
123+
\end{nonnormative}
124124

125125
\subsection{Multiple Inheritance}\doublelabel{multiple-inheritance}
126126

@@ -193,21 +193,28 @@ \subsection{Restrictions on the Kind of Base Class}\doublelabel{restrictions-on-
193193

194194
If a derived class is inherited from another type of specialized class,
195195
then the result is a specialized class of the derived class type.
196-
{[}\emph{For example, if a} \lstinline!block! \emph{inherits from a} \lstinline!record! \emph{, then the result
197-
is a} \lstinline!block!\emph{.}{]}
198196

199-
All specialized classes can be derived from \lstinline!class! {[}\emph{provided the
200-
resulting class fulfills the restriction of the specialized class. It is
201-
recommended to use the most specific specialized class.}{]} A \lstinline!class! may
197+
\begin{nonnormative}
198+
For example, if a \lstinline!block! inherits from a \lstinline!record!, then the result is a \lstinline!block!.
199+
\end{nonnormative}
200+
201+
All specialized classes can be derived from \lstinline!class!, provided that the
202+
resulting class fulfills the restriction of the specialized class. A \lstinline!class! may
202203
only contain class-definitions, annotations, and extends-clauses (having
203204
any other contents is deprecated).
204205

206+
\begin{nonnormative}
207+
It is recommended to use the most specific specialized class.
208+
\end{nonnormative}
209+
205210
The specialized classes \lstinline!package!, \lstinline!operator!, \lstinline!function!,
206211
\lstinline!type,! \lstinline!record!,
207-
\lstinline!operator record,! and expandable connector can only be derived from their
208-
own kind {[}\emph{(e.g. a package can only be base class for packages.
209-
All other kinds of classes can use the import statement to use the
210-
contents of a package)}{]} and from \lstinline!class!\emph{.}
212+
\lstinline!operator record!, and \lstinline!expandable connector! can only be derived from their
213+
own kind and from \lstinline!class!.
214+
215+
\begin{nonnormative}
216+
E.g. a package can only be base class for packages. All other kinds of classes can use the import statement to use the contents of a package.
217+
\end{nonnormative}
211218

212219
\begin{example}
213220
\begin{lstlisting}[language=modelica]
@@ -237,19 +244,25 @@ \subsection{Restrictions on Base Classes and Constraining Types to be Transitive
237244

238245
The class name used after extends for base-classes and for constraining
239246
classes must use a class reference considered transitively
240-
non-replaceable, see definition in \autoref{transitively-non-replaceable}. {[}\emph{This
241-
formulation excludes the long form of redeclare, i.e.} \lstinline!redeclare model extends M...! \emph{where} \lstinline!M! \emph{must be an inherited replaceable
242-
class.}{]} For a replaceable component declaration without constraining
247+
non-replaceable, see definition in \autoref{transitively-non-replaceable}.
248+
For a replaceable component declaration without constraining
243249
clause the class must use a class reference considered transitively
244-
non-replaceable. {[}\emph{This implies that constraining classes are
245-
always transitively non-replaceable -- both if explicitly given or
246-
implicitly by the declaration.}{]}
250+
non-replaceable.
251+
252+
\begin{nonnormative}
253+
The requirement to use a transitively non-replaceable name excludes the long form of redeclare, i.e. \lstinline!redeclare model extends M...! where
254+
\lstinline!M! must be an inherited replaceable class.
255+
\end{nonnormative}
256+
257+
\begin{nonnormative}
258+
The rule for a replaceable component declaration without constraining clause implies that constraining classes are always transitively non-replaceable --- both
259+
if explicitly given or implicitly by the declaration.
260+
\end{nonnormative}
247261

248262
\section{Modifications}\doublelabel{modifications}
249263

250264
There are three kinds of constructs in the Modelica language in which
251265
modifications can occur:
252-
253266
\begin{itemize}
254267
\item
255268
Variable declarations.
@@ -272,14 +285,14 @@ \section{Modifications}\doublelabel{modifications}
272285
\end{lstlisting}
273286
\end{example}
274287

275-
A modification (i.e. C1 c1(x = 5) is considered a modification equation,
276-
if the modified variable is a non-parameter (here: c1.x) variable.
277-
{[}\emph{This equation is created, if the modified component (here: c1)
278-
is also created (see \autoref{class-declarations}). In most cases a
279-
modification equation for a non-parameter variable requires that the
280-
variable was declared with a declaration equation, see \autoref{balanced-models};
281-
in those cases the declaration equation is replaced by the
282-
modification equation.}{]}
288+
A modification (e.g. \lstinline!C1 c1(x = 5)!) is considered a modification equation,
289+
if the modified variable (here: \lstinline!c1.x!) is a non-parameter variable.
290+
291+
\begin{nonnormative}
292+
The modification equation is created, if the modified component (here: \lstinline!c1!) is also created (see \autoref{class-declarations}). In most cases
293+
a modification equation for a non-parameter variable requires that the variable was declared with a declaration equation, see \autoref{balanced-models};
294+
in those cases the declaration equation is replaced by the modification equation.
295+
\end{nonnormative}
283296

284297
A more dramatic change is to modify the \emph{type} and/or the
285298
\emph{prefixes} and possibly the \emph{dimension sizes} of a declared
@@ -328,8 +341,11 @@ \subsection{Modification Environment}\doublelabel{modification-environment}
328341
The modification environment contains arguments which modify elements of
329342
the class (e.g., parameter changes). The modification environment is
330343
built by merging class modifications, where outer modifications override
331-
inner modifications. {[}\emph{Note: this should not be confused with}
332-
\lstinline!inner outer! \emph{prefixes described in \autoref{instance-hierarchy-name-lookup-of-inner-declarations}}{]}
344+
inner modifications.
345+
346+
\begin{nonnormative}
347+
This should not be confused with \lstinline!inner outer! prefixes described in \autoref{instance-hierarchy-name-lookup-of-inner-declarations}.
348+
\end{nonnormative}
333349

334350
\subsection{Merging of Modifications}\doublelabel{merging-of-modifications}
335351

@@ -424,7 +440,7 @@ \subsection{Merging of Modifications}\doublelabel{merging-of-modifications}
424440
A flattening of class \lstinline!C4! will give an object with the following variables:
425441
\begin{longtable}[]{|@{}l|l@{}|}
426442
\hline \endhead
427-
\emph{Variable} & \emph{Default value}\\ \hline
443+
\tablehead{Variable} & \tablehead{Default value}\\ \hline
428444
\lstinline!x1! & \lstinline!none!\\ \hline
429445
\lstinline!x2! & \lstinline!22!\\ \hline
430446
\lstinline!x3.a! & \lstinline!33!\\ \hline
@@ -482,7 +498,6 @@ \subsection{Single Modification}\doublelabel{single-modification}
482498
\subsection{Modifiers for Array Elements}\doublelabel{modifiers-for-array-elements}
483499

484500
The following rules apply to modifiers:
485-
486501
\begin{itemize}
487502
\item
488503
The \lstinline!each! keyword on a modifier requires that it is applied in an array
@@ -547,10 +562,11 @@ \subsection{Final Element Modification Prevention}\doublelabel{final-element-mod
547562
An element defined as final by the \lstinline!final! prefix in an element
548563
modification or declaration cannot be modified by a modification or by a
549564
redeclaration. All elements of a final element are also final.
550-
{[}\emph{Setting the value of a parameter in an experiment environment
551-
is conceptually treated as a modification. This implies that a final
552-
modification equation of a parameter cannot be changed in a simulation
553-
environment}{]}.
565+
566+
\begin{nonnormative}
567+
Setting the value of a parameter in an experiment environment is conceptually treated as a modification. This implies that a final modification equation
568+
of a parameter cannot be changed in a simulation environment.
569+
\end{nonnormative}
554570

555571
\begin{example}
556572
\begin{lstlisting}[language=modelica]
@@ -605,7 +621,6 @@ \section{Redeclaration}\doublelabel{redeclaration}
605621
preserved.
606622

607623
The groups that are valid for both classes and components:
608-
609624
\begin{itemize}
610625
\item
611626
public, protected
@@ -616,7 +631,6 @@ \section{Redeclaration}\doublelabel{redeclaration}
616631
\end{itemize}
617632

618633
The groups that are only valid for components:
619-
620634
\begin{itemize}
621635
\item
622636
flow, stream
@@ -675,23 +689,25 @@ \subsection{The class extends Redeclaration Mechanism}\doublelabel{the-class-ext
675689
where \lstinline!class! as usual can be replaced by any other specialized class,
676690
replaces the inherited class \lstinline!B! with another declaration that extends the
677691
inherited class where the optional class-modification is applied to the
678-
inherited class. {[}\emph{Since this implies that all declarations are
679-
inherited with modifications applied there is no need to apply modifiers
680-
to the new declaration.}{]} Inherited B here means that the class
681-
containing \lstinline!redeclare class extends! B(\ldots{}) should also inherit
682-
another declaration of B from one of its extends-clauses. The new
692+
inherited class. Inherited \lstinline!B! here means that the class
693+
containing \lstinline!redeclare class extends B(...)! should also inherit
694+
another declaration of \lstinline!B! from one of its extends-clauses. The new
683695
declaration should explicitly include redeclare.
684696

697+
\begin{nonnormative}
698+
Since the rule about applying the optional class-modification implies that all declarations are inherited with modifications applied, there is no need
699+
to apply modifiers to the new declaration.
700+
\end{nonnormative}
701+
685702
For \lstinline!redeclare class extends B(...)! the inherited class is subject
686703
to the same restrictions as a redeclare of the inherited element, and
687-
the original class B should be replaceable, and the new element is only
704+
the original class \lstinline!B! should be replaceable, and the new element is only
688705
replaceable if the new definition is replaceable. In contrast to normal
689-
extends it is not subject to the restriction that B should be
690-
transitively non-replaceable (since B should be replaceable).
706+
extends it is not subject to the restriction that \lstinline!B! should be
707+
transitively non-replaceable (since \lstinline!B! should be replaceable).
691708

692709
The syntax rule for \lstinline!class extends! construct is in the definition of the
693710
\lstinline!class-specifier! nonterminal (see also class declarations in \autoref{class-declarations}):
694-
695711
\begin{lstlisting}[language=grammar]
696712
class-definition :
697713
[ encapsulated ] class-prefixes
@@ -842,7 +858,6 @@ \subsection{Constraining Type}\doublelabel{constraining-type}
842858

843859
If the \lstinline!constraining-clause! is not present in the original declaration
844860
(i.e., the non-redeclared declaration):
845-
846861
\begin{itemize}
847862
\item
848863
The type of the declaration is also used as a constraining type.
@@ -984,9 +999,11 @@ \subsubsection{Constraining-clause annotations}\doublelabel{constraining-clause-
984999

9851000
Description and annotations on the constraining-clause are applied to
9861001
the entire declaration, and it is an error if they also appear on the
987-
definition. \emph{{[}The intent is that the description and/or
988-
annotation are at the end of the declaration, but it is not
989-
straightforward to specify this in the grammar.{]}}
1002+
definition.
1003+
1004+
\begin{nonnormative}
1005+
The intent is that the description and/or annotation are at the end of the declaration, but it is not straightforward to specify this in the grammar.
1006+
\end{nonnormative}
9901007

9911008
\begin{example}
9921009
\begin{lstlisting}[language=modelica]
@@ -1006,27 +1023,27 @@ \subsection{Restrictions on Redeclarations}\doublelabel{restrictions-on-redeclar
10061023

10071024
The following additional constraints apply to redeclarations (after
10081025
prefixes are inherited, \autoref{redeclaration}):
1009-
1010-
Only classes and components declared as replaceable can be redeclared
1011-
with a new type {[}\emph{redeclaration with the same type can be used to
1012-
restrict variability and/or change array dimensions}{]}, which must have
1013-
an interface compatible with the constraining interface of the original
1014-
declaration, and to allow further redeclarations one must use
1015-
\lstinline!redeclare replaceable!.
1016-
10171026
\begin{itemize}
10181027
\item
1019-
an element declared as constant cannot be redeclared
1028+
Only classes and components declared as replaceable can be redeclared with a new type, which must have an interface compatible with the constraining
1029+
interface of the original declaration, and to allow further redeclarations one must use \lstinline!redeclare replaceable!.
1030+
\begin{nonnormative}
1031+
Redeclaration with the same type can be used to restrict variability and/or change array dimensions.
1032+
\end{nonnormative}
1033+
\item
1034+
An element declared as constant cannot be redeclared
10201035
\item
1021-
an element declared as final may not be modified, and thus not
1036+
An element declared as final may not be modified, and thus not
10221037
redeclared
10231038
\item
10241039
Modelica does not allow a protected element to be redeclared as
10251040
public, or a public element to be redeclared as protected.
10261041
\item
10271042
Array dimensions may be redeclared; provided the sub-typing rules in
1028-
\autoref{interface-compatibility-or-subtyping} are satisfied. {[}\emph{This is one example of redeclare of
1029-
non-replaceable elements.}{]}
1043+
\autoref{interface-compatibility-or-subtyping} are satisfied.
1044+
\begin{nonnormative}
1045+
This is one example of redeclare of non-replaceable elements.
1046+
\end{nonnormative}
10301047
\end{itemize}
10311048

10321049
\subsection{Annotation Choices for Suggested Redeclarations and Modifications}\doublelabel{annotation-choices-for-suggested-redeclarations-and-modifications}

0 commit comments

Comments
 (0)