[Om] Named functions in OpenMath
Ken.Wenzel at iwu.fraunhofer.de
Tue May 5 12:39:33 CEST 2015
Von: om-bounces at openmath.org [om-bounces at openmath.org]" im Auftrag von "David Carlisle [davidc at nag.co.uk]
Gesendet: Montag, 4. Mai 2015 17:26
An: om at openmath.org
Betreff: Re: [Om] Named functions in OpenMath
On 04/05/2015 09:34, Wenzel, Ken wrote:
> I wonder what is the correct way to represent a named function in OpenMath.
> For example, I like to describe a function named "area" that computes the
> area of a rectangle.
> The corresponding Popcorn expression for the anonymous function is:
> fns1.lambda[$a, $b -> $a * $b]
> What is now the correct method to name this function.
> I can, for example, just give it an ID like
> fns1.lambda[$a, $b -> $a * $b] : area
> and invoke it with #area(3, 4) at an later point.
> But I think this is some kind of structure sharing since the lambda expression is
> simply copied into the resulting OpenMath object and not the invocation of
> a single function named "area".
> I would be grateful if somebody can help me.
> Best regards,
You could define a binding to names within an openmath expression but if
I understand correct;y the question, the traditional place for such
bindings is in a Content Dictionary.
If you had a CD that defined a symbol area with an FMP that gave the
semantics in terms of that lambda expression, then you'd just need
<OMS cd="mycd" mame="area"/>
OK, I understand. Would you suggest that the FMPs content should be simply
fns1.lambda[$a, $b -> $a * $b]
or should I use some kind of equation like
mycd.area = fns1.lambda[$a, $b -> $a * $b]
All in all I think that this is not fundamentally different from simply using an OMR like
The problem with OpenMath is that I don't have the possibility to declare
as a symbol AND as the lambda expression at the same time.
Thank you and best regards,
More information about the Om