Shri Sant Gajanan
Maharaj College Of
Engineering,
Shegaon
“ Using Turbo Prolog “
- By Ravindra Prasad Mahto
What We Come To Know At Last..
• We can able to understand the basic
mechanical aspects of using Turbo Prolog.
• We can able to create a program, edit a
program, and execute processes using Turbo
Prolog.
• We can able to use the Prolog commands to
create functioning programs.
Starting Turbo Prolog
• To start Turbo Prolog, switch to the
subdirectory of Prolog programs and enter-
PROLOG followed by a carriage return.
• GUI of Turbo Prolog:-
– GUI is composed of four panels and a main menu
bar.
GUI – Windows Panel
• Four panels are:- EDITOR, DIALOG,
MESSAGE, and TRACE.
• EDITOR:- used to create or edit .
• DIALOG:- used to view the output.
• MESSAGE:- it keep us up to date on
processing activity.
• TRACE:- is used for finding problems in the
program.
GUI – Menu Bar
• Seven options in the Menu Bar are:- RUN,
COMPILE, EDIT, OPTIONS, FILES, SETUP and
QUIT.
• RUN:- compilers and runs a compiled program.
• COMPILE:- compilers a program in memory for
execution.
• EDIT:- creates a new program or changes a program
that is currently in memory.
• OPTIONS:- selects a type a compilation to use.
GUI – Menu Bar…
• FILES:- loads a program from the disk to
memory or saves a program currently
in memory to disk.
• SETUP:- changes the setup parameters(such
as window sizes or positions) and
saves the new values for use in
subsequent sessions.
• QUIT:- aborts Turbo Prolog and return to OS.
Creating A Sample Program
• Basics Steps for creating and executing program
1. Select the EDIT mode and enter the program.
2. Enter text or make corrections as necessary.
3. Save the program to disk using the FILE Save
option.
4. Compile the program.
5. Execute the program.
6. Observe the output according to the given input.
Shortcuts used in Turbo Prolog
• While Editing…
– F1 Help(displays the help file, PROLOG.HLP)
– F2 Go to line
– F3/Ctrl-QI Find
– F4/Ctrl-QA Find and replace
– F10/ESC Exit EDITOR
– Ctrl-Y Delete line
– Ctrl-QY Delete to end of line
– INS/Ctrl-V Insert mode toggle
– Ctrl-S/ Character left
– Ctrl-D/ Character right
Shortcuts used in Turbo Prolog…
– Ctrl-R/PgUp Page up
– Ctrl-C/PgDn Page down
– END/Ctrl-QD End of line
– Home/Ctrl-QS Beginning of line
– Ctrl-E Move one line up
– Ctrl-X Move one line down
Compilation And Execution
• To compile and execute program, exit the EDITOR
using F10 or ESC. Then select the RUN option from
the main menu or press F9. The program will execute
automatically. Message will be displayed in
MESSAGE window.
• If there is no errors, you will see a prompt in the
DIALOG window.
• If the program contains errors, it will return to the
EDITOR.
• In the DIALOG box, you will see the goal prompt as
Goal:
Compilation And Execution…
• The compilation process converts the program into a
special form that executes very quickly.
• The original (or source) text of the program also
remains in memory.
• We can always return to the editor window and
modify, compile, and execute the program because
Turbo Prolog, source program, and compiled version
of the program are all in the memory at the same
time.
Thank You…..