Try to clean up clause-meaning.#3896
Conversation
|
That is a lot of body of… we better make sure we really like this new terminology. |
I agree that it is used a lot, but to me that is necessary to differentiate between Using "in a when-clause" to refer to "in the body of when-clause" (i.e., excluding its condition) as previously done isn't very clear (apart from the terminology not being applied consistently). Obviously something other than "body" could be used, but we used "body" a few times before. |
|
Just changing body of |
Done. For those clauses. Note that "body of" is used in some other places as well (not changed by this PR), we should clean up that later. |
|
Poll: |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
| After solving the initialization problem, both \lstinline!b! and \lstinline!pre(b)! are false. | ||
| During transient analysis, \lstinline!initial()! is false, so \lstinline!b! changes from falso to true during the first round of the initial event iteration. | ||
| This triggers the \lstinline!when!-clause, and \lstinline!x! gets reinitialized. | ||
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. |
There was a problem hiding this comment.
Isn't it better to speak of triggered branches than triggered bodies?
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. | |
| This triggers the \lstinline!when!-clause branch, and \lstinline!x! gets reinitialized. |
There was a problem hiding this comment.
As above I think that only the body is active/triggered.
There was a problem hiding this comment.
I'd say it's especially when speaking of triggering that branch makes much better sense than body.
There was a problem hiding this comment.
Thinking more I believe that a solution might be something subtly different (which indicates that more time is needed).
I still think that only the body is really triggered, whereas the condition is triggering it.
Both of these are part of the branch, so to me it seems that the branch should be more active (instead of passively getting triggered). Perhaps something like:
| This triggers the \lstinline!when!-clause body, and \lstinline!x! gets reinitialized. | |
| The \lstinline!when!-clause branch triggers, and \lstinline!x! gets reinitialized. |
possibly replace "triggers" by "triggers based on the change in b".
There was a problem hiding this comment.
The difference is very subtle and I don't see why the active way to see it would make more sense than the passive, while at least the passive is more easy to concisely connect with the previous sentence.
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
|
||
| For purposes of event iteration, each scalar expression in a \lstinline!when!-clause condition is treated as an implicit variable \lstinline!v!. | ||
| Since the \lstinline!when!-clause is triggered when \lstinline!v and not pre(v)!, the implicit variable is considered wrapped in \lstinline!pre($\ldots$)! and becomes part of the event iteration convergence criterion. | ||
| Since a \lstinline!when!-clause body is triggered when \lstinline!v and not pre(v)!, the implicit variable is considered wrapped in \lstinline!pre($\ldots$)! and becomes part of the event iteration convergence criterion. |
There was a problem hiding this comment.
Triggered branch:
| Since a \lstinline!when!-clause body is triggered when \lstinline!v and not pre(v)!, the implicit variable is considered wrapped in \lstinline!pre($\ldots$)! and becomes part of the event iteration convergence criterion. | |
| Since a \lstinline!when!-clause branch is triggered when \lstinline!v and not pre(v)!, the implicit variable is considered wrapped in \lstinline!pre($\ldots$)! and becomes part of the event iteration convergence criterion. |
There was a problem hiding this comment.
As above I think that only the body is active/triggered, and the condition of the branch does the triggering.
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
I have completed my initial sweep over this now, but need to take a break now and continue later today. |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
|
I think there are so many minor things that it is best to delay this PR (as it is just a clarification, not a new feature). |
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Moving and adjusting line. Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Move modified line Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
| @@ -946,7 +947,7 @@ \section{Initialization, initial equation, and initial algorithm}\label{initiali | |||
| \end{lstlisting} | |||
| After solving the initialization problem, both \lstinline!b! and \lstinline!pre(b)! are false. | |||
| During transient analysis, \lstinline!initial()! is false, so \lstinline!b! changes from falso to true during the first round of the initial event iteration. | |||
There was a problem hiding this comment.
Nearby typo:
| During transient analysis, \lstinline!initial()! is false, so \lstinline!b! changes from falso to true during the first round of the initial event iteration. | |
| During transient analysis, \lstinline!initial()! is false, so \lstinline!b! changes from false to true during the first round of the initial event iteration. |
Closes #3840
Not sure if we should add this to 3.7; or delay it.
However, the current situation isn't good either as seen in #3840; and in particular "when-clause" sometimes previously meant "body of a when- or else-when-clause"; and is now written as "body of when-clause".
I believe it is correct, but will try to look again.