Re: PLease define 'collation'

> I was hoping that by saying it is a mapping to a sequence of
> integers then we can also imply some properties of functions like
> contains(), for example that contains(A,B) is true if A=B is true, and that
> startswith(A, B) implies A <= B.

The mathematician in me is required to reply with a proof that contains()
can never satisfy such a property.  The problem is that equality is
reflexive (symmetric), while string containment is not.

Assume contains(A, B) is true if and only if collation(A) = collation(B) is
true.  Then consider any two strings A and B such that contains(A, B) is
true but contains(B, A) is not (for example, "a" and "aa").  By the
hypothesis, contains(A, B) implies collation(A)=collation(B), but then by
the collation(B) = collation(A) so by hypothesis contains(B, A) is true, a
contradiction.

Therefore there cannot exist a collation for which contains(A, B) is true if
and only if collation(A) = collation(B).  [Note that this proof holds
regardless of what value space the collation maps into.]



Cheers,

Michael Brundage
xquery@comcast.net
Author, XQuery: The XML Query Language (Addison-Wesley, 2004)
Co-author, Professional XML Databases (Wrox Press, 2000)

Received on Thursday, 10 June 2004 02:14:52 UTC