Menu

#53 query filtering treats exists terms incorrectly

open
nobody
5
2005-05-25
2005-05-25
J Carletta
No

There's a problem with the treatment of existential bindings
in the query language. On the sample Switchboard data, try

($w word): ($w=$w) ::
(exists $s nt):($s ^ $w) ::
(exists $m markable): ($m >"at" $s)

in either the search GUI or using CountQueryResults.

This should produce a parsing error, since in the third
query,
$s is unbound. Instead, it produces 0 matches. Note that
the
exists are completely unnecessary, since :: is a filtering
construct - without them, if for a binding of $w, bindings
for
$s and $m do not exist, that binding for $w will be removed
from
the result list. The behaviour the query language engine
gives
is *not* what one would expect if $s were treated as bound,
since

($w word): ($w=$w) ::
($s nt):($s ^ $w) ::
($m markable): ($m >"at" $s)

and

($w word): ($w=$w) ::
($s nt):($s ^ $w) ::
(exists $m markable): ($m >"at" $s)

both return 30 results.

It isn't clear what the implementation is doing to $s, since
for other related queries, there *are* returned values as if
as if $s were bound normally; for instance,

($w word): ($w=$w) ::
(exists $s nt):($s ^ $s) ::
(exists $m markable): !($m >"at" $s)

returns values, as does

($w word): ($w=$w) ::
(exists $s nt):($s ^ $s) ::
(exists $m markable): !($m==$s)

but not

($w word): ($w=$w) ::
(exists $s nt):($s ^ $s) ::
(exists $m nt): ($m==$s)

This difference would not be important if the
implementation
simply refused to evaluate these queries, reporting $s as
unbound in the final subquery, but as it is,
it's very confusing for users.

Discussion