[abc] Re: query about PQL (fwd)

From: Oege de Moor <Oege.de.Moor@comlab.ox.ac.uk>
Date: Tue Dec 13 2005 - 07:41:54 GMT

---------- Forwarded message ----------
Date: Mon, 12 Dec 2005 20:39:39 -0800
From: Michael Martin <mcmartin@gmail.com>
To: Oege.de.Moor@comlab.ox.ac.uk
Cc: mcmartin@cs.stanford.edu, livshits@cs.stanford.edu, lam@cs.stanford.edu
Subject: Re: query about PQL

On 12/9/05, Oege de Moor <oege@comlab.ox.ac.uk> wrote:
> We were trying to express the following query with
> PQL, but couldn't quite see how to do it. I'm looking
> for any object that is first inserted in a hash set,
> and then retrieved, but upon retrieval we find that its
> hashcode changed.
>
> As a tracematch, you would write something along
> The following lines (note that declaring "remove"
> as a symbol without mentioning it in the pattern means it
> cannot occur between "add" and "contains") :
>
> /* snip; key is "let(hashCode, o.hashCode());" */

> Does PQL have a facility similar to "let"? If not, how do
> you recommend me working around it? How would you express the
> above example?

This hinges on the inequality of the (primitive int) results of
hashCode; as such, PQL is really poorly equipped to handle it in its
current implementation. The best you could do would be to have two
subqueries, one for add and one for contains, then using executes
clauses for maintaining some global map.

As such, it's unlikely to be much of an improvement, if any, over
unextended AspectJ. On the other hand, if I recall correctly,
Partiqle/PTQL actually directly attacked this problem, and was
designed primarily for handling such things.

(Certain extensions to PQL that only exist on paper permitted bindings
to and comparisons on primitive values, but we shifted focus to other
matters before dealing too closely with it.)

--Michael
Received on Tue Dec 13 07:41:58 2005

This archive was generated by hypermail 2.1.8 : Tue Dec 13 2005 - 11:10:08 GMT