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

Modelica.Math.BooleanVectors.allTrue gives wrong result when size(b,1)=0 #682

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 6 comments · Fixed by #2916
Closed
Assignees
Labels
enhancement New feature or enhancement L: Math Issue addresses Modelica.Math P: low Low priority issue
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by jriel on 12 Jan 2012 20:09 UTC
When size(b,1) of allTrue is 0, meaning there are no inputs, the output should be true, not false.
That is, the function allTrue(), with no inputs, should return true. One way to see this is that
allTrue(x1,x2,...,xn) = allTrue(allTrue(x1,...,xm), allTrue(xm+1,..,xn)). So
allTrue(x) = allTrue(allTrue(x),allTrue()) which returns x only if allTrue() = true.


Migrated-From: https://trac.modelica.org/Modelica/ticket/682

@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Math Issue addresses Modelica.Math labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by otter on 9 Dec 2012 15:28 UTC
You are right that the semantics seems to be more useful if allTrue returns true for an empty vectors. Currently, this is not the case and this is also defined in this way in the documentation. Therefore, a backwards compatible change is not possible currently.

To summarize, a change of the semantics of this function requires a conversion script and therefore the ticket milestone is changed to "MSL with conversion script".

@modelica-trac-importer
Copy link
Author

Changelog removed by otter on 9 Dec 2012 15:28 UTC

@modelica-trac-importer modelica-trac-importer added the P: low Low priority issue label Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Modified by otter on 18 Jul 2013 11:54 UTC

@modelica-trac-importer modelica-trac-importer added enhancement New feature or enhancement and removed bug Critical/severe issue labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 1 Aug 2015 21:36 UTC
Milestone renamed

@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 1 Aug 2015 21:39 UTC
Milestone renamed

@modelica-trac-importer modelica-trac-importer added this to the MSL_next-MAJOR-version milestone Jan 14, 2017
@HansOlsson
Copy link
Contributor

Regarding the function in conversion scripts:

  • The only current solution for conversion scripts is to move current one to ObsoleteModelica4 - and introduce a new one. That works, but in case the argument is never zero-sized that is excessive - and in case they mistakenly thought it would work the other way it is problematic.
  • Automatically detecting if the function argument may be zero-sized is both difficult and something that would require an advanced extension of conversion-script.
  • However, it is also the basis for two blocks: And and Nand - I assume they should also be changed in the same way. In that case it seems as if we could handle the smart conversion with current conversions. There is also another issue for Nand.

beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue Apr 8, 2019
Make Modelica.Math.BooleanVectors.allTrue equivalent to obsolete (and to be removed) function Modelica.StateGraph.Temporary.allTrue.
beutlich added a commit to beutlich/ModelicaStandardLibrary that referenced this issue May 5, 2019
@beutlich beutlich assigned beutlich and MartinOtter and unassigned MartinOtter May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement L: Math Issue addresses Modelica.Math P: low Low priority issue
Projects
None yet
4 participants