You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@@ -193,21 +193,28 @@ \subsection{Restrictions on the Kind of Base Class}\doublelabel{restrictions-on-
193
193
194
194
If a derived class is inherited from another type of specialized class,
195
195
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{.}{]}
198
196
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
202
203
only contain class-definitions, annotations, and extends-clauses (having
203
204
any other contents is deprecated).
204
205
206
+
\begin{nonnormative}
207
+
It is recommended to use the most specific specialized class.
208
+
\end{nonnormative}
209
+
205
210
The specialized classes \lstinline!package!, \lstinline!operator!, \lstinline!function!,
206
211
\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}
211
218
212
219
\begin{example}
213
220
\begin{lstlisting}[language=modelica]
@@ -237,19 +244,25 @@ \subsection{Restrictions on Base Classes and Constraining Types to be Transitive
237
244
238
245
The class name used after extends for base-classes and for constraining
239
246
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
243
249
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.
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}
283
296
284
297
A more dramatic change is to modify the \emph{type} and/or the
285
298
\emph{prefixes} and possibly the \emph{dimension sizes} of a declared
\subsection{Modifiers for Array Elements}\doublelabel{modifiers-for-array-elements}
483
499
484
500
The following rules apply to modifiers:
485
-
486
501
\begin{itemize}
487
502
\item
488
503
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
547
562
An element defined as final by the \lstinline!final! prefix in an element
548
563
modification or declaration cannot be modified by a modification or by a
549
564
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.
Description and annotations on the constraining-clause are applied to
986
1001
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}
990
1007
991
1008
\begin{example}
992
1009
\begin{lstlisting}[language=modelica]
@@ -1006,27 +1023,27 @@ \subsection{Restrictions on Redeclarations}\doublelabel{restrictions-on-redeclar
1006
1023
1007
1024
The following additional constraints apply to redeclarations (after
1008
1025
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
-
1017
1026
\begin{itemize}
1018
1027
\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
1020
1035
\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
1022
1037
redeclared
1023
1038
\item
1024
1039
Modelica does not allow a protected element to be redeclared as
1025
1040
public, or a public element to be redeclared as protected.
1026
1041
\item
1027
1042
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}
1030
1047
\end{itemize}
1031
1048
1032
1049
\subsection{Annotation Choices for Suggested Redeclarations and Modifications}\doublelabel{annotation-choices-for-suggested-redeclarations-and-modifications}
0 commit comments