Previous Up Next

4  The Graphical User Interface

If you invoke Kettle with the -gui argument, it will invoke the GUI after proving a fact. The purpose of the GUI is to show what goals were successful (and to show a proof for them) and which were not. The GUI is only useful if the input to Kettle contains annotations naming the various parts of the predicate to be proved. We discuss below an example of an input file containing GUI annotations, but if you are anxious you can find this example in the test/arith/gui.p file and you can play with it by running:
> cd test
> make prove/arith/gui EXTRAARGS=-gui

4.1  The GUI Annotations

For the GUI to work the input file must contain annotations in the form of a new predicate constructor. For example, if p is a predicate then the following is an annotated version of p, saying that the name of the predicate is "this is p" and that it corresponds to line 9 in the file named foo.java:
(block [file:"foo.java",line:9,name:"this is p"]  p)
This section is written using the LF input language. For the CVC input language the same is true except that the syntax for the above example is
BLOCK [file:"foo.java",line:9,name:"this is p"]
p
ENDBLOCK
There must be a block annotation surrounding each top-level predicate to be proved. This will give the name that the GUI will show for the top-level predicate.

Each assumption and each goal that is encountered in the predicate are associated with the innermost block that contains them. If you want the maximum amount of information in the GUI you must have a block annotation for each assumption and for each goal. For example, the following input describes a predicate with two parts, the first part having an assumption and two goals.
Sat_p1 : pf
  (block [file:"foo.java",line:9,name:"this is p"]
    (block [file:"foo.java",line:9,name:"Part1"]
       (=> (x < 0) 
           (block [file:"foo.java",line:10,name:"Part1-Goal1"]
              (<= (+ x 1) 0)
           )
           (block [file:"foo.java",line:11,name:"Part1-Goal2"]
              (<= (+ x 1) 0)
           ))
    )
    (block [file:"foo.java",line:29,name:"Part2"]
           (block [file:"foo.java",line:11,name:"Part2-Goal1"]
              (= 0 0)
           )
    )
  )
The nested structure of the blocks gives the hierarchy.

4.2  The GUI panes

The GUI has four panes: Position, Source, Goals and Assumptions. The Position pane shows a hierarchical view of the verification steps. There is a root node, whose children are the individual predicates to be proved. Nodes with a little triangle handle are internal nodes in the hierarchy. If you click on the handle you can collapse or expand the hierarchy under that node. If you click on the label for a node, then the source pane shows the line to which it corresponds.

The Assumptions pane shows the assumptions that are in scope at the start of a block (not including the assumptions in the block itself). Typically, as you go does in the hierarchy, you will have more assumptions. Assumptions have names (e.g. H_1), which are refered from the proofs.

The Goal pane shows different things for different kinds of nodes. If you are on a goal node (typically a leaf) then you will see the goals for that node, along with their proofs. If you are on an assumption node, you will see in the Goals pane the assumption(s) that the node is adding.

In both the Assumptions and the Goals panes you can double click on a line and you get a pretty-printed version of the line in a separate window.

If all goals are successful then the GUI will start with all nodes collapsed. If there are failed goals then the tree is expanded to show all the failures. Also, the failed goals and all the parent nodes are collored red.

The GUI will try to find the files to show in the Source pane based on the information contained in the predicate annotations, along with a set of search directories (semicolon separated path names). The search directories, along with all configuration elements of the GUI are saved in a file called kettle_gui.cfg in the current directory and are restored automatically at the next invocation.


Previous Up Next