Query and inspect your Java, Smalltalk, C and Cobol programs.
About SOUL » Querying from Smalltalk » Inspecting query results
Once you have computed the solutions to a query, you can inspect them in the bottom half of SOUL's Query Browser. The Query Browser offers three views on the same solutions: "Browser View", "Tree View" and "Text View". You can switch between each view by clicking on the corresponding tab.
Each solution to a query consists of bindings for the query's variables. This is most clear in the "Text View". Here, each solution is printed as [?var1-->text_for_binding, ?var2-->text_for_binding]:
The "Text View" is similar to what you would get on most Prolog prompts. In such a printout of the solutions, it is hard to inspect the individual variable bindings of a particular solution.
The "Browser View" lists the bindings for a variable across all solutions to a query. By default, a column is shown for each of the variables in the query. The columns are ordered according to the "Variable View Ordering" sub-pane:
The first column lists the different bindings for variable ?s across the solutions to the query. If you select one of those bindings, the next column will list the bindings for variable ?e of all solutions in which variable ?s is bound to the selected binding. The second column in the following screenshot therefore lists the bindings for variable ?e of the solutions in which ?s is bound to "return fibonacci(n-1) + fibonacci(n-2)":
You can re-order the columns of the "Browser View" by re-ordering the variables in the "Variable View Ordering" sub-pane. To do so, click on the variables in the sub-pane in the desired order. A sequence number will appear before each variable as you click it. Unclicked variables will no longer show up in the view. When ready, hit "Apply" to update the view:
In the above screenshot, the first column lists the bindings for variable ?e. The second column shows the bindings for variable ?s of the solutions in which ?e is bound to "nil". This is the binding for ?e selected in the first column.
In contrast to the "Text View", individual variable bindings can be inspected in the "Browser View". To do so, select 'Inspect' from the context menu of a binding (obtained by right clicking on the binding). An Inspector window on the binding will pop up:
The above screenshot shows an inspector window on the binding for ?e. This turns out to be an instance of class org.eclipse.jdt.core.dom.InfixExpression. To illustrate that variable bindings can be manipulated like regular objects, the bottom pane of the inspector window shows the result of sending message 'getLeftOperand' to the InfixExpression.
Like the "Browser View", the "Tree View" lists the bindings for a variable across all solutions to a query ---but displays them as a tree:
Again, the shape of the tree is determined by the "Variable View Ordering" sub-pane.