Skip to content

Commit

Permalink
Replace 'may not' by 'shall not'
Browse files Browse the repository at this point in the history
And in some cases 'cannot',
and in one case rewrite it completely.
Closes #901
  • Loading branch information
HansOlsson committed Oct 9, 2020
1 parent 60488b7 commit def54a6
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 52 deletions.
14 changes: 7 additions & 7 deletions chapters/classes.tex
Expand Up @@ -17,8 +17,8 @@ \section{Access Control -- Public and Protected Elements}\label{access-control-p
Members of a Modelica class can have two levels of visibility: \lstinline!public! or
\lstinline!protected!. The default is \lstinline!public! if nothing else is specified

A protected element, \lstinline!P!, in classes and components may not be accessed via dot notation (e.g., \lstinline!A.P!, \lstinline!a.P!, \lstinline!a[1].P!, \lstinline!a.b.P!,
\lstinline!.A.P!; but there is no restriction on using \lstinline!P! or \lstinline!P.x! for a protected element \lstinline!P!). They may not be modified or redeclared except for
A protected element, \lstinline!P!, in classes and components shall not be accessed via dot notation (e.g., \lstinline!A.P!, \lstinline!a.P!, \lstinline!a[1].P!, \lstinline!a.b.P!,
\lstinline!.A.P!; but there is no restriction on using \lstinline!P! or \lstinline!P.x! for a protected element \lstinline!P!). They shall not be modified or redeclared except for
modifiers applied to protected elements in a base-class modification (not inside any component or class) and the modifier on the declaration of the protected element.

\begin{example}
Expand Down Expand Up @@ -237,7 +237,7 @@ \subsubsection{Prefix Rules}\label{prefix-rules}
of the component (this is done after verifying that the type prefixes
occurring on elements of the component are correct; e.g.\ the \lstinline!flow! prefix
can be used on a record component and all the record elements will
generate zero-sum equations, even if elements of a record may not be
generate zero-sum equations, even if elements of a record shall not be
declared with the flow prefix). When any of the type prefixes \lstinline!flow!,
\lstinline!stream!, \lstinline!input! and \lstinline!output! are applied for a structured component, no
element of the component may have any of these type prefixes.
Expand Down Expand Up @@ -388,7 +388,7 @@ \subsection{Component Variability Prefixes discrete, parameter, constant}\label{

If a \lstinline!Real! variable is declared with the prefix \lstinline!discrete! it must in a
simulation model be assigned in a when-clause, either by an assignment
or an equation. The variable assigned in a when-clause may not be
or an equation. The variable assigned in a when-clause shall not be
defined in a sub-component of model or block specialized class.
(This is to keep the property of balanced models.)

Expand Down Expand Up @@ -531,7 +531,7 @@ \subsection{Conditional Component Declaration}\label{conditional-component-decla
A parameter-expression is required since it shall be evaluated at compile time.
\end{nonnormative}

A redeclaration of a component may not include a condition attribute;
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}).

Expand Down Expand Up @@ -802,7 +802,7 @@ \section{Specialized Classes}\label{specialized-classes}
(additional restrictions on inheritance are in \cref{restrictions-on-the-kind-of-base-class}):
\begin{itemize}
\item \lstinline!record! --
Only public sections are allowed in the definition or in any of its components (i.e., \lstinline!equation!, \lstinline!algorithm!, \lstinline!initial equation!, \lstinline!initial algorithm! and \lstinline!protected! sections are not allowed). The elements of a record may not have prefixes \lstinline!input!, \lstinline!output!, \lstinline!inner!, \lstinline!outer!, \lstinline!stream,! or \lstinline!flow!. Enhanced with implicitly available record constructor function, see \cref{record-constructor-functions}. The components directly declared in a record may only be of specialized class record or type.
Only public sections are allowed in the definition or in any of its components (i.e., \lstinline!equation!, \lstinline!algorithm!, \lstinline!initial equation!, \lstinline!initial algorithm! and \lstinline!protected! sections are not allowed). The elements of a record shall not have prefixes \lstinline!input!, \lstinline!output!, \lstinline!inner!, \lstinline!outer!, \lstinline!stream,! or \lstinline!flow!. Enhanced with implicitly available record constructor function, see \cref{record-constructor-functions}. The components directly declared in a record may only be of specialized class record or type.

\item \lstinline!type! --
May only be predefined types, enumerations, array of type, or classes extending from type.
Expand All @@ -828,7 +828,7 @@ \section{Specialized Classes}\label{specialized-classes}
\item \lstinline!connector! --
Only public sections are allowed in the definition or in any of its components (i.e., \lstinline!equation!, \lstinline!algorithm!, \lstinline!initial equation!, \lstinline!initial algorithm! and \lstinline!protected! sections are not allowed).

Enhanced to allow \lstinline!connect! to components of connector classes. The elements of a connector may not have prefixes \lstinline!inner!, or \lstinline!outer!. May only contain components of specialized class \lstinline!connector!, \lstinline!record! and \lstinline!type!.
Enhanced to allow \lstinline!connect! to components of connector classes. The elements of a connector shall not have prefixes \lstinline!inner!, or \lstinline!outer!. May only contain components of specialized class \lstinline!connector!, \lstinline!record! and \lstinline!type!.

\item \lstinline!package! --
May only contain declarations of classes and constants. Enhanced to allow \lstinline!import! of elements of packages. (See also \cref{packages} on packages.)
Expand Down
12 changes: 6 additions & 6 deletions chapters/connectors.tex
Expand Up @@ -221,7 +221,7 @@ \subsection{Expandable Connectors}\label{expandable-connectors}
\end{example}

\item
An expandable connector may not contain a component declared with the
An expandable connector shall not contain a component declared with the
prefix \lstinline!flow!, but may contain non-expandable connector components with
\lstinline!flow! components.
\begin{example}
Expand Down Expand Up @@ -268,7 +268,7 @@ \subsection{Expandable Connectors}\label{expandable-connectors}
\end{example}

An expandable connector array component for which \lstinline!size! is not defined (see \cref{array-dimension-and-size-functions}) is referred to as a \emph{sizeless array component}. Such a
component may not be used without subscripts, and the subscripts must slice the array so that the sizeless dimensions are removed.
component shall not be used without subscripts, and the subscripts must slice the array so that the sizeless dimensions are removed.

\begin{example}
Valid and invalid uses of sizeless array components:
Expand Down Expand Up @@ -589,13 +589,13 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne
\begin{itemize}
\item
The connect-equations (and the special functions for overdetermined
connectors) may only be used in equations and may not be used inside
connectors) can only be used in equations and shall not be used inside
if-equations with non-parametric condition, or in when-equations.
\begin{nonnormative}
For-equations always have parameter expressions for the array expression.
\end{nonnormative}
\item
A connector component may not be declared with the prefix parameter or
A connector component shall not be declared with the prefix parameter or
constant. In the connect-equation the primitive components may only
connect parameter variables to parameter variables and constant
variables to constant variables.
Expand Down Expand Up @@ -642,7 +642,7 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne
\item
Variables from a protected outside connector must be part of a
connection set containing at least one inside connector or one
declared public outside connector (i.e.\ it may not be an implicitly
declared public outside connector (i.e.\ it shall not be an implicitly
defined part of an expandable connector).
\begin{nonnormative}
Otherwise it would not be possible to deduce the causality for the expandable connector element.
Expand All @@ -651,7 +651,7 @@ \section{Restrictions of Connections and Connectors}\label{restrictions-of-conne
In a connection set all variables having non-empty quantity attribute
must have the same quantity attribute.
\item
A \lstinline!connect! equation may not (directly or indirectly) connect two
A \lstinline!connect! equation shall not (directly or indirectly) connect two
connectors of \lstinline!outer! elements.
\begin{nonnormative}
Indirectly is similar to them being part of the same connection set. However, connections to \lstinline!outer! elements are ``moved up'' before forming
Expand Down
6 changes: 3 additions & 3 deletions chapters/equations.tex
Expand Up @@ -279,7 +279,7 @@ \subsubsection{Restrictions on Equations within When-Equations}\label{restrictio

\begin{itemize}
\item
When-equations may not occur inside initial equations.
When-equations shall not occur inside initial equations.
\item
When-equations cannot be nested.
\end{itemize}
Expand Down Expand Up @@ -354,7 +354,7 @@ \subsubsection{Application of the Single-assignment Rule to When-Equations}\labe
when-equations:
\begin{itemize}
\item
Two when-equations may \emph{not} define the same variable.
Two when-equations shall \emph{not} define the same variable.

\begin{nonnormative}
Without this rule this may actually happen for the erroneous
Expand Down Expand Up @@ -842,7 +842,7 @@ \section{Initialization, initial equation, and initial algorithm}\label{initiali
\lstinline!fixed = false!) in order to compute a solution numerically.

It may be difficult for a user to figure out how many initial equations have to be added, especially if the system has a higher index. A tool may add or remove initial equations
automatically such that the resulting system is structurally nonsingular. In these cases diagnostics are appropriate since the result is not unique and may not be what the user
automatically such that the resulting system is structurally nonsingular. In these cases diagnostics are appropriate since the result is not unique and not necessarily what the user
expects. A missing initial value of a discrete-time variable which does not influence the simulation result, may be automatically set to the \lstinline!start! value or its default without
informing the user. For example, variables assigned in a when-clause which are not accessed outside of the when-clause and where \lstinline!pre! is not explicitly
used on these variables, do not have an effect on the simulation.
Expand Down
30 changes: 15 additions & 15 deletions chapters/functions.tex
Expand Up @@ -136,11 +136,11 @@ \section{Function as a Specialized Class}\label{function-as-a-specialized-class}
All public variables are formal parameters.
\item
Input formal parameters are read-only after being bound to the actual
arguments or default values, i.e., they may not be assigned values in
arguments or default values, i.e., they shall not be assigned values in
the body of the function.
\item
A function may \emph{not be used in connections}, may not have
\emph{equations}, may not have \emph{initial algorithms}.
A function shall \emph{not be used in connections}, shall not have
\emph{equations}, shall not have \emph{initial algorithms}.
\item
A function can have at most \emph{one algorithm} section or \emph{one
external function interface} (not both), which, if present, is the
Expand All @@ -152,12 +152,12 @@ \section{Function as a Specialized Class}\label{function-as-a-specialized-class}
\lstinline!model!, \lstinline!block!, \lstinline!operator! or \lstinline!connector!
components.
\item
The elements of a function may not have prefixes \lstinline!inner!, or \lstinline!outer!.
The elements of a function shall not have prefixes \lstinline!inner!, or \lstinline!outer!.
\item
A function may have zero or one external function interface, which, if
present, is the external definition of the function.
\item
For a function to be called in a simulation model, the function may
For a function to be called in a simulation model, the function shall
not be partial, and the output variables must be assigned inside the
function either in binding equations or in an algorithm section,
or have an external function interface as its body, or be defined as a
Expand Down Expand Up @@ -380,7 +380,7 @@ \section{Pure Modelica Functions}\label{pure-modelica-functions}

Examples of restrictions on optimizing pure functions:
\begin{lstlisting}[language=modelica]
Real x=if noEvent(abs(x))<1 then asin(x) else 0; // May not move asin(x) out of then
Real x=if noEvent(abs(x))<1 then asin(x) else 0; // Cannot move asin(x) out of then
algorithm
assertCheck(p, T); // Must call function
algorithm
Expand All @@ -389,7 +389,7 @@ \section{Pure Modelica Functions}\label{pure-modelica-functions}
end if;
y:=y+asin(x);
y:=y+someOtherFunction(x);
// May not evaluate someOtherFunction(x) before asin(x) - unless b is true
// Cannot evaluate someOtherFunction(x) before asin(x) - unless b is true
// The reason is that asin(x) may fail and someOtherFunction may hang,
// and it might be possible to recover from this error.
\end{lstlisting}
Expand Down Expand Up @@ -433,11 +433,11 @@ \subsection{Positional or Named Input Arguments of Functions}\label{positional-o
$N$ slots, where the order of the parameters is given by the order of the component declarations in the function definition. Next, for each named argument \lstinline!identifier = expression!, the
\lstinline!identifier! is used to determine the corresponding slot. The value of the argument is placed in the slot, filling it (it is an error if this slot is already filled). When all arguments
have been processed, the slots that are still unfilled are filled with the corresponding default value of the function definition. The default values may depend on other inputs (these dependencies
must be acyclical in the function) -- the values for those other inputs will then be substituted into the default values (this process may be repeated if the default value for that input depend on another input). The default values for inputs may not depend on non-input variables in the function. The list of filled slots is used as the argument list for the call (it is an error if any
must be acyclical in the function) -- the values for those other inputs will then be substituted into the default values (this process may be repeated if the default value for that input depend on another input). The default values for inputs shall not depend on non-input variables in the function. The list of filled slots is used as the argument list for the call (it is an error if any
unfilled slots still remain).

Special purpose operators with function syntax defined in the
specification may not be called with named arguments, unless otherwise
specification shall not be called with named arguments, unless otherwise
noted.

The type of each argument must agree with the type of the corresponding
Expand Down Expand Up @@ -1348,7 +1348,7 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
containing reals (handled recursively) from the original record. When
using smoothOrder, then the derivative record is automatically
constructed. The function must have at least one input containing reals.
The output list of the derivative function may not be empty.
The output list of the derivative function shall not be empty.

\begin{example}
Here is one example use case with records mixing \lstinline!Real! and
Expand Down Expand Up @@ -1430,7 +1430,7 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
useful to define the function as follows (the additional derivative =
\lstinline!f_general_der! is optional and can be used when the derivative of
the matrix or offset is non-zero). Note that \lstinline!f_der! must have
\lstinline!zeroDerivative! for both \lstinline!y! and \lstinline!offset!, but \lstinline!f_general_der! may not have
\lstinline!zeroDerivative! for both \lstinline!y! and \lstinline!offset!, but \lstinline!f_general_der! shall not have
\lstinline!zeroDerivative! for either of them (it may \lstinline!zeroDerivative! for \lstinline!x_der!,
\lstinline!y_der!, or \lstinline!offset_der!).

Expand Down Expand Up @@ -2207,7 +2207,7 @@ \subsection{Annotations for External Libraries and Include Files}\label{annotati
platforms.

The library on Windows may refer to a lib-file (static library), both a lib- and dll-file (in this case the lib-file is an import-library),
or just a dll-file. It may not refer to an obj-file.
or just a dll-file. It shall not refer to an obj-file.

If the directory for the specific compiler version is missing the
platform specific directory is used.
Expand Down Expand Up @@ -2556,7 +2556,7 @@ \subsubsection{Utility Functions for Allocating Strings}\label{utility-functions
\end{nonnormative}

\begin{nonnormative}
The reason why one may not use, for instance, \lstinline[language=C]!malloc! for string allocation is that a Modelica simulation environment may have
The reason why one should avoid, for instance, \lstinline[language=C]!malloc! for string allocation is that a Modelica simulation environment may have
its own allocation scheme, e.g., a special stack for local variables of a function.
\end{nonnormative}

Expand Down Expand Up @@ -2589,7 +2589,7 @@ \subsection{External Objects}\label{external-objects}
must not require any other calls to be made for the initialization to
be complete (e.g., from an initial algorithm or initial equation). The
destructor shall delete the object, and must not require any other
calls to be made for the deletion to be complete (e.g., from a \lstinline!when terminal()! clause). The constructor may not assume that pointers sent
calls to be made for the deletion to be complete (e.g., from a \lstinline!when terminal()! clause). The constructor shall not assume that pointers sent
to the external object will remain valid for the life-time of the external object. An exception is that if the pointer to another external object is
given as argument to the constructor, that pointer will remain valid as long as the other external object lives.
\begin{nonnormative}
Expand All @@ -2599,7 +2599,7 @@ \subsection{External Objects}\label{external-objects}
\begin{nonnormative}
External objects may be an input (or part of an input) to a function, in that case the destructor is not called (since the external object is active before
and after the function call). Normally this is an external function, but it could be a non-external function as well (e.g.\ calling external functions one
or more times). The function input may not have a default value using the constructor.
or more times). The function input shall not have a default value using the constructor.
\end{nonnormative}
\item
Classes derived from \lstinline!ExternalObject! can neither be used in an
Expand Down
2 changes: 1 addition & 1 deletion chapters/inheritance.tex
Expand Up @@ -1031,7 +1031,7 @@ \subsection{Restrictions on Redeclarations}\label{restrictions-on-redeclarations
\item
An element declared as constant cannot be redeclared
\item
An element declared as final may not be modified, and thus not
An element declared as final shall not be modified, and thus not
redeclared
\item
Modelica does not allow a protected element to be redeclared as
Expand Down

0 comments on commit def54a6

Please sign in to comment.