conformance in the face of decimals with lengths larger than supported by the implementation

xsd:decimal allows decimals of arbitrary length.  However,
implementations are only required to support decimals up to a certain
length.

An implementation may round off a decimal it receives.  So, in some
implementations
1^^decimal=1.0000000000000000000000000001^^decimal
will be always true and in some implementations it will be inconsistent.

These two things hamper interoperability and make the semantics of the
language unpredictable.

I propose to add to conformance that implementations MUST reject RIF
documents that contain decimals (or any subtype thereof) bigger than
supported by the particular implementation.


Yet another problem is that XPath functions and operators states that
the if the "number of digits in the result exceeds the number of digits
that the implementation supports, the result is truncated or rounded in
an implementation-defined manner" [1].
So, in some applications numeric-divide(1^^int,3^^int) returns
0.3333333333333333333^^decimal
and in some applications it returns
0.33333333333333333333333333333333333^^decimal

At the moment I'm not entirely sure how to solve this.  One possibility
would be to define entailment relative to some supported subset of decimal.


Best, Jos

[1] http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#op.numeric
-- 
Jos de Bruijn            debruijn@inf.unibz.it
+390471016224         http://www.debruijn.net/
----------------------------------------------
No one who cannot rejoice in the discovery of
his own mistakes deserves to be called a
scholar.
  - Donald Foster

Received on Friday, 13 February 2009 12:24:27 UTC