From: Andrew F. <af...@ph...> - 2006-06-16 11:26:22
|
Rainer You are right this is a bug in the test suite Andrew=20 > -----Original Message----- > From: Rainer Machne [mailto:ra...@tb...]=20 > Sent: 16 June 2006 12:23 > To: Andrew Finney > Cc: SOSlib Development > Subject: MathML Piecewise function[Scanned] >=20 > hi Andrew, >=20 > The use of piecewise in the semantic test suite seems to=20 > differ from official definitions: >=20 > E.g. in discontinuityTimeAndDelay-geq-l2.xml > it's: >=20 > <piecewise> > <piece> > <apply> > <geq/> > <ci> s2 </ci> > <cn> 4 </cn> > </apply> > <cn>1.5</cn> > </piece> > <otherwise> > <cn>0.05</cn> > </otherwise> > </piecewise> >=20 > which is >=20 > piecewise(geq(s2, 4), 1.5, 0.05) >=20 > in libSBML infix and interpreted as >=20 > 1.5 if s2 >=3D 4 > and > 0.05 otherwise >=20 > by SOSlib. > SOSlib produces the results required by the testsuite. >=20 >=20 > However, at > http://www.w3.org/TR/MathML2/chapter4.html#contm.piecewise > the definition is slightly different: >=20 > <piecewise> > <piece> > <cn> 0 </cn> > <apply><lt/><ci> x </ci> <cn> 0 </cn></apply> > </piece> > <otherwise> > <ci> x </ci> > </otherwise> > </piecewise> >=20 > in libSBML infix > piecewise(0, lt(x, 0), x) >=20 > interpreted as > 0 if x < 0 > and x otherwise. >=20 > Note, that the if condition of the piece element is BEFORE=20 > the associated result, while it is AFTER the result in the=20 > test suite example. >=20 > The same ordering is found in the piecewise example for more=20 > pieces - see below. The result associated with a piece is=20 > always BEFORE the condition. >=20 > Am i missing something or is the test suite example (and=20 > SOSlib) wrong? >=20 > Rainer >=20 >=20 >=20 > The general example with more pieces: >=20 > <piecewise> > <piece> > <apply><minus/><ci> x </ci></apply> > <apply><lt/><ci> x </ci> <cn> 0 </cn></apply> > </piece> > <piece> > <cn> 0 </cn> > <apply><eq/><ci> x </ci> <cn> 0 </cn></apply> > </piece> > <piece> > <ci> x </ci> > <apply><gt/><ci> x </ci> <cn> 0 </cn></apply> > </piece> > </piecewise> >=20 |