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

User Tools

Site Tools

The Prolog Console

The Prolog Console View lets you query Prolog predicates and display the results.

Queries and Results

A query is typed in at the prompt and terminated with a full-stop ('.'). Hitting Enter after the full stop issues the query to the Prolog system and displays the results (if any). Typing a semicolon(';') displays the next result (or 'false', if there are no more results). Typing 'a' aborts the query.

The Prolog Console View includes a history mechanism (see keyboard shortcuts) and code completion.

Code Completion

The code completion of the Prolog Console View applies to built-in predicates and all user-defined predicates currently loaded into the Prolog system (including dynamically created ones). In the Prolog Console View, completion is triggered with Tab.

The Prolog Console Toolbar

The Console's toolbar (in the upper right-hand corner of the Console Window) provides the following buttons:

  • Create process: create a new, empty prolog process
  • Follow Mode: When active, the editor focus will decide about the used runtime. Otherwise the runtime can be manualy be selected from the drop-down list.
  • Activate GUI Tracer: This tells Prolog to use the graphical tracer for the next trace.
  • Select All: Selects the entire console output.
  • Cut
  • Copy
  • Paste
  • Paste the name of the current editor file.
  • Clear Console Output: Clears the console window but does not restart the current runtime.
  • Restart: Restart the Prolog runtime associated to the console. Its current contents will be lost and a new, empty process will be started. After a restart you need to reconsult all files.

Fonttype, -Size & Colors

can be configured in the Eclipse-Preferences → PDT Preferences → Prolog Console → Font & Color

Colored output

  • The colored output is triggered by special keywords at the beginnig of each line: “INFO:” , “WARNING:” , “ERROR:”, “DEBUG:”.
  • Indented lines with tab or two spaces belongs to the next keyword above.
  • The keywords are not case-sensitive
  • Colored output can be configured or (de)activated in the PDT-preferences.
writeln('Info: Hello World'),writeln('ERROR: Hello'),writeln('  World'), 
writeln('WArNinG: World Hello!'), writeln('debug: World Hello?'),
writeln('*** Hello World'),writeln('*** ERROR: Hello World'), writeln('***WArNinG: World Hello!').

results to

research/pdt/docs_archive/v0.x/console.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024