From 1be910bdf5acfde94019fed01dcd59c1f8db7376 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Mon, 12 Oct 2020 22:36:35 +0200 Subject: [PATCH] Text styling cleanup related to 'assert' --- chapters/arrays.tex | 4 +--- chapters/equations.tex | 5 ++--- chapters/statements.tex | 7 ++----- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 89a0e44b9..9f7b13a69 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -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. diff --git a/chapters/equations.tex b/chapters/equations.tex index 4832860ee..691a21d31 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -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 @@ -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} diff --git a/chapters/statements.tex b/chapters/statements.tex index aaea30ee0..b01a01be1 100644 --- a/chapters/statements.tex +++ b/chapters/statements.tex @@ -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.