This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6228 - is float a restriction of double?
Summary: is float a restriction of double?
Status: CLOSED WORKSFORME
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Datatypes: XSD Part 2 (show other bugs)
Version: 1.1 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-14 16:29 UTC by Dave Peterson
Modified: 2008-11-14 18:45 UTC (History)
1 user (show)

See Also:


Attachments

Description Dave Peterson 2008-11-14 16:29:31 UTC
Status quo says:

Formally, [Definition:]  A datatype R is a restriction of another datatype B when
  o  the ·value space· of R is a subset of the ·value space· of B, and
  o  the ·lexical space· of R is a subset of the ·lexical space· of B.

This means that float is a restriction of double, since they both have the same
lexical space (hence a subset) and float's value space is a subset of double's.

I wonder if we meant to say that the lexical mapping (viewed as a set of ordered pairs) is a subset.
Comment 1 Michael Kay 2008-11-14 16:48:23 UTC
The float value space is not a subset of the double value space. It should be, but it isn't. The way it is currently defined, the float denoted by 2.5 is quite unrelated to the double denoted by 2.5.
Comment 2 Dave Peterson 2008-11-14 17:02:27 UTC
(In reply to comment #1)
> The float value space is not a subset of the double value space. It should be,
> but it isn't. The way it is currently defined, the float denoted by 2.5 is
> quite unrelated to the double denoted by 2.5.

You got me!  I'm not sure I'd say "unrelated", but your point, that they are artificially distinguished, is well taken.  I'll mark this closed, works for me.  Then will close it.

Amusing aside:  unsignedByte is not derived from short, but I believe it is a restriction.
Comment 3 Michael Kay 2008-11-14 18:45:26 UTC
>Amusing aside:  unsignedByte is not derived from short, but I believe it is a
restriction.

Good point. I think there is a bug there. The sentence immediately before the formal definition says "By 'restriction' is meant the definition of a datatype whose ·value space· and ·lexical space· are subsets of those of its ·base type·." which implies that a type cannot be a restriction of anything other than its base type (that is, it is an intensional rather than extensional relationship). But the definition that follows suggests a purely extensional relationship.

I don't think it matters much, because having defined the term ·restriction·, we only use it four times (within the middle dots), on one occasion incorrectly (where it is referring to restriction as a process, a method of derivation, rather than as a relationship between two types). But it's certainly a classic case where we are using language that looks formal but are actually pretty fuzzy.