[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. The essence of a =
piecewise=20
object is:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> 1. there is a =
bound=20
variable</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> 2. there is =
one or more=20
conditions on that variable</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
bound to=20
outcomes, typically computed using that</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
variable.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> 3. possibly a =
default=20
outcome</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>MathML does NOT evaluate or simplify =
its=20
expressions.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>With this in mind, you probably want to =
choose=20
between</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> piecewise( bvar , (condition, =
value )*,=20
default )</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>and</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>piecewise( bvar , default , =
conditiongroup *=20
)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>where</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
conditiongroup :=3D conditiongroup( condition , value =
)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Either one will do the job. Both =
are easy to=20
encode using</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>csymbol, and bvar, at least in MathML =
2.0. =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.) In 2.0 =
the first of=20
these would look</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>something like:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =
<apply></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<bvar>x</bvar></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
<csymbol=20
definitionURL=3D"mydefinitionforpiecewise">piecewise</csymbol></=
FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<apply><lt/> ....</apply></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<apply><times/> ...</apply></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<apply></lt/> ... </apply></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> =20
value 2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
default=20
value</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
</apply></FONT></DIV>
<DIV> </DIV>
<DIV> </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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>Stan Devitt</FONT></DIV>
<DIV> </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<0, 0 when x=3D0<BR>and +1 when x>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><?xml version=3D"1.0" =
encoding=3D"UTF-8"?><BR><!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
><BR><math><BR> <!--If x<0 then =
-1--><BR> =20
<lambda><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<apply><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<condition><BR> =20
<reln><BR> =
<lt/><BR> =20
=
<ci>x</ci><BR>  =
; =20
<cn>0</cn><BR> =20
</reln><BR> =20
</condition><BR> =20
<apply><BR> =20
<minus/><BR> =20
<cn>1</cn><BR> =20
</apply><BR> </apply><BR> =20
</lambda><BR> <!--If x=3D0 then 0--><BR> =20
<lambda><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<apply><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<condition><BR> =20
<reln><BR> =
<eq/><BR> =20
=
<ci>x</ci><BR>  =
; =20
<cn>0</cn><BR> =20
</reln><BR> =20
</condition><BR> =20
<cn>0</cn><BR> </apply><BR> =20
</lambda><BR> <!--If x>0 then +1--><BR> =20
<lambda><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<apply><BR> =20
<bvar><BR> =20
<ci>x</ci><BR> =20
</bvar><BR> =20
<condition><BR> =20
<reln><BR> =
<eq/><BR> =20
=
<ci>x</ci><BR>  =
; =20
<cn>0</cn><BR> =20
</reln><BR> =20
</condition><BR> =20
<cn>1</cn><BR> </apply><BR> =20
</lambda><BR></math><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> <A=20
=
href=3D"mailto:gerald.quintana@ecl2000.ec-lyon.fr">gerald.quintana@ecl200=
0.ec-lyon.fr</A><BR> =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: