Opening a query browser

1. Open the Tools menu in the VisualWorks launcher, and select the SOUL Query Browser menu item:

Opening a SOUL query browser from the Tools menu of the  VisualWorks launcher.

2. Type a query in the edit pane of the SOUL Query Browser window:

Entering a query in the SOUL Query Browser.Note that you do not have to type the 'if' keyword queries start with.

Example query for a Java program:

if ?s isStatement,
   ?s returnStatementHasExpression: ?e

The above query quantifies over all return statements ?s in the Java program and the expressions ?e they return. The single-argument predicate isStatement/1 and two-argument predicate returnStatementHasExpression:/2 stem from SOUL's CAVA library. This library uses a syntax that is reminiscent of the one of Smalltalk for sending messages to objects. 

Example query for a Smalltalk program:

if class(?c),
   methodInClass(?m,?c)

The above query quantifies over all classes ?c in the Smalltalk image and their methods ?m. The single-argument predicate class/1 and two-argument predicate methodInClass/2 stem from SOUL's LiCoR library. This library uses a traditional Prolog-like syntax. 

3. The query must be accepted before you can evaluate it: right click on the query to open a context menu and select Accept:

Context menu of SOUL Query Browser

 

4. Select the repository in which the query has to be evaluated. The definition of the query's predicates will be looked up in the selected repository. Choose 'JavaEclipse' if you are querying a Java program. Choose 'LiCoR-Smalltalk' if you are querying a Smalltalk program.

Select the repository in which the query has to be evaluated.

5. Click on the 'All Results' button to compute all solutions to the query. Alternatively, the 'Next Result' button will compute one result at a time.

Solutions to a query shown in the Soul Query Browser.

Having computed the solutions to the query, you are ready to inspect them.