-
-
- Using the Prolog IDE
-
-
-
Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
The Prolog Search finds code loaded into the Prolog process that is currently selected in the Prolog Console. It will not find predicates in files that are not consulted! If you want a textual search, use the textual search dialog that is standard in Eclipse.
There are three ways to run a search:
The Prolog Search dialog is availabe via the menu “Search” –> “Search…” or the keyboard shortcut <CTRL> <H>. Two different types of searches are possible.
The following options are supported:
mod
is the searched module name the search will find mod:pred
) pred
if pred is imported from mod
, typically via a use_module directive) Three different problem searches are possible:
pdt_call_analysis:entry_point/1
andpdt_call_analysis:entry_point/1
(the expected format is Module:PredicateSymbol/Arity
).For each search it is possible to use the Create Warnings option. If enabled a persistent Eclipse marker will be created for each search result.
The results of the Prolog Search are presented in the Search View. The following elements are shown in this view:
This is how search results for different search options look like. The searches were performed on the PDT Tutorial Project.
You can start the search for predicates directly from the editor.
The search for predicate declarations and definitions from the editor will find the same results like the global search via the search dialog but the results will contain information regarding the context (current file) of the search:
The “invisible” category is intended to make programmers aware of unrelated but homonymous predicates that could lead to confusion.
If results on multiple categories are found the categories are ordered as shown above (supermodules, local module, submodules and invisible predicates).
The reference search in the editor will find exactly the same results as the global reference search.
Sometimes you might want to search for a predicate mentioned in a console message. For example, after a message about a call to an undefined predicate you might want to find all other references to it.
For this, select the predicate name (or full predicate indicator name/arity) in the console and choose “Open Search Dialog” from the context menu. The Prolog Search dialog will be opened with the current text selection in the Prolog Console as input.