🗊Презентация Structure of the program in Prolog. Execution management

Нажмите для полного просмотра!
Structure of the program in Prolog. Execution management, слайд №1Structure of the program in Prolog. Execution management, слайд №2Structure of the program in Prolog. Execution management, слайд №3Structure of the program in Prolog. Execution management, слайд №4Structure of the program in Prolog. Execution management, слайд №5Structure of the program in Prolog. Execution management, слайд №6Structure of the program in Prolog. Execution management, слайд №7Structure of the program in Prolog. Execution management, слайд №8Structure of the program in Prolog. Execution management, слайд №9Structure of the program in Prolog. Execution management, слайд №10Structure of the program in Prolog. Execution management, слайд №11Structure of the program in Prolog. Execution management, слайд №12Structure of the program in Prolog. Execution management, слайд №13Structure of the program in Prolog. Execution management, слайд №14Structure of the program in Prolog. Execution management, слайд №15Structure of the program in Prolog. Execution management, слайд №16Structure of the program in Prolog. Execution management, слайд №17Structure of the program in Prolog. Execution management, слайд №18Structure of the program in Prolog. Execution management, слайд №19Structure of the program in Prolog. Execution management, слайд №20Structure of the program in Prolog. Execution management, слайд №21Structure of the program in Prolog. Execution management, слайд №22Structure of the program in Prolog. Execution management, слайд №23

Вы можете ознакомиться и скачать презентацию на тему Structure of the program in Prolog. Execution management. Доклад-сообщение содержит 23 слайдов. Презентации для любого класса можно скачать бесплатно. Если материал и наш сайт презентаций Mypresentation Вам понравились – поделитесь им с друзьями с помощью социальных кнопок и добавьте в закладки в своем браузере.

Слайды и текст этой презентации


Слайд 1





Structure of the program in Prolog. Execution management
Lecture 4
Описание слайда:
Structure of the program in Prolog. Execution management Lecture 4

Слайд 2





Peculiarities of Visual Prolog
Visual Prolog is a compiled language
Other versions have elements of interpretation of a code during the execution
Strict data typing
Rules are not data: you can’t add or remove them during the execution
You can’t define new operations
Описание слайда:
Peculiarities of Visual Prolog Visual Prolog is a compiled language Other versions have elements of interpretation of a code during the execution Strict data typing Rules are not data: you can’t add or remove them during the execution You can’t define new operations

Слайд 3





Program sections
compiler directives 
CONSTANTS – section of constants description
DOMAINS – section of domains description
DATABASE – section of description of internal database predicates
PREDICATES – section of predicates description
CLAUSES – section of clauses description
GOAL – section of internal goal description
Описание слайда:
Program sections compiler directives CONSTANTS – section of constants description DOMAINS – section of domains description DATABASE – section of description of internal database predicates PREDICATES – section of predicates description CLAUSES – section of clauses description GOAL – section of internal goal description

Слайд 4





Peculiarities of Visual Prolog
All sections can be in any order
Predicates and domain must be defined before their usage
Predicates declared in a section DATABASE can be added and removed from internal database while the execution
Описание слайда:
Peculiarities of Visual Prolog All sections can be in any order Predicates and domain must be defined before their usage Predicates declared in a section DATABASE can be added and removed from internal database while the execution

Слайд 5





Program containing only the goal
GOAL 
write("hello"), readchar(_).
Описание слайда:
Program containing only the goal GOAL write("hello"), readchar(_).

Слайд 6





Compiler directives
trace – to trace the program
nowarnings – to suppress the message that a variable occurs only once
include – insertion of some file content
check_determ – compulsory check of predicates determination
Описание слайда:
Compiler directives trace – to trace the program nowarnings – to suppress the message that a variable occurs only once include – insertion of some file content check_determ – compulsory check of predicates determination

Слайд 7





Peculiarities of Visual Prolog
You can start tracing only for the definite predicate
If there is a tracing the optimization of recursion is not working
To establish non-determination of predicates by default: Options – Project – Compiler options – Warnings – Default predicate type – Nondeterm
Описание слайда:
Peculiarities of Visual Prolog You can start tracing only for the definite predicate If there is a tracing the optimization of recursion is not working To establish non-determination of predicates by default: Options – Project – Compiler options – Warnings – Default predicate type – Nondeterm

Слайд 8





Constants
CONSTANTS
pi=3.14
path="c:\\prolog\\bgi"
Описание слайда:
Constants CONSTANTS pi=3.14 path="c:\\prolog\\bgi"

Слайд 9





Domains
integer – an integer number (-32768...32767)
real – a float number (±e-307...±e308)
char – a symbol in apostrophes 
string – a sequence of symbols in double quotation marks
symbol – a symbolic constant (atom)
file – a file
Описание слайда:
Domains integer – an integer number (-32768...32767) real – a float number (±e-307...±e308) char – a symbol in apostrophes string – a sequence of symbols in double quotation marks symbol – a symbolic constant (atom) file – a file

Слайд 10





Description of your own domain
<name_domain> = <description_domain>
or
file = <symbolic file name1>; ...; 
	<symbolic file nameN>
or
<name_list_domain> = <name_domain_of_list_elements>*
Examples:
DOMAINS
i=integer
list=i*
Описание слайда:
Description of your own domain <name_domain> = <description_domain> or file = <symbolic file name1>; ...; <symbolic file nameN> or <name_list_domain> = <name_domain_of_list_elements>* Examples: DOMAINS i=integer list=i*

Слайд 11





Description of a structured domain
<name_structure> = <name_functor> (<name_domain_first_component>, ..., <name_domain_last_component>) [;<name_functor>(...)]*
Examples:
flatpoint = p(integer, integer)
triangle = tr(point, point, point)
fullpoint = p(integer, integer); p(integer, integer, integer)
Описание слайда:
Description of a structured domain <name_structure> = <name_functor> (<name_domain_first_component>, ..., <name_domain_last_component>) [;<name_functor>(...)]* Examples: flatpoint = p(integer, integer) triangle = tr(point, point, point) fullpoint = p(integer, integer); p(integer, integer, integer)

Слайд 12





Description of predicates
<name_predicate> (<name_first_argument>, ..., <name_last_argument>).
Examples:
PREDICATES
mother(string,string).
member(integer,integer*).
member(real,real*).
member(char,char*).
member(string,string*).
Описание слайда:
Description of predicates <name_predicate> (<name_first_argument>, ..., <name_last_argument>). Examples: PREDICATES mother(string,string). member(integer,integer*). member(real,real*). member(char,char*). member(string,string*).

Слайд 13





Standard predicates
readln(_)
readint(_)
readreal(_)
readchar(_)
readterm(name_domain, term_domain)
write([<variable / constant / value>,…])
writef – format output
Описание слайда:
Standard predicates readln(_) readint(_) readreal(_) readchar(_) readterm(name_domain, term_domain) write([<variable / constant / value>,…]) writef – format output

Слайд 14





Standard predicates
div()
mod()
trunc()
round()
random(_)
random(<число>,_)
All embedded predicates are determinated
Описание слайда:
Standard predicates div() mod() trunc() round() random(_) random(<число>,_) All embedded predicates are determinated

Слайд 15





Program “Relatives”
DOMAINS
s=string
PREDICATES
nondeterm mother(s,s)
nondeterm grandmother(s,s)
CLAUSES
mother("Наташа","Даша"). 
mother("Даша","Маша"). 
grandmother(X,Y):-
   mother(X,Z), 
   mother(Z,Y).
Описание слайда:
Program “Relatives” DOMAINS s=string PREDICATES nondeterm mother(s,s) nondeterm grandmother(s,s) CLAUSES mother("Наташа","Даша"). mother("Даша","Маша"). grandmother(X,Y):- mother(X,Z), mother(Z,Y).

Слайд 16





Execution management
Method of a depth search (backtracking)
Method of a rollback after a failure
Cut and rollback
Method of a user-defined search
Описание слайда:
Execution management Method of a depth search (backtracking) Method of a rollback after a failure Cut and rollback Method of a user-defined search

Слайд 17





Backtracking 
DOMAINS
s=string
PREDICATES
mother(s,s)
grandmother(s,s) 
CLAUSES
mother(“Dasha",“Masha"). 
mother(“Natasha",”Dasha"). 
mother(“Natasha",”Glasha"). 
mother(“Dasha",”Sasha"). 
grandmother(X,Y):–
             mother(X,Z), 
             mother(Z,Y).
Описание слайда:
Backtracking DOMAINS s=string PREDICATES mother(s,s) grandmother(s,s) CLAUSES mother(“Dasha",“Masha"). mother(“Natasha",”Dasha"). mother(“Natasha",”Glasha"). mother(“Dasha",”Sasha"). grandmother(X,Y):– mother(X,Z), mother(Z,Y).

Слайд 18





Method of a rollback after a failure
DOMAINS
s=string
PREDICATES
mother(s,s)
grandmother(s,s) 
CLAUSES
mother(“Dasha",“Masha"). 
mother(“Natasha",”Dasha"). 
mother(“Natasha",”Glasha"). 
mother(“Dasha",”Sasha"). 
grandmother(X,Y):–
             mother(X,Z), 
             mother(Z,Y).
Описание слайда:
Method of a rollback after a failure DOMAINS s=string PREDICATES mother(s,s) grandmother(s,s) CLAUSES mother(“Dasha",“Masha"). mother(“Natasha",”Dasha"). mother(“Natasha",”Glasha"). mother(“Dasha",”Sasha"). grandmother(X,Y):– mother(X,Z), mother(Z,Y).

Слайд 19





Method of a rollback after a failure
DOMAINS
s=string
PREDICATES
mother(s,s)
grandmother(s,s) 
CLAUSES
mother(“Dasha",“Masha"). 
mother(“Natasha",”Dasha"). 
mother(“Natasha",”Glasha"). 
mother(“Dasha",”Sasha"). 
grandmother(X,Y):–
             mother(X,Z), 
             mother(Z,Y).
Описание слайда:
Method of a rollback after a failure DOMAINS s=string PREDICATES mother(s,s) grandmother(s,s) CLAUSES mother(“Dasha",“Masha"). mother(“Natasha",”Dasha"). mother(“Natasha",”Glasha"). mother(“Dasha",”Sasha"). grandmother(X,Y):– mother(X,Z), mother(Z,Y).

Слайд 20





Method of a rollback after a failure
DOMAINS
s=string
PREDICATES
mother(s,s)
grandmother(s,s) 
show_names
CLAUSES
mother(“Dasha",“Masha"). 
mother(“Natasha",”Dasha"). 
mother(“Natasha",”Glasha"). 
mother(“Dasha",”Sasha"). 
grandmother(X,Y):–
             mother(X,Z), 
             mother(Z,Y).
Описание слайда:
Method of a rollback after a failure DOMAINS s=string PREDICATES mother(s,s) grandmother(s,s) show_names CLAUSES mother(“Dasha",“Masha"). mother(“Natasha",”Dasha"). mother(“Natasha",”Glasha"). mother(“Dasha",”Sasha"). grandmother(X,Y):– mother(X,Z), mother(Z,Y).

Слайд 21





Method of a rollback after a failure
DOMAINS
s=string
PREDICATES
mother(s,s)
grandmother(s,s) 
show_names2(s)
CLAUSES
mother(“Dasha",“Masha"). 
mother(“Natasha",”Dasha"). 
mother(“Natasha",”Glasha"). 
mother(“Dasha",”Sasha"). 
grandmother(X,Y):–
             mother(X,Z), 
             mother(Z,Y).
Описание слайда:
Method of a rollback after a failure DOMAINS s=string PREDICATES mother(s,s) grandmother(s,s) show_names2(s) CLAUSES mother(“Dasha",“Masha"). mother(“Natasha",”Dasha"). mother(“Natasha",”Glasha"). mother(“Dasha",”Sasha"). grandmother(X,Y):– mother(X,Z), mother(Z,Y).

Слайд 22





Cut and rollback
Описание слайда:
Cut and rollback

Слайд 23





Method of a user-defined search
Описание слайда:
Method of a user-defined search



Похожие презентации
Mypresentation.ru
Загрузить презентацию