-
Notifications
You must be signed in to change notification settings - Fork 44
Derivative in left-hand-side #3838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ \section{Statements}\label{statements} | |
| \begin{lstlisting}[language=grammar] | ||
| statement : | ||
| ( component-reference ( ":=" expression | function-call-args ) | ||
| | der "(" component-reference ")" ":=" expression | ||
| | "(" output-expression-list ")" ":=" | ||
| component-reference function-call-args | ||
| | break | ||
|
|
@@ -106,11 +107,12 @@ \subsection{Simple Assignment Statements}\label{simple-assignment-statements} | |
|
|
||
| The syntax of \firstuse[assignment statement!simple]{simple assignment statement} is as follows: | ||
| \begin{lstlisting}[language=grammar] | ||
| component-reference ":=" expression | ||
| ( component-reference | der "(" component-reference ")" ) ":=" expression | ||
|
||
| \end{lstlisting} | ||
|
|
||
| The \lstinline[language=grammar]!expression! is evaluated. | ||
| The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference!. | ||
| The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference! (or as its derivative). | ||
| An assignment to a derivative may only occur in a model or block. | ||
|
|
||
| The \lstinline!expression! must not have higher variability than the assigned component, see \cref{variability-of-expressions}. | ||
|
|
||
|
|
@@ -119,7 +121,7 @@ \subsection{Simple Assignment Statements}\label{simple-assignment-statements} | |
| \subsubsection{Assignments from Called Functions with Multiple Results}\label{assignments-from-called-functions-with-multiple-results} | ||
|
|
||
| There is a special form of assignment statement that is used only when the right-hand side contains a call to a function with multiple results. | ||
| The left-hand side contains a parenthesized, comma-separated list of variables receiving the results from the function call. | ||
| The left-hand side contains a parenthesized, comma-separated list of variables (or derivatives) receiving the results from the function call. | ||
| A function with $n$ results needs $m \leq n$ receiving variables on the left-hand side, and the variables are assigned from left to right. | ||
|
|
||
| \begin{lstlisting}[language=modelica] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align with how it is written in the grammar, or take the opportunity to replace outdated duplicated grammar with cross reference to
\cref{equations1}.More generally, I would actually be in favor of making each production rule in syntax.tex its own listing, with a systematic way of creating a cross reference to a specific production rule with something like
\cref{production:statement}. With precise cross references like that, the need to duplicate the production in other places of the document is more or less eliminated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the simple reference; a more precise cross-referencing would be good, but I think that should be a separate PR and prioritized.