Skip to content
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

Make it explicit that tools can show the value of variables for asserts #3641

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HansOlsson
Copy link
Collaborator

See:
modelica/ModelicaStandardLibrary#4519 and modelica/ModelicaStandardLibrary#4399 for background.

The reason for "may" is:

I thought it was sufficiently important to make it normative.

See: modelica/ModelicaStandardLibrary#4519 and modelica/ModelicaStandardLibrary#4399

The reason for "may" is:
- To not require the value to be duplicated, for cases such as: modelica/ModelicaStandardLibrary#4399
- Support even smarter debugging.

I thought it was sufficiently important to make it normative.
@@ -506,6 +506,7 @@ \subsection{assert}\label{assert}
\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}
\end{itemize}
Tools may show more than the message for failed assertions, in particular the condition and the values of any variables used in it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this too weak for purposes of guiding how library authors should formulate assert messages. Should they, or should they not explicitly include values of relevant variables in the message? Should they even mention names of problematic model variables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to extend that.

Copy link
Collaborator Author

@HansOlsson HansOlsson Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically I view it as two parts:

  1. Models should just give a message. Nothing fancy - basically a literal string.
  2. For users the information (=condition and values of variables) should be accessible, but I want to leave that open for tools to innovate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants