# [om] Reference vs. Referent: solution to an old problem

Andrew Solomon andrew at illywhacker.net
Fri Dec 8 08:46:12 CET 2000

```Dear Pals,

This note pertains to the problem of defining the behaviour of an
OpenMath compliant compute engine and I attach to this email the
Computer Algebra System (CAS) CD on which I'd be happy to receive comments.
For the most part it is self explanatory, but there is one
aspect I'd like to motivate and explain.

The problem, roughly, is this.
If I send to a compute engine the object(A):

<OMOBJ>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMI 3/>
</OMA>
</OMOBJ>

what's to prevent the compute engine from sending exactly (A)
<OMOBJ>
<OMI 6/>
</OMOBJ>

We didn't come to any real conclusions in our lengthy discussions on the topic
in Eindoven and Bath, but I hope I have a solution here.

I think the key to the problem is to distinguish *reference* from *referent*.
In the present example, (A) is a *reference* to the number 6, while (B) is the object
referred to by (A) and is therefore the *referent*.

In general, a reference can refer to a set of objects, for example
(and I now desert XML in favour of brevity and readability) if G is a permutation group,
Representative(G) refers to a set of possible values, namely, the set
{g_1, ..., g_n} of elements of G.

I believe that in any case, it is possible to define (say, in the symbol definition)
precisely what referents a reference may have.

Examples:
* The symbol [cd="group1" name="character_table"] which has a single argument which
is a group, has a set of referents. Each is a list of lists of strings, integers,
algebraic numbers and other paraphernalia which constitute a character table of the
group which is the argument. Different orderings of the conjugacy classes give rise to
different tables (corresponding to reordering the columns).
* If it existed, the symbol [cd="polyZ" name="factorization"] would have
a set of referents, which are the set of factorizations into irreducible factors, for example
Factorization(3x^2 - 6x + 3) has the set of referents {[3, x-1, x+1], [3x-3, x+1], [x-1, 3x+3]}.
* (non example) The integer <OMI 1/> is not a reference. It is an actual thing.

Therefore, I've defined a symbol [cd="cas" name="referent"] which takes
two arguments. The second argument is a reference while the first argument is a string
which is either "some" or "all" where Referent("some", <reference>) returns a single
object to which <reference> refers, while Referent("all", <reference>) returns the set
of all objects to which <reference> refers.

Therefore a CAS which implements cas.ocd and integer1.ocd must evaluate

<OMOBJ>
<OMA>
<OMS cd="cas" name="referent"/>
<OMSTR some/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMI 3/>
</OMA>
</OMA>
</OMOBJ>

to

<OMOBJ>
<OMI 6/>
</OMOBJ>

while

<OMOBJ>
<OMA>
<OMS cd="cas" name="referent"/>
<OMSTR all/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMI 3/>
</OMA>
</OMA>
</OMOBJ>

must evaluate to

<OMOBJ>
<OMA>
<OMS cd="set1" name="set"/>
<OMI 6/>
</OMA>
</OMOBJ>

Back to the permutation group example, if G = <(1,2,3)> then

<OMOBJ>
<OMA>
<OMS cd="cas" name="referent"/>
<OMSTR some/>
<OMA>
<OMS cd="group1" name="representative"/>
<OMV name="G"/>
</OMA>
</OMA>
</OMOBJ>

might return the element (1,3,2) where replacing "some" by "all" would
result in the set of all representatives: {(), (1,2,3), (1,3,2)}.

Andrew

--
PIMS/MITACS/CECM                       http://www.cecm.sfu.ca
Simon Fraser University
Personal homepage:                     http://www.illywhacker.net
-------------- next part --------------
<CD>
<CDName> cas </CDName>
<CDURL> http://www.openmath.org/cd/cas.ocd </CDURL>
<CDReviewDate> 2001-10-03 </CDReviewDate>
<CDDate> 2000-10-03 </CDDate>
<CDVersion> 1 </CDVersion>
<CDRevision> 0 </CDRevision>
<CDStatus> experimental </CDStatus>
<CDUses>
</CDUses>
<Description> A CD for Computer Algebra Services </Description>

<CDComment>
Written by A. Solomon on 2000-10-03
</CDComment>

<CDDefinition>
<Name>quit</Name>
<Description>
Causes the compute engine process to terminate.
</Description>
<Example>
<OMOBJ>
<OMA>
<OMS cd="cas" name="quit"/>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

<CDDefinition>
<Name>assign </Name>
<Description>
Two arguments the first a string, the name of a variable in the
computer algebra engine (CAE). Assigns the second argument to the
variable denoted by the first arguement.
</Description>
<Example>
<!-- a := 1; -->
<OMOBJ>
<OMA>
<OMS cd="cas" name="assign"/>
<OMSTR>a</OMSTR>
<OMI> 1 </OMI>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

<CDDefinition>
<Name> retrieve </Name>
<Description>
The only argument is a string which is the name of a variable
in the CAE.  Get the object assigned to that variable.
</Description>
<Example>
<!-- a; -->
<OMOBJ>
<OMOBJ>
<OMA>
<OMS cd="cas" name="retrieve"/>
<OMSTR>a</OMSTR>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

<CDDefinition>
<Name>native_statement</Name>
<Description>
Send the string argument to the CAE as a statement in its native syntax.
</Description>
<Example>
<!-- a := 3; -->
<OMOBJ>
<OMA>
<OMS cd="cas" name="native_statement"/>
<OMSTR>a := 3;</OMSTR>
</OMA>
</OMOBJ>

</Example>
</CDDefinition>

<CDDefinition>
<Name> native_output </Name>
<Description>
No arguments. Retrieve the output from the CAE resulting from the last
command.
</Description>
<Example>
<OMOBJ>
<OMA>
<OMS cd="cas" name="native_output"/>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

<CDDefinition>
<Name> native_error </Name>
<Description>
No arguments. Retrieve any error string from the CAE resulting from the last
statement.
</Description>
<Example>
<OMOBJ>
<OMA>
<OMS cd="cas" name="native_error"/>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

<CDDefinition>
<Name> referent </Name>
<Description>
The first argument is either "some" or "all".
the second argument is an OpenMath object which qualifies as a *reference*.
</Description>
<Example>
<OMOBJ>
<OMA>
<OMS cd="cas" name="referent"/>
<OMSTR all/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMI 3/>
</OMA>
</OMA>
</OMOBJ>
</Example>
</CDDefinition>

</CD>

```