Re: [abc-dev] Valid combinations of primitive pointcuts

From: Sascha Kuzins <sascha.kuzins@comlab.ox.ac.uk>
Date: Mon Apr 11 2005 - 12:12:11 BST

Dear Eric,

It is not entirely clear what you mean by "invalid". The example
pointcut you present never matches, but that should be no reason to
consider it invalid (what about the pointcut "if(false)", for example?).
One could come up with some clearly defined validity conditions. An
example would be to not allow multiple kinded non-negated pointcut
primitives of different kinds in the same disjunct of the pointcut
expression (given the expression is in DNF), because this disjunct would
never match.
In your example, however, one would have to do a non-trivial analysis to
determine if the method patterns are really disjunct (which is easy in
this case, but not generally).
Even if we had such an analysis, there are still problems with labelling
such cases invalid. For example, a code generator that generates
pointcut expressions would now have to perform the same analyses to make
sure that the generated programs are not invalid.

One analogy one could think of here is that Java does not disallow
constructs such as "if(0!=0).." or "if(false).." either, even though one
could argue they are invalid because the conditions are never fulfilled.

It would, however, be useful to issue warnings for pointcuts that are
likely to be a mistake (like the one from your example). We discussed
this issue a while ago, but this functionality is not implemented at the
moment.

Regarding abc's internal representation of pointcuts, the following
document may be helpful:
http://abc.comlab.ox.ac.uk/documents/adviceweaver.pdf

Regards,

Sascha

Eric Bodden wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, abc team.
>
> In my tool I am generating pointcuts, well actually boolean
> combinations of those. One task I have to do is not to filter out
> invalid combinations of primitive pointcuts, such as e.g. call(*
> A.foo()) && call(* A.bar()), which is obviously not valid, since no
> calls to different methods can occur at the same joinpoint.
>
> So my question would be: Has your team by chance already compiled
> such a list and if so, could I get a copy of or link to it? If not,
> would you be interested in such a document? It might help to improve
> AspectJ's semantic analysis, which IMO should not allow such
> pointcuts either.
>
> Also I remember that there was a mapping going on from actual AspectJ
> pointcuts to abc's internal representation. Where can I find this
> again?
>
> Thank you a lot,
> Eric
>
> - --
> Eric Bodden
> Chair I2 for Programming Languages and Program Analysis
> RWTH Aachen University
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 8.0.3
>
> iQA/AwUBQlemm8wiFCm7RlWCEQI+CgCfdmjddU0pq1R4DiCaXATA0yqZJz0An1cS
> +ZcVIrqWcqZQxdxuewfeA3pM
> =Dxfj
> -----END PGP SIGNATURE-----
>
>
>
>
Received on Mon Apr 11 12:12:14 2005

This archive was generated by hypermail 2.1.8 : Mon Apr 11 2005 - 14:30:05 BST