Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hexadecimal in OMI #5

Closed
lars-hellstrom opened this issue Aug 28, 2017 · 8 comments
Closed

Hexadecimal in OMI #5

lars-hellstrom opened this issue Aug 28, 2017 · 8 comments
Assignees

Comments

@lars-hellstrom
Copy link
Contributor

I was writing up a summary of the format of digits in integer objects —

The XML encoding of OMIs and OMFs can be in hexadecimal as well as decimal, if one wishes to avoid a radix conversion. The binary encoding is base-2 (well, perhaps rather base-256) only. In the case of integers, hexadecimal is signalled with an x before the first digit (but after the minus sign, if there is one).

— because that is what Section 3.1.2 of the standard says. But then I though I'd better check if the hexdigits are upper case, lower case, or both. To my surprise, the normative RNG schema says it's neither, because Appendix B states:

  <!-- integer -->
  <define name="OMI">
    <element name="OMI">
      <ref name="common.attributes"/>
      <data type="string">
        <param name="pattern">\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*</param>
      </data>
    </element>
  </define>

This covers only the case of decimal digits, so the standard contradicts itself!

From a technical point of view, I think it would be a good idea to support hexadecimal here, and would be inclined to treat this as an error in the writeup, but since it would mean changing the schema I suppose it could be sensitive (someone might have implemented a tool correctly against the schema, rather than against the informal text description). As for the other encodings:

  • CMML supports hexadecimal (with both upper and lower case), but only in pragmatic CMML.
  • PopCorn supports hexadecimal (with both upper and lower case, although the prefix seems to be lower case x only).

What does OpenDreamKit do?

Is this an issue that could be addressed by / call for a minor increment in the OMOBJ version? (That is, if we don't decide to pretend that the standard always was with hexadecimal, and instead decide that "yes, technically this is a change".) It would not affect what could be an abstract OM object, only how some objects could be encoded; I'm not sure if the version is for the encoding or for the abstract model.

@JamesHDavenport
Copy link
Contributor

JamesHDavenport commented Aug 28, 2017 via email

@kohlhase
Copy link
Member

kohlhase commented Oct 3, 2017

assigning to David and Lars, I can help if necessary.

@davidcarlisle
Copy link
Member

the doc was fairly clear that the content of OMI should ignore spaces and then be an optional leading - followed by decimal or x and uppercase hex.

So I have updated the schema to match.

The schema doesn't really have any formal versioning but I added a comment at the top

# RELAX NG Schema for OpenMath 2
# Revision 2: Corrected regex for OMI to match the documented standard and allow hex

This is checked into OMSTD and CDs repos (it would be good to avoid that duplication if possible) and will get checked in to OpenMath.github.io in editors-draft area when that's rebuilt.

I seem to have messed up the checkin reference to this issue as I don't see it here, the check is

OpenMath/CDs@b62ed53

@lars-hellstrom
Copy link
Contributor Author

I like that you added the Kleene stars on the whitespace – this was also bugging me in the RNG.

But you seem to have done this against the wrong repo (somehow). The #5 reference in that commit should go to #5, but it goes to OpenMath/CDs#5.

@davidcarlisle
Copy link
Member

davidcarlisle commented Oct 3, 2017 via email

@kohlhase
Copy link
Member

kohlhase commented Oct 5, 2017

is this fixed then?

@kohlhase
Copy link
Member

kohlhase commented Oct 5, 2017

If so, please close.

@davidcarlisle
Copy link
Member

davidcarlisle commented Oct 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants