Skip to content

Commit

Permalink
Text styling cleanup related to 'assert'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 12, 2020
1 parent 8a70e36 commit 1be910b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions chapters/arrays.tex
Expand Up @@ -156,9 +156,7 @@ \section{Array Declarations}\label{array-declarations}
\begin{nonnormative}
Automatic assertions at simulation time:

Let \lstinline!A! be a declared array and \lstinline!i! be the declared maximum dimension size of the \lstinline!di!-dimension, then an assert statement
\lstinline!assert(i >= 0, $\ldots$)! is generated provided this assertion cannot be checked at compile time. It is a quality of implementation
issue to generate a good error message if the assertion fails.
Let \lstinline!A! be a declared array and \lstinline!i! be the declared maximum dimension size of the \lstinline!di!-dimension, then an assert statement \lstinline!assert(i >= 0, $\ldots$)! is generated provided this assertion cannot be checked at compile time. It is a quality of implementation issue to generate a good error message if the assertion fails.

Let \lstinline!A! be a declared array and \lstinline!i! be an index accessing an index of the \lstinline!di!-dimension. Then for every such index-access an assert
statement \lstinline!assert(1 <= i and i <= size(A, di), $\ldots$)! is generated, provided this assertion cannot be checked at compile time.
Expand Down
5 changes: 2 additions & 3 deletions chapters/equations.tex
Expand Up @@ -465,8 +465,7 @@ \subsection{assert}\label{assert}
value. It can be used in equation sections or algorithm sections.

\begin{nonnormative}
This means that assert can be called as if it were a function with three formal parameters, the third formal parameter has the
name \lstinline!level! and the default value \lstinline!AssertionLevel.error!.
This means that \lstinline!assert! can be called as if it were a function with three formal parameters, the third formal parameter has the name \lstinline!level! and the default value \lstinline!AssertionLevel.error!.
\end{nonnormative}

If the \lstinline!condition! of an assertion is true, \lstinline!message! is not evaluated and
Expand All @@ -490,7 +489,7 @@ \subsection{assert}\label{assert}
\lstinline!message! indicates the cause of the warning.
\begin{nonnormative}
It is recommended to report the warning only once when the condition becomes false, and it is reported that the condition is no longer
violated when the condition returns to true. The \lstinline!assert! statement shall have no influence on the behavior of the model.
violated when the condition returns to true. The \lstinline!assert! statement shall have no influence on the behavior of the model.
For example, by evaluating the condition and reporting the message only after accepted integrator steps. \lstinline!condition! needs to
be implicitly treated with \lstinline!noEvent! since otherwise events might be triggered that can lead to slightly changed simulation results.
\end{nonnormative}
Expand Down
7 changes: 2 additions & 5 deletions chapters/statements.tex
Expand Up @@ -506,11 +506,8 @@ \subsection{Special Statements}\label{special-statements}

\subsubsection{Assert Statement}\label{assert-statement}

See \cref{assert}. A failed assert stops the execution of the current
algorithm.
See \cref{assert}. A failed \lstinline!assert! stops the execution of the current algorithm.

\subsubsection{Terminate Statement}\label{terminate-statement}

See \cref{terminate}. The terminate statement may not be in functions; In
an algorithm outside a function it does not stop the execution of the
current algorithm.
See \cref{terminate}. The \lstinline!terminate! statement is not allowed in functions; in an algorithm outside a function it does not stop the execution of the current algorithm.

0 comments on commit 1be910b

Please sign in to comment.