[om] query on binary encoding of OpenMath

Jacques Carette carette at mcmaster.ca
Wed Apr 14 20:08:27 CEST 2004


>From an historical perspective, it might be worthwhile to note that Maple's
external storage format (called 'dot m') uses this same encoding.  This may
explain this early choice in OM as well.

Jacques

-----Original Message-----
From: owner-om at openmath.org [mailto:owner-om at openmath.org] On Behalf Of
Michael Kohlhase
Sent: April 14, 2004 9:01 AM
To: m.kohlhase at iu-bremen.de
Cc: om at openmath.org
Subject: Re: [om] query on binary encoding of OpenMath


Dear Bill,

I have thought about the problem a little more, and I still do not know why
the 
"character" encoding of integers was chose in the first place. But it is 
probably too late to change it now.

In designing the OM2 binary encoding we took great care to stay backwards 
compatible with the OM1 binary encoding, so that OM1 binary encodings can be

read as OM2 binary encodings and give the same OM object. Thus we can only
use 
the token identifiers 65, 66, 193, and 194 (and possibly the currently
unused 
token identifiers 97, 98 225, and 226) with a changed encoding using your
values.

Changing to values for these token identifiers would make the encoding 
non-uniform and more complex. While we could certainly live with that, I am
not 
sure whether the gain (BTW, I think that the saving is a factor of 16 not 2
for 
hex). What are your intuitions?

It just struck me that we may also change the encoding in a uniform way,
which 
is to extend the sign/base byte with a bit for the character/value encoding,

e.g. we could or that byte with 0x80 if the rest of the encoding is by value
and 
not by character. That way we would have a uniform encoding that is also 
backwards compatible.

What do people think?

Michael
-------------------------------------------------------------------------
    Prof. Dr. Michael Kohlhase,         Office: Research 1, Room 62
    Professor for Computer Science      Campus Ring 12,
    School of Engineering & Science     D-28758 Bremen, Germany
    International University Bremen     tel/fax: +49 421 200 3140/3103
    http://www.cs.cmu.edu/~kohlhase     e-mail: <m.kohlhase at iu-bremen.de>
--------------------------------------------------------------------------


Michael Kohlhase wrote:
> Bill,
> 
> thanks for the insistence, I have worked most with the binary encoding
> this time, so the question is problably for me to answer.
> 
> However, I just do not know. I can only assume that this makes
> enc0ding/decoding faster. Does anybody who was involved in the first 
> round of the binary encoding remember?
> 
> Michael
> -------------------------------------------------------------------------
>    Prof. Dr. Michael Kohlhase,         Office: Research 1, Room 62
>    Professor for Computer Science      Campus Ring 12,
>    School of Engineering & Science     D-28758 Bremen, Germany
>    International University Bremen     tel/fax: +49 421 200 3140/3103
>    http://www.cs.cmu.edu/~kohlhase     e-mail: <m.kohlhase at iu-bremen.de>
> ----------------------------------------------------------------------
> ----
> 
> 
> W Naylor wrote:
> 
>> Hi,
>>
>> I have a query regarding the binary encoding of big integers in
>> OpenMath. I asked this question some months back but didn't get any 
>> response. So I'm going to try again, maybe someone can enlighten me ;-)
>>
>> "I also have a query about the encoding for big integers, in the most 
>> general form. Why are they encoded as a length, followed by the base 
>> 10 or base 16 representation as characters? Surely if the idea of 
>> this encoding is compactness, it is better to send the size and the 
>> value. This would give
>> a saving of a factor of two for base 16 and more for base 10! You don't
>> lose any information because you still know that the 'source' OpenMath is
>> base 10/16 because of the 'sign/base' byte."
>>
>> cheers,
>>
>> Bill
>>
>> --
>> om at openmath.org  -  general discussion on OpenMath
>> Post public announcements to om-announce at openmath.org
>> Automatic list maintenance software at majordomo at openmath.org
>> Mail om-owner at openmath.org for assistance with any problems
> 
> 
--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org Mail
om-owner at openmath.org for assistance with any problems

--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems



More information about the Om mailing list