A Query-Based Approach for the Analysis of Aspect-Oriented Systems