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

Invalid example of variability error #2525

Closed
henrikt-ma opened this issue Mar 15, 2020 · 1 comment · Fixed by #2526
Closed

Invalid example of variability error #2525

henrikt-ma opened this issue Mar 15, 2020 · 1 comment · Fixed by #2526
Milestone

Comments

@henrikt-ma
Copy link
Collaborator

henrikt-ma commented Mar 15, 2020

The example in 3.8.3 Discrete-Time Expressions contains the following false statement about violating variability rules:

equation
  b = noEvent(x > 1) // error, since b is a discrete-time expr. and
                     // noEvent(x > 1) is not a discrete-time expr.

The problem is that there is no stated rule that allows use of variability to analyze normal equations. All one can say is that the equation cannot be used to solve for anything, but with the current specification, one needs to draw that conclusion without help of expression variability rules. Instead, one must go to the definition of variability of a variable to see that this equation cannot be used to solve for b, and then it becomes evident that the equation is useless and cannot be solved.

@henrikt-ma
Copy link
Collaborator Author

A remedy for this situation, that will allow allow this equation to be rejected based on the perfect matching rule and variability analysis, is proposed in the following PR:
#2526

@HansOlsson HansOlsson added this to the Phone2020-1 milestone Mar 16, 2020
HansOlsson pushed a commit that referenced this issue Mar 16, 2020
* Fix and extend example on variability rules
* Clarify the role of rules based on expression variability
* Elaborate a little bit on the 'perfect matching rule'
* A variable declared with 'constant' prefix is unaffected by the initialization problem
Closes #2525
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 a pull request may close this issue.

2 participants