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 1621 - no algebra of types
Summary: no algebra of types
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows 2000
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-15 01:13 UTC by Fred Zemke
Modified: 2005-09-06 13:03 UTC (History)
0 users

See Also:


Attachments

Description Fred Zemke 2005-07-15 01:13:02 UTC
.4.3 Content models
There are no inferences for the algebra of types.  For example,
you state that (Type | none) = Type, but I don't see any 
inferences to back this up.

Some other inferences to consider are:

|- (Type1 | Type2) = (Type2 | Type1)
|- (Type1 | Type1) = (Type1)
|- (Type1 | (Type2 | Type3)) = ((Type1 | Type2) | Type3)

Those are commutative, idempotent and associate rules, respectively.
The & operator is also commutative, idempotent and associative.

I believe that empty (and maybe none) is also an identity for &:

|- (Type & empty) = Type

Are there any rules relating | and &; relating | and , ;
relating , and & ?

Turning to quantifiers, I think we need the following inferences:

|- Type1** = Type1*
|- Type1?* = Type1*
|- Type1++ = Type1+
|- Type1?? = Type1?
etc.

Such rules might be placed in section 8.1, "Judgments for 
accessing types".
Comment 1 Fred Zemke 2005-07-19 21:15:44 UTC
This comment was on section 2.4.3, "Content models".

Subsequently, I have found 8.3.2 "Subtype and type equality",
which does consider the algebra of types.  The solution there, to use known 
algorithms for regular expressions and finite state automata, looks correct
and is actually algorithmic, unlike my proposal to specify the axioms from
which a type algebra could be deduced.  (How uncharacteristic of the 
Formal Semantics to actually suggest an algorithm to use to implement
it!)  I now suggest that this comment could be resolved by:

1. Putting a pointer from 2.4.3 to 8.3.2 so the reader knows where to find
a discussion of the algebra of types.

2. Perhaps a note or example in 8.3.2 that all the expected judgments about 
the type hierarcy, such as |- (Type1, empty) = Type1, can be deduced using
the regular expressions algorithms.
Comment 2 Paul Cotton 2005-07-20 00:02:20 UTC
Thank you for suggesting a solution to your own comment.

The XSL/XQuery WGs agreed to adopt your proposed solution to this comment.

Please let us know if this response is satisfactory. If not, please respond to 
this message, explaining your concerns.

Paul Cotton
On behalf of the XML Query and XSL WGs