using turbo prolog

12
Shri Sant Gajanan Maharaj College Of Engineering, Shegaon Using Turbo Prolog - By Ravindra Prasad Mahto

Upload: ravindra-prasad-mahto

Post on 20-Nov-2014

173 views

Category:

Documents


3 download

DESCRIPTION

manual of how to use turbo prolog IDE

TRANSCRIPT

Page 1: Using Turbo Prolog

Shri Sant Gajanan Maharaj College Of

Engineering, Shegaon

“ Using Turbo Prolog “

- By Ravindra Prasad Mahto

Page 2: Using Turbo Prolog

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.

Page 3: Using Turbo Prolog

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.

Page 4: Using Turbo Prolog

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.

Page 5: Using Turbo Prolog

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.

Page 6: Using Turbo Prolog

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.

Page 7: Using Turbo Prolog

Creating A Sample Program

• Basics Steps for creating and executing program1. 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.

Page 8: Using Turbo Prolog

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

Page 9: Using Turbo Prolog

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

Page 10: Using Turbo Prolog

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:

Page 11: Using Turbo Prolog

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.

Page 12: Using Turbo Prolog

Thank You…..