[Prev][Next][Index][Thread]

Re: Content markups, piecewise functions, conditions



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Note that the important thing to do is =
to=20
capture</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the information.&nbsp; The essence of a =
piecewise=20
object is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 1.&nbsp; there is a =
bound=20
variable</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 2.&nbsp; there is =
one or more=20
conditions on that variable</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
bound to=20
outcomes, typically computed using that</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 3.&nbsp; possibly a =
default=20
outcome</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>MathML does NOT evaluate or simplify =
its=20
expressions.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>With this in mind, you probably want to =
choose=20
between</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;piecewise( bvar , (condition, =
value )*,=20
default )</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>piecewise( bvar , default , =
conditiongroup *=20
)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>where</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
conditiongroup :=3D&nbsp;&nbsp; conditiongroup( condition , value =
)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Either one will do the job.&nbsp; Both =
are easy to=20
encode using</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>csymbol, and bvar, at least in MathML =
2.0.&nbsp;=20
(There were some</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>funny restrictions in MathML 1.0 that =
did not allow=20
bvars </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in new expressions and required =
function wrappers=20
in the</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>first argument to apply.)&nbsp; In 2.0 =
the first of=20
these would look</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>something like:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&lt;apply&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&lt;bvar&gt;x&lt;/bvar&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&lt;csymbol=20
definitionURL=3D"mydefinitionforpiecewise"&gt;piecewise&lt;/csymbol&gt;</=
FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&lt;apply&gt;&lt;lt/&gt; ....&lt;/apply&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&lt;apply&gt;&lt;times/&gt; ...&lt;/apply&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&lt;apply&gt;&lt;/lt/&gt; ... &lt;/apply&gt;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
value 2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp; default=20
value</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&lt;/apply&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Note that reln is deprecated in MathML=20
2.0</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Also, generally speaking it is a bad =
idea to encode=20
essential</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>information in comments as sometimes =
processing=20
strips those</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>comments away.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>There is no real need to use the lambda =
constructs=20
as that information</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>would</FONT><FONT face=3DArial =
size=3D2> already be=20
contained in the formal definition, and is really more =
concerned</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>with evaluation than =
representation.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Stan Devitt</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:quintana@lyon.objectif.fr"=20
  title=3Dquintana@lyon.objectif.fr>G=E9rald QUINTANA</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:www-math@w3.org"=20
  title=3Dwww-math@w3.org>www-math@w3.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, July 11, 2000 =
11:45=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Content markups, =
piecewise=20
  functions, conditions</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi,<BR><BR>I am thinking about how I =
could code a=20
  piecewise function using<BR>content markups. I need content markups =
because I=20
  aim at making a small<BR>MathML "parser-compiler". I didn't understood =
exactly=20
  how conditions were<BR>working. So as to code the sign function =
(returns -1=20
  when x&lt;0, 0 when x=3D0<BR>and +1 when x&gt;0) what do you think of =
this ? How=20
  can I tell that those 3<BR>definitions belongs to the same function=20
  ?<BR><BR>&lt;?xml version=3D"1.0" =
encoding=3D"UTF-8"?&gt;<BR>&lt;!DOCTYPE math=20
  SYSTEM "<A=20
  =
href=3D"file://localhost/S:/java/xerces/mathml/mathml.dtd">file://localho=
st/S:/java/xerces/mathml/mathml.dtd</A>"=20
  &gt;<BR>&lt;math&gt;<BR>&nbsp; &lt;!--If x&lt;0 then =
-1--&gt;<BR>&nbsp;=20
  &lt;lambda&gt;<BR>&nbsp;&nbsp;&nbsp;=20
  &lt;bvar&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;ci&gt;x&lt;/ci&gt;<BR>&nbsp;&nbsp;&nbsp;=20
  &lt;/bvar&gt;<BR>&nbsp;&nbsp;&nbsp;=20
  &lt;apply&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;bvar&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;ci&gt;x&lt;/ci&gt;<BR>&nbsp;&nbsp;&nbsp;&nb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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;ci&gt;x&lt;/ci&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;/bvar&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;condition&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;reln&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

  &lt;eq/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
&lt;ci&gt;x&lt;/ci&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
  &lt;cn&gt;0&lt;/cn&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;/reln&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;/condition&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  &lt;cn&gt;1&lt;/cn&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/apply&gt;<BR>&nbsp;=20
  &lt;/lambda&gt;<BR>&lt;/math&gt;<BR><BR>Thanks for your=20
  help,<BR>Gerald.<BR><BR></FONT></DIV>
  <DIV><FONT face=3DArial =
size=3D2>________________________________<BR>G=E9rald=20
  QUINTANA<BR>&nbsp; <A=20
  =
href=3D"mailto:gerald.quintana@ecl2000.ec-lyon.fr">gerald.quintana@ecl200=
0.ec-lyon.fr</A><BR>&nbsp;=20
  <A=20
  =
href=3D"http://www.multimania.com/gquintana">http://www.multimania.com/gq=
uintana</A></FONT></DIV></BLOCKQUOTE></BODY></HTML>

Follow-Ups: References: