Re: Assignment Vs conditions

At 2002-04-24T13:33-0400, Kamlesh Pandey, Noida wrote:-

> 	How do I represent in MathML two different concepts namely
> assignment of one variable to other and
> checking equality of one variable to other.

I'll assume you're talking about content markup here. If you're talking
about presentation markup, then it's up to you to choose different symbols
for them according to the convention of your choice.

> For example
> x=y  (meaning x is equal to y, which would assign value of y to x upon
> evaluation)
>
> Vs.
>
> x=y ( Is x = y, which would return true or false)

This one's easy:-

<apply><eq/><ci>x</ci><ci>y</ci></apply>

Assignment is harder, and doesn't properly exist in MathML AFAIAA. It's
not clear to me that there's really a place for it until MathML is
extended to be able to represent algorithms.

<declare><ci>x</ci><ci>y</ci></declare>

is probably closest, but would not normally be rendered. It is intended to
modify the semantics of what follows, not to stand on its own. Assignment
can mostly be translated into equality, with a little logical glue.
Mathematically (as opposed to computationally) the line between the two is
at best rather blurred; the distinction is really little more than a
notational convenience.

I do find it somewhat puzzling that the same element should be used for
both mere declarations and definitions, but not rendered. Giving an
identifier a value is probably significant for what follows, so omitting
the fact when presenting the content to a human seems likely to cause
confusion. Where a document contains multiple math elements the human
reader might have the definition from an earlier expression, but in that
case duplicating the definition for the declare element is probably not
the best way of going about things.


Tim Bagot

Received on Thursday, 25 April 2002 14:57:45 UTC