From 03f2a7b6b4c6318bdec01540dc24a69a0f6ca5b2 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 30 Sep 2025 16:01:15 +0200 Subject: [PATCH 1/6] Clarify strange sentence #3729 And also unify noEvent-handling: I assume that the previous text was a bit odd since it talked about "event-generating" to avoid stating that it only applied outside of noEvent; I thus found it necessary to add a noEvent-context for the new text. And unfortunately the noEvent-part had to be unified. --- chapters/equations.tex | 3 ++- chapters/operatorsandexpressions.tex | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/chapters/equations.tex b/chapters/equations.tex index 709e7d5fc..3215e363e 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -627,7 +627,8 @@ \section{Events and Synchronization}\label{events-and-synchronization} The \lstinline!noEvent! operator is used to guard against \emph{outside domain} errors, e.g., \lstinline!y = if noEvent(x >= 0) then sqrt(x) else 0.! \end{example} -All equations and assignment statements within \lstinline!when!-clauses and all assignment statements within \lstinline!function! classes are implicitly treated with \lstinline!noEvent!, i.e., relations within the scope of these operators never induce state or time events. +All equations and assignment statements within \lstinline!when!-clauses all assignment statements within \lstinline!function! classes are implicitly treated with \lstinline!noEvent!, i.e., relations within the scope of these operators never induce state or time events. +Clocked discrete-time partitions also also treated this way, see \cref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}. \begin{nonnormative} Using state events in \lstinline!when!-clauses is unnecessary because the body of a \lstinline!when!-clause is not evaluated during continuous integration. diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 3be828310..7ae5d0084 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -581,7 +581,7 @@ \subsection{Numeric Functions and Conversion Operators}\label{numeric-functions- \subsection{Event Triggering Mathematical Functions}\label{event-triggering-mathematical-functions} -The operators listed below trigger events if used outside of a \lstinline!when!-clause and outside of a clocked discrete-time partition (see \cref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}). +The operators listed below trigger events unless explicitly or implicit treated with \lstinline!noEvent! (see \cref{events-and-synchronization}). \begin{center} \begin{tabular}{l|l l} \hline @@ -598,8 +598,8 @@ \subsection{Event Triggering Mathematical Functions}\label{event-triggering-math \end{tabular} \end{center} -These expression for \lstinline!div!, \lstinline!ceil!, \lstinline!floor!, and \lstinline!integer! are event generating expression. -The event generating expression for \lstinline!mod(x,y)! is \lstinline!floor(x/y)!, and for \lstinline!rem(x,y)! it is \lstinline!div(x,y)! -- i.e., events are not generated when \lstinline!mod! or \lstinline!rem! changes continuously in an interval, but when they change discontinuously from one interval to the next. +Except for the \lstinline!noEvent!-case the expressions \lstinline!div!, \lstinline!ceil!, \lstinline!floor!, and \lstinline!integer! can only change values at events, and will trigger events as needed. +The event triggering expressions for \lstinline!mod(x,y)! is \lstinline!floor(x/y)!, and for \lstinline!rem(x,y)! it is \lstinline!div(x,y)! -- i.e., events are not generated when \lstinline!mod! or \lstinline!rem! changes continuously in an interval, but when they change discontinuously from one interval to the next. \begin{nonnormative} If this is not desired, the \lstinline!noEvent! operator can be applied to them. From deded39fe1c2249c46b5db4214edbbe8f406bc37 Mon Sep 17 00:00:00 2001 From: HOS Date: Tue, 30 Sep 2025 16:08:22 +0200 Subject: [PATCH 2/6] Deleted by accident. --- chapters/equations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/equations.tex b/chapters/equations.tex index 3215e363e..870b09454 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -627,7 +627,7 @@ \section{Events and Synchronization}\label{events-and-synchronization} The \lstinline!noEvent! operator is used to guard against \emph{outside domain} errors, e.g., \lstinline!y = if noEvent(x >= 0) then sqrt(x) else 0.! \end{example} -All equations and assignment statements within \lstinline!when!-clauses all assignment statements within \lstinline!function! classes are implicitly treated with \lstinline!noEvent!, i.e., relations within the scope of these operators never induce state or time events. +All equations and assignment statements within \lstinline!when!-clauses and all assignment statements within \lstinline!function! classes are implicitly treated with \lstinline!noEvent!, i.e., relations within the scope of these operators never induce state or time events. Clocked discrete-time partitions also also treated this way, see \cref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}. \begin{nonnormative} From de0afdfbf941286b1282fb976cfdd76da8f2c923 Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Wed, 1 Oct 2025 08:53:30 +0200 Subject: [PATCH 3/6] Update chapters/equations.tex --- chapters/equations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/equations.tex b/chapters/equations.tex index 870b09454..679bc11be 100644 --- a/chapters/equations.tex +++ b/chapters/equations.tex @@ -628,7 +628,7 @@ \section{Events and Synchronization}\label{events-and-synchronization} \end{example} All equations and assignment statements within \lstinline!when!-clauses and all assignment statements within \lstinline!function! classes are implicitly treated with \lstinline!noEvent!, i.e., relations within the scope of these operators never induce state or time events. -Clocked discrete-time partitions also also treated this way, see \cref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}. +Clocked discrete-time partitions are also treated this way, see \cref{clocked-discrete-time-and-clocked-discretized-continuous-time-partition}. \begin{nonnormative} Using state events in \lstinline!when!-clauses is unnecessary because the body of a \lstinline!when!-clause is not evaluated during continuous integration. From b55de67a152c203f80802fd6de1b9ecc65d92ea9 Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Thu, 2 Oct 2025 15:48:56 +0200 Subject: [PATCH 4/6] Update chapters/operatorsandexpressions.tex --- chapters/operatorsandexpressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 7ae5d0084..3fa51c4d6 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -581,7 +581,7 @@ \subsection{Numeric Functions and Conversion Operators}\label{numeric-functions- \subsection{Event Triggering Mathematical Functions}\label{event-triggering-mathematical-functions} -The operators listed below trigger events unless explicitly or implicit treated with \lstinline!noEvent! (see \cref{events-and-synchronization}). +The operators listed below trigger events unless explicitly or implicitly treated with \lstinline!noEvent! (see \cref{events-and-synchronization}). \begin{center} \begin{tabular}{l|l l} \hline From bae23ff9d800e925a9a30218d5e9f1726dfbda3d Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Thu, 2 Oct 2025 15:50:13 +0200 Subject: [PATCH 5/6] Update chapters/operatorsandexpressions.tex --- chapters/operatorsandexpressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 3fa51c4d6..0d9c89098 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -581,7 +581,7 @@ \subsection{Numeric Functions and Conversion Operators}\label{numeric-functions- \subsection{Event Triggering Mathematical Functions}\label{event-triggering-mathematical-functions} -The operators listed below trigger events unless explicitly or implicitly treated with \lstinline!noEvent! (see \cref{events-and-synchronization}). +The operators listed below trigger events unless explicitly or implicitly inhibited by \lstinline!noEvent! (see \cref{events-and-synchronization}). \begin{center} \begin{tabular}{l|l l} \hline From 89405ed06945e518be83b2bb9b4e28dd2b76a4af Mon Sep 17 00:00:00 2001 From: Hans Olsson Date: Tue, 14 Oct 2025 10:26:32 +0200 Subject: [PATCH 6/6] Update chapters/operatorsandexpressions.tex Co-authored-by: Henrik Tidefelt --- chapters/operatorsandexpressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index 0d9c89098..9070991a1 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -599,7 +599,7 @@ \subsection{Event Triggering Mathematical Functions}\label{event-triggering-math \end{center} Except for the \lstinline!noEvent!-case the expressions \lstinline!div!, \lstinline!ceil!, \lstinline!floor!, and \lstinline!integer! can only change values at events, and will trigger events as needed. -The event triggering expressions for \lstinline!mod(x,y)! is \lstinline!floor(x/y)!, and for \lstinline!rem(x,y)! it is \lstinline!div(x,y)! -- i.e., events are not generated when \lstinline!mod! or \lstinline!rem! changes continuously in an interval, but when they change discontinuously from one interval to the next. +The event triggering expressions for \lstinline!mod(x,y)! is \lstinline!floor(x/y)!, and for \lstinline!rem(x,y)! it is \lstinline!div(x,y)! -- i.e., the expressions \lstinline!mod! and \lstinline!rem! do not only change values at events, but events are triggered at the points of discontinuous change. \begin{nonnormative} If this is not desired, the \lstinline!noEvent! operator can be applied to them.