## RE: [saxon] question on quantified expression

 RE: [saxon] question on quantified expression From: Michael Kay - 2005-04-06 11:44:24 ```> in your "XPath 2.0" book you write that > > 1. "some \$s in \$S, \$t in \$T, \$u in \$U satisfies CONDITION" > > has excactly the same effect as the expression: > > 2. "exits(for \$s in \$S, \$t in \$T, \$u in \$U return > boolean(CONDITION))[.]" > > I do not understand this. > > A small counter example is: > > 1. some \$s in \$S satifies false() yields (false()) > > whereas > > 2. exists (for \$s in \$S return boolean(false()))[.] => (true()) > In (2), the result of for \$s in \$S return boolean(false()) is a sequence of zero or more items each of which is the boolean value false. Applying the predicate [.] to this calculates the EBV of . for each item in this sequence and returns the item if the EBV is true. But if the item is false(), then its EBV is false, and therefore the item is not selected. So the result of for \$s in \$S return boolean(false())[.] is an empty sequence, and therefore the result of exists (for \$s in \$S return boolean(false())[.]) is true. However, there is a typo in the book. The [.] should be within the parens, that is, part of the expression passed as an argument to exists(). Michael Kay http://www.saxonica.com/ ```

 [saxon] question on quantified expression From: Stefan Wachter - 2005-04-05 14:26:34 ```Dear Mr. Kay, in your "XPath 2.0" book you write that 1. "some \$s in \$S, \$t in \$T, \$u in \$U satisfies CONDITION" has excactly the same effect as the expression: 2. "exits(for \$s in \$S, \$t in \$T, \$u in \$U return boolean(CONDITION))[.]" I do not understand this. A small counter example is: 1. some \$s in \$S satifies false() yields (false()) whereas 2. exists (for \$s in \$S return boolean(false()))[.] => (true()) Where is my mistake? Thanks for your attention, --Stefan ```
 RE: [saxon] question on quantified expression From: Michael Kay - 2005-04-06 11:44:24 ```> in your "XPath 2.0" book you write that > > 1. "some \$s in \$S, \$t in \$T, \$u in \$U satisfies CONDITION" > > has excactly the same effect as the expression: > > 2. "exits(for \$s in \$S, \$t in \$T, \$u in \$U return > boolean(CONDITION))[.]" > > I do not understand this. > > A small counter example is: > > 1. some \$s in \$S satifies false() yields (false()) > > whereas > > 2. exists (for \$s in \$S return boolean(false()))[.] => (true()) > In (2), the result of for \$s in \$S return boolean(false()) is a sequence of zero or more items each of which is the boolean value false. Applying the predicate [.] to this calculates the EBV of . for each item in this sequence and returns the item if the EBV is true. But if the item is false(), then its EBV is false, and therefore the item is not selected. So the result of for \$s in \$S return boolean(false())[.] is an empty sequence, and therefore the result of exists (for \$s in \$S return boolean(false())[.]) is true. However, there is a typo in the book. The [.] should be within the parens, that is, part of the expression passed as an argument to exists(). Michael Kay http://www.saxonica.com/ ```