cellml / cellml-specification

CellML Specification
0 stars 8 forks source link

Missing rule?: Variables cannot have true/false as value #308

Open MichaelClerx opened 4 years ago

MichaelClerx commented 4 years ago

We're currently not ruling out x = true, as far as I can see, although I thought this had been our intention?

kerimoyle commented 4 years ago

Nope, we decided to leave it. See https://github.com/cellml/cellml-specification/issues/29

MichaelClerx commented 4 years ago

That was about having the <true> and <false> constants from MathML in the language at all. I don't see anywhere in there where we decided x = true is okay

kerimoyle commented 4 years ago

So you could have a variable evaluate to a boolean value in the MathML, but you're just not allowed to assign it a boolean value yourself? See https://github.com/cellml/cellml-specification/issues/29#issuecomment-597222147 ?

MichaelClerx commented 4 years ago

I'd say "x = true" shouldn't be allowed, nor should "x = (1 == 2)"

nickerso commented 4 years ago

I'd be concerned about embarking down the path of defining what was allowed in the math. Currently we only say "these are the allowed elements from MathML2" and don't really care if people make bad models. This particular case could be something added to the libcellml checking for "bad math" that would help people develop more robust models, but I don't see a need to rule it out in the specification.

If we did open up this case, then you'd expect a whole slew of such rules that try to define what a good model is, or at least ruling out all the things we know are bad.

Its also maybe useful to remember that our models are all equalities, there is no assignment operator.

MichaelClerx commented 4 years ago

We're already not allowing initial_value="true" though