## Re: [saxon] problem with universal quantifier in Xpath 2.0?

 Re: [saxon] problem with universal quantifier in Xpath 2.0? From: Joris Graaumans - 2003-10-15 12:55:53 ```Yes, this makes sense. Thanks! - Joris Graaumans Trevor Nash wrote: >On Wed, 15 Oct 2003 09:21:48 +0200, Joris Graaumans wrote: > > > >>It's a bit weird though (imho). >> >> > >As Spock would say, it's perfectly logical :-) > >If you had >a) every \$x in X satisfies P >and >b) every \$x in Y satisfies P > >then you would expect it to follow that >c) every \$x in (X union Y) satisfies P > >Whatever X and Y might be. > >But if X is empty and (b) is true then because Y is the same as (X >union Y) (c) must also be true. > >If (a) is false you are in big trouble... > > ```

 [saxon] problem with universal quantifier in Xpath 2.0? From: Joris Graaumans - 2003-10-14 18:31:55 ```Hi, I'm running the following XQuery in Saxon 7.7, taken from the Xbench benchmark: (: TC/MD_Q7 Find titles of articles where a keyword ("hockey") is mentioned in every paragraph of abstract.:) for \$a in doc("article.xml")/articles/article where every \$b in \$a/body/abstract/p satisfies contains(\$b, "hockey") return \$a/@id On the following document article.xml:
Test title Babu Justo

blablala hockey blalala

bbbb hockey bbbbbbb

bla bla bla

Test title Babu Justo

bla bla bla

I assume that the expected result would be: 2 However, the result is: 2 4 When I add a explicit check for the existence of , the query produces the expected result: for \$a in doc("article.xml")/articles/article where exists(\$a/body/abstract) and (every \$b in \$a/body/abstract/p satisfies contains(\$b, "hockey")) return \$a/@id Do I expect the wrong output for the first query, or can this be a bug in Saxon7.7? Thanks in advance, Best regards, Joris Graaumans ```
 RE: [saxon] problem with universal quantifier in Xpath 2.0? From: Michael Kay - 2003-10-15 01:33:51 ```If X is an empty sequence, then "every \$x in X satisfies P" is always true. So I think Saxon is giving you the right answer. Michael Kay > -----Original Message----- > From: saxon-help-admin@... > [mailto:saxon-help-admin@...] On Behalf Of > Joris Graaumans > Sent: 14 October 2003 19:37 > To: saxon-help@... > Subject: [saxon] problem with universal quantifier in Xpath 2.0? > > > Hi, I'm running the following XQuery in Saxon 7.7, taken from > the Xbench > benchmark: > > (: TC/MD_Q7 Find titles of articles where a keyword > ("hockey") is mentioned in every paragraph of abstract.:) > > for \$a in doc("article.xml")/articles/article > where every \$b in \$a/body/abstract/p satisfies > contains(\$b, "hockey") > return > \$a/@id > > On the following document article.xml: > > > >
> Test title > Babu Justo > > > >

blablala hockey blalala

>

bbbb hockey bbbbbbb

>
>
>

bla bla bla >

>
> >
> >
> Test title > Babu > Justo
 Re: [saxon] problem with universal quantifier in Xpath 2.0? From: Joris Graaumans - 2003-10-15 07:16:13 ```Thanks, I didn't know that. I should have checked thge Xpath 2.0 WD first. It's a bit weird though (imho). Greetings, Joris Graaumans Michael Kay wrote: >If X is an empty sequence, then "every \$x in X satisfies P" is always >true. So I think Saxon is giving you the right answer. > >Michael Kay > > ```
 Re: [saxon] problem with universal quantifier in Xpath 2.0? From: Trevor Nash - 2003-10-15 12:08:31 ```On Wed, 15 Oct 2003 09:21:48 +0200, Joris Graaumans wrote: > It's a bit weird though (imho). As Spock would say, it's perfectly logical :-) If you had a) every \$x in X satisfies P and=20 b) every \$x in Y satisfies P then you would expect it to follow that c) every \$x in (X union Y) satisfies P Whatever X and Y might be. But if X is empty and (b) is true then because Y is the same as (X union Y) (c) must also be true. If (a) is false you are in big trouble... Trevor Nash Melvaig Software Engineering Limited voice: +44 (0) 1997 423328=20 email: tcn@... web: http://www.melvaig.co.uk ```
 Re: [saxon] problem with universal quantifier in Xpath 2.0? From: Joris Graaumans - 2003-10-15 12:55:53 ```Yes, this makes sense. Thanks! - Joris Graaumans Trevor Nash wrote: >On Wed, 15 Oct 2003 09:21:48 +0200, Joris Graaumans wrote: > > > >>It's a bit weird though (imho). >> >> > >As Spock would say, it's perfectly logical :-) > >If you had >a) every \$x in X satisfies P >and >b) every \$x in Y satisfies P > >then you would expect it to follow that >c) every \$x in (X union Y) satisfies P > >Whatever X and Y might be. > >But if X is empty and (b) is true then because Y is the same as (X >union Y) (c) must also be true. > >If (a) is false you are in big trouble... > > ```