Query and inspect your Java, Smalltalk, C and Cobol programs.
Libraries for SOUL » Absinthe: query version repositories using SOUL
Absinthe is a tool that allows you to reason over the history of a software project. It does this by creating a model of a version repository, and thus each version of the software project. The user can query this model by combining a temporal specification language and SOUL. Absinthe features three different specification langauges, but the recommended one is "quantified regular path expressions", based on normal regular expressions. The user specifies a sequence of versions, and the characteristics that have to be present in each of these versions. Absinthe will then detect what versions and entities correspond to the user-defined specifications.
In the example below we are looking for a class that got removed, and was then reintroduced again. The first two lines specify the begin- and endversion of the query. We then specify that there must exist a path, denoted by the existential quantifier e. On this path a class ?class must be present in the beginversion. In an arbitrary amount of successors (but at least one) the class must be absent. This is denoted by the plus operator. At last a class with the same name is introduced. The last line configures the path expression, denoting the begin- and endversion, as well as which variables are not local to a version.
?start isVersion, ?reintroducedHere isVersion, e(?class isClassWithName: ?className, plus(not(?class isClass)), ?reintroduced isClassWithName: ?className) matches: graph(?start, ?reintroducedHere, <?name>)
Notice that the handling of version transitions is done automagically. Each statement is evaluated in the correct version. The standard behaviour is to evaluate a clause in the successor of the previous clause. The user can change this behaviour by using combinators (such as plus, manyOf, ...).