SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Prolog Call Hierarchy

The Prolog Call Hierarchy displays the call hierarchy of predicates. It has one root predicate for which the hierarchy is presented. The hierarchy supports two different modes: caller and callee. The lookup for calls is performed in the currently selected Prolog process.

The left side of the view shows the hierarchy as a tree.

  • The children of a predicate are either its callers or its callees (depending on the selected mode).
  • The icon of a predicate represents its visibility:
    • Exported or defined in user
    • Non-exported
    • Undefined predicate (only possible in the callee mode)
  • The number of calls is shown behind the predicate name if it is larger than one.
  • A double-click on a predicate will select the first call in an editor.

The right side is a table listing all calls from/to the predicate selected in the tree. Double-clicking on a call will select this call in an editor.

Open the Call Hierarchy / Select a Root Predicate

The Call Hierarchy can be opened in two ways. The first way is to select a predicate in the editor and to choose “Open Call Hierarchy” from the context menu. This opens the hierarchy and sets the selected predicate as root predicate.

The second way is to open the view via WindowShow ViewProlog Call Hierarchy (or OtherProlog Call Hierarchy if the Prolog Perspective is not opened). After opening the view the root predicate needs to be set.

The root predicate is set via the first toolbar button (). The opened dialog then allows typing the predicate. The following form is expected:
Module : Name / Arity

Mode

The mode can be chosen in the toolbar.

  • Caller: The children of a predicate shown in the tree are its callers.
  • Callee: The children of a predicate shown in the tree are its callees.

Scope

The Call Hierarchy allows to limit the scope where to search for predicate calls. The possible scopes are:

  • Workspace: The entire code that is loaded in the currently selected Prolog process is searched.
  • Project…: A dialog is opened which allows to select a single project as scope for the search. Only calls which are contained in file in this project are shown in the hierarchy.

History

The view remembers the last 10 root predicates. The list opened via allows selecting these as root predicate.

research/pdt/docs/call_hierarchy.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2025