Skip to content

Commit

Permalink
Get rid of some redundant parentheses just filled with dots
Browse files Browse the repository at this point in the history
This is similar to how we simplified 'the der() operator' to just 'der'.
  • Loading branch information
henrikt-ma committed Jun 3, 2020
1 parent 009ff7e commit 4c1b9cb
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 76 deletions.
4 changes: 2 additions & 2 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1914,8 +1914,8 @@ \section{Annotations for Access Control to Protect Intellectual Property}\double
licensing. Obfuscation and encryption are not standardized.
protection and licensing are both defined inside the
\lstinline!Protection! annotation:
\begin{lstlisting}[language=modelica]
annotation(Protection(...));
\begin{lstlisting}[language=modelica,mathescape=true]
annotation(Protection($\ldots$));
\end{lstlisting}

\subsection{Protection of Classes}\doublelabel{protection-of-classes}
Expand Down
14 changes: 8 additions & 6 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,17 @@ \subsubsection{Reduction Expressions}\doublelabel{reduction-expressions}
\hline
\tablehead{Function-name} & \tablehead{Restriction on expression1} & \tablehead{Result if expression2 is empty}\\ \hline
\endhead
\lstinline!sum! & Integer or Real & \lstinline!zeros(...)!\\ \hline
\lstinline!product! & Scalar Integer or Real & \lstinline!1!\\ \hline
\lstinline!min! & Scalar enumeration, Boolean, Integer or Real &
\lstinline!sum! & \lstinline!Integer! or \lstinline!Real! & \lstinline[mathescape=true]!zeros($\ldots$)!\\ \hline
\lstinline!product! & Scalar \lstinline!Integer! or \lstinline!Real! & \lstinline!1!\\ \hline
\lstinline!min! & Scalar enumeration, \lstinline!Boolean!, \lstinline!Integer! or \lstinline!Real! &
\begin{tabular}{@{}p{6cm}@{}}
Greatest value of type\\( \lstinline!Modelica.Constants.inf! for Real)
Greatest value of type\\
(\lstinline!Modelica.Constants.inf! for \lstinline!Real!)
\end{tabular}\\ \hline
\lstinline!max! & Scalar enumeration, Boolean, Integer or Real &
\lstinline!max! & Scalar enumeration, \lstinline!Boolean!, \lstinline!Integer! or \lstinline!Real! &
\begin{tabular}{@{}p{6cm}@{}}
Least value of type\\ ( \lstinline!-Modelica.Constants.inf! for Real)
Least value of type\\
(\lstinline!-Modelica.Constants.inf! for \lstinline!Real!)
\end{tabular}\\ \hline
\end{longtable}

Expand Down
2 changes: 1 addition & 1 deletion chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ \section{Specialized Classes}\doublelabel{specialized-classes}
components (i.e., equation, algorithm, initial equation, initial
algorithm and protected sections are not allowed).

Enhanced to allow \lstinline!connect!(..) to components of connector classes. The
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 connector, record and
type.\\ \hline
Expand Down
15 changes: 7 additions & 8 deletions chapters/connectors.tex
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ \section{Equation Operators for Overconstrained Connection-Based Equation System
\subsection{Overconstrained Equation Operators for Connection Graphs}\doublelabel{overconstrained-equation-operators-for-connection-graphs}

A type or record declaration may have an optional definition of function
\lstinline!equalityConstraint(..)! that shall have the following prototype:
\lstinline!equalityConstraint! that shall have the following prototype:
\begin{lstlisting}[language=modelica]
type Type // overdetermined type
extends <base type>;
Expand Down Expand Up @@ -851,8 +851,7 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\doublelabe
\lstinline!R2!, respectively, with a non-redundant number $n \ge 0$ of equations. The
residues of these equations are returned in vector \lstinline!residue! of size
$n$. The set of n non-redundant equations stating that \lstinline!R1 = R2! is given by
the equation (\textbf{0} characterizes a vector of zeros of appropriate
size):
the equation (\lstinline!0! represents a vector of zeros of appropriate size):
\begin{lstlisting}[language=modelica]
Record R1, R2;
equation
Expand All @@ -876,13 +875,13 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\doublelabe
connector is a node in a virtual connection graph that is used to
determine when the standard equation \lstinline!R1 = R2! or when the equation
\lstinline!0 = equalityConstraint(R1, R2)! has to be used for the generation of
\lstinline!connect(...)! equations. The edges of the virtual connection graph are
implicitly defined by \lstinline!connect(..)! and explicitly by
\lstinline!Connections.branch(...)! statements, see table below. \lstinline!Connections! is a
\lstinline!connect! equations. The edges of the virtual connection graph are
implicitly defined by \lstinline!connect! and explicitly by
\lstinline!Connections.branch! statements, see table below. \lstinline!Connections! is a
built-in package in global scope containing built-in operators.
Additionally, corresponding nodes of the virtual connection graph have
to be defined as roots or as potential roots with functions
\lstinline!Connections.root(...)! and \lstinline!Connections.potentialRoot(...)!, respectively.
\lstinline!Connections.root! and \lstinline!Connections.potentialRoot!, respectively.
In the following table, \lstinline!A! and \lstinline!B! are connector instances that may be
hierarchically structured, e.g., \lstinline!A! may be an abbreviation for
\lstinline!EnginePort.Frame!.
Expand Down Expand Up @@ -965,7 +964,7 @@ \subsection{Overconstrained Equation Operators for Connection Graphs}\doublelabe

\subsection{Converting the Connection Graph into Trees and Generating Connection Equations}\doublelabel{converting-the-connection-graph-into-trees-and-generating-connection-equations}

Before \lstinline!connect(...)! equations are generated, the virtual connection
Before \lstinline!connect! equations are generated, the virtual connection
graph is transformed into a set of spanning trees by removing optional spanning tree edges
from the graph. This is performed in the following way:
\begin{enumerate}
Expand Down
6 changes: 3 additions & 3 deletions chapters/equations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ \subsection{assert}\doublelabel{assert}
\end{nonnormative}
Failed assertions take precedence over successful termination, such
that if the model first triggers the end of successful analysis by
reaching the stop-time or explicitly with \lstinline!terminate()!, but the
reaching the stop-time or explicitly with \lstinline!terminate!, but the
evaluation with \lstinline!terminal()=true! triggers an assert, the analysis
failed.
\item
Expand Down Expand Up @@ -519,14 +519,14 @@ \subsection{assert}\doublelabel{assert}
but the simulation should continue without any further action. The
corresponding code would be:
\begin{lstlisting}[language=modelica]
assert(T > 250 and T < 400, "Medium model outside full accuracy range", AssertionLevel.warning);
assert(T > 250 and T < 400, "Medium model outside full accuracy range", AssertionLevel.warning);
assert(T > 200 and T < 500, "Medium model outside feasible region");
\end{lstlisting}
\end{nonnormative}

\subsection{terminate}\doublelabel{terminate}

The \lstinline!terminate(...)! equation or statement (using function
The \lstinline!terminate! equation or statement (using function
syntax) successfully terminates the analysis which was carried out,
see also \autoref{assert}. The termination is not immediate at the place
where it is defined since not all variable results might be available
Expand Down
13 changes: 6 additions & 7 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ \section{Function Declaration}\doublelabel{function-declaration}
\begin{nonnormative}
The structure of a typical function declaration is sketched by
the following schematic function example:
\begin{lstlisting}[language=modelica,escapechar=!]
\begin{lstlisting}[language=modelica,mathescape=true,escapechar=!]
function !\emph{functionname}!
input TypeI1 in1;
input TypeI2 in2;
input TypeI3 in3 = !\emph{default\_expr1}! "Comment" annotation(...);
input TypeI3 in3 = !\emph{default\_expr1}! "Comment" annotation($\ldots$);
...
output TypeO1 out1;
output TypeO2 out2 = !\emph{default\_expr2}!;
Expand Down Expand Up @@ -318,7 +318,7 @@ \section{Pure Modelica Functions}\doublelabel{pure-modelica-functions}
\item
a when-statement,
\item
\lstinline!pure(impureFunctionCall(...))! - which allows calling impure
\lstinline[mathescape=true]!pure(impureFunctionCall($\ldots$))! --- which allows calling impure
functions in any pure context,
\item
in initial equations and initial algorithms,
Expand Down Expand Up @@ -684,7 +684,7 @@ \subsection{Output Formal Parameters of Functions}\doublelabel{output-formal-par
the equation or assignment shall contain a list of component references
within parentheses:

\lstinline!(out1, out2, out3) = f(...);!
\lstinline[mathescape=true]!(out1, out2, out3) = f($\ldots$);!

The component references are associated with the output components
according to their position in the list. Thus output component i is set
Expand Down Expand Up @@ -2517,7 +2517,7 @@ \subsubsection{Utility Functions for Allocating Strings}\doublelabel{utility-fun

\begin{nonnormative}
Memory that is not passed to the Modelica simulation environment, such as memory that is freed before leaving the function, or in an \lstinline!ExternalObject!,
see~\autoref{external-objects}, should be allocated with the standard C-mechanisms, like \lstinline[language=C]!calloc(..)!.
see~\autoref{external-objects}, should be allocated with the standard C-mechanisms, like \lstinline[language=C]!calloc!.
\end{nonnormative}

\begin{nonnormative}
Expand Down Expand Up @@ -2554,8 +2554,7 @@ \subsection{External Objects}\doublelabel{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 '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 may not assume that pointers sent
to the external object will remain valid for the life-time of the
external object.
\begin{nonnormative}
Expand Down
6 changes: 3 additions & 3 deletions chapters/inheritance.tex
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ \section{Redeclaration}\doublelabel{redeclaration}

\subsection{The class extends Redeclaration Mechanism}\doublelabel{the-class-extends-redeclaration-mechanism}

A class declaration of the type \lstinline!redeclare class extends B(...)! ,
A class declaration of the type \lstinline[mathescape=true]!redeclare class extends B($\ldots$)! ,
where \lstinline!class! as usual can be replaced by any other specialized class,
replaces the inherited class \lstinline!B! with another declaration that extends the
inherited class where the optional class-modification is applied to the
inherited class. Inherited \lstinline!B! here means that the class
containing \lstinline!redeclare class extends B(...)! should also inherit
containing \lstinline[mathescape=true]!redeclare class extends B($\ldots$)! should also inherit
another declaration of \lstinline!B! from one of its extends-clauses. The new
declaration should explicitly include redeclare.

Expand All @@ -699,7 +699,7 @@ \subsection{The class extends Redeclaration Mechanism}\doublelabel{the-class-ext
to apply modifiers to the new declaration.
\end{nonnormative}

For \lstinline!redeclare class extends B(...)! the inherited class is subject
For \lstinline[mathescape=true]!redeclare class extends B($\ldots$)! the inherited class is subject
to the same restrictions as a redeclare of the inherited element, and
the original class \lstinline!B! should be replaceable, and the new element is only
replaceable if the new definition is replaceable. In contrast to normal
Expand Down
2 changes: 1 addition & 1 deletion chapters/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ \section{Notation and Grammar}\doublelabel{notation-and-grammar}
reserved words and may not be used as identifiers, with the exception of
\lstinline!initial! which is a keyword in section headings, and \lstinline!der! which is a
keyword for declaration functions, but it is also possible to call the
functions \lstinline!initial()! and \lstinline!der(...)!.
functions \lstinline!initial! and \lstinline!der!.

See \autoref{modelica-concrete-syntax} for a full lexical specification and grammar.
6 changes: 4 additions & 2 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,10 @@ \subsubsection{spatialDistribution}\doublelabel{spatialdistribution}
vectorized outputs out0 and out1 of the same size; the arguments
initialPoints and initialValues are vectorized accordingly.

The solution, z(..), can be described in terms of characteristics:\\
$z(y+\int_t^{t+\beta}v(\alpha)d\alpha,t+\beta)=z(y,t),$ for all $\beta$ as long as staying inside the domain.
The solution, $z$, can be described in terms of characteristics:
\begin{equation*}
z(y+\int_{t}^{t+\beta} v(\alpha) \mathrm{d}\alpha, t+\beta) = z(y, t),\quad\text{for all $\beta$ as long as staying inside the domain}
\end{equation*}

This allows to directly compute the solution based on interpolating the
boundary conditions.
Expand Down
8 changes: 4 additions & 4 deletions chapters/overloaded.tex
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,15 @@ \section{Example of Overloading for Complex Numbers}\doublelabel{example-of-over
different operations; thus ComplexVoltage and ComplexCurrent still use
the operations from Complex. The restriction that it is not legal to
extend from any of its enclosing scopes implies that:
\begin{lstlisting}[language=modelica]
\begin{lstlisting}[language=modelica,mathescape=true]
package A
extends Icon; //Ok.
operator record B ... end B;
operator record B $\ldots$ end B;
end A;

package A2
extends A(...); // Not legal
extends A($\ldots$); // Not legal
end A2;
package A3=A(...); // Not legal
package A3=A($\ldots$); // Not legal
\end{lstlisting}
\end{example}
20 changes: 9 additions & 11 deletions chapters/revisions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,8 @@ \subsection{Main Changes in Modelica 3.0}\doublelabel{main-changes-in-modelica-3
Prefixes \lstinline!input!, \lstinline!output!, \lstinline!inner!, \lstinline!outer!,
\lstinline!flow! are not allowed in a record
\item
The built-in operators \lstinline!abs(...)! and \lstinline!sign(...)! do no longer
generate events but are implicitly defined with a \lstinline!noEvent(...)!
The built-in operators \lstinline!abs! and \lstinline!sign! do no longer
generate events but are implicitly defined with a \lstinline!noEvent!
operator.
\item
The constraining clause of a replaceable class or component is changed
Expand All @@ -1840,8 +1840,7 @@ \subsection{Main Changes in Modelica 3.0}\doublelabel{main-changes-in-modelica-3
model must inherit from the constraining class, but this is not the
case).
\item
The \lstinline!isPresent!(...) construct, which was not implemented in tools, was
removed.
The \lstinline!isPresent! construct, which was not implemented in tools, was removed.
\end{itemize}

The following changes in the Modelica 3.0 graphical annotations are also \emph{not} backwards compatible:
Expand Down Expand Up @@ -1899,8 +1898,7 @@ \subsection{Main Changes in Modelica 3.0}\doublelabel{main-changes-in-modelica-3
\item
New annotations for schematic animation and interactive user input in
\autoref{annotations-for-graphical-objects}:\\
\lstinline!DynamicSelect!(..) to modify annotation literals by the actual values
of variables.\\
\lstinline!DynamicSelect! to modify annotation literals by the actual values of variables.\\
\lstinline!OnMouseDownSetBoolean!, \lstinline!OnMouseUpSetBoolean!, \lstinline!OnMouseMoveXSetReal!,
\lstinline!OnMouseMoveYSetReal!, \lstinline!OnMouseDownEditReal!, \lstinline!OnMouseDownEditString! to
interactively set the variable of a class during simulation.
Expand All @@ -1911,7 +1909,7 @@ \subsection{Main Changes in Modelica 3.0}\doublelabel{main-changes-in-modelica-3
\item
Syntax rule for a function call (e.g., according to the grammar in
Modelica 2.2 a function call of the form
\lstinline!Modelica.Math.Matrices.eig(...)! was invalid because the function name
\lstinline[mathescape=true]!Modelica.Math.Matrices.eig($\ldots$)! was invalid because the function name
could not have `\lstinline!.!'. However, all Modelica tools supported the
desired ``full Modelica name'' also for function calls).
\end{itemize}
Expand Down Expand Up @@ -2086,7 +2084,7 @@ \subsection{Main Changes in Modelica 2.1}\doublelabel{main-changes-in-modelica-2
\item
Optional output arguments of Modelica functions. The presence of
actual input and/or output arguments can be inquired with the new
built-in function \lstinline!isPresent(..)!. The previous built-in function and
built-in function \lstinline!isPresent!. The previous built-in function and
attribute \lstinline!enable! was removed.
\item
Making the default constraining type more useful by inheriting the
Expand All @@ -2104,13 +2102,13 @@ \subsection{Main Changes in Modelica 2.1}\doublelabel{main-changes-in-modelica-2
\item
Statement \lstinline!return! in a Modelica function.
\item
Built-in function \lstinline!String(..)! to provide a string representation of
Built-in function \lstinline!String! to provide a string representation of
\lstinline!Boolean!, \lstinline!Integer!, \lstinline!Real! and \lstinline!Enumeration! types.
\item
Built-in function \lstinline!Integer(..)! to provide the \lstinline!Integer! representation of
Built-in function \lstinline!Integer! to provide the \lstinline!Integer! representation of
an \lstinline!Enumeration! type.
\item
Built-in function \lstinline!semiLinear(..)! to define a characteristics with two
Built-in function \lstinline!semiLinear! to define a characteristics with two
slopes and a set of rules for symbolic transformations, especially
when the function becomes underdetermined (this function is used in
the Modelica Fluid library under development to define reversing flow
Expand Down
2 changes: 1 addition & 1 deletion chapters/statemachines.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ \chapter{State Machines}\doublelabel{state-machines}
For this reason, the state machines in this chapter use \emph{immediate}
(= the same as \emph{strong}) and \emph{delayed} transitions. Delayed
transitions are \emph{immediate} transitions where the condition is
automatically delayed with an implicit \lstinline!previous(..)!.
automatically delayed with an implicit \lstinline!previous!.
\item
Parallel state machines can be explicitly synchronized with a
language element (similarly as parallel branches in Sequential
Expand Down
4 changes: 2 additions & 2 deletions chapters/stream.tex
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ \section{Stream Operator inStream and Connection Equations}\doublelabel{stream-o
approximate the solution in an open neighbourhood of that point.

\begin{nonnormative}
For example, assume that \lstinline[mathescape=true]!$m_{j}$.c.m_flow = $c_{k}$.m_flow = 0!, then all equations above are identically fulfilled and \lstinline!inStream(..)! can have any value.
For example, assume that \lstinline[mathescape=true]!$m_{j}$.c.m_flow = $c_{k}$.m_flow = 0!, then all equations above are identically fulfilled and \lstinline!inStream! can have any value.
\end{nonnormative}

However, specific optimizations may be applied to avoid the regularization if the flow through one port is zero or non-negative, see \autoref{derivation-of-stream-equations}.
Expand Down Expand Up @@ -349,7 +349,7 @@ \section{Stream Operator inStream and Connection Equations}\doublelabel{stream-o
The following properties hold for this implementation:
\begin{itemize}
\item
\lstinline!inStream(..)! is continuous (and differentiable),
\lstinline!inStream! is continuous (and differentiable),
provided that \lstinline[mathescape=true]!$m_{j}$.c.h_outflow!,
\lstinline[mathescape=true]!$m_{j}$.c.m_flow!, \lstinline[mathescape=true]!$c_{k}$.h_outflow!, and
\lstinline[mathescape=true]!$c_{k}$.m_flow! are continuous and differentiable.
Expand Down
Loading

0 comments on commit 4c1b9cb

Please sign in to comment.