In this paper we discuss an approach to support declarative reasoning over aspect-oriented (AO) programs, adopting AspectJ
as a representative technology. The approach is based on the transformation of source code into a set of facts and rules,
stored into a Prolog database. Declarative analysis allows us to extract complex information through its rich and expressive
syntax. Our approach has two contributions. First, it aims to improve the comprehension of AspectJ programs. The type of knowledge
provided is categorized in three main groups: i) general knowledge, ii) bad smells, and iii) quality metrics. The second contribution
is the provision of dependency analysis of AspectJ programs. To that end, we identify dependencies in aspect-oriented programs,
and translate them into Prolog rules. Expected beneficiaries of our approach include system maintainers who can obtain comprehension
and perform dependency analysis through querying the Prolog database during the change planning stage of system evolution.
Keywords Program comprehension - static analysis - dependency analysis - declarative reasoning - aspect-oriented programming - AspectJ programming language