SlideShare a Scribd company logo
1 of 18
 
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Read as IF
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Variables in Prolog get their values by being  unified  with values. Until it gets a value, a variable is said to be  free ; when it gets a value, it becomes  bound . When backtracking; variables becomes free again. Variables are used as part of the pattern-matching, process, not as a kind of information storage.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
domains mydom = i(integer); s(string) predicates procedure wr(mydom) - (i) clauses wr(i(Int)):- write("Was integer: ",Int). wr(s(Str)) :- write("Was String: ",Str). GOAL wr(i(88)). Passing input to the predicate The variable will be bound to 88 Procedure means no fail! Only input flow accepted! Case/switch statement!
Factorial of 1 is 1 Factorial of N is N multiplied with factorial of N-1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Erroneous - Always exit failure - Always fail procedure - Always success determ - succeed or fails multi - 1 or more solutions (never fail) nondeterm - 0 or more solutions predicates   append(list,list,list)- procedure (i,i,o), determ (i,i,i) nondeterm (o,i,i)
write(Param1, Param2, Param3, ..., ParamN) readln(Line) readchar(CharParam) file_str(Filename, Text)  - file_str("t.dat", My_text) openread(SymbolicFileName, OSFileName) openwrite(SymbolicFileName, OSFileName) closefile(SymbolicFileName)
[object Object],[object Object],save(fileName) /* (i) */ save(fileName, databaseName) /* (i, i) */
Stack: the stack is used for transferring arguments and return addresses for predicate calls. The stack also holds the information for backtrackpoints. Heap:  the heap holds all objects that are more or less permanent, such as database facts, window buffers, file buffers etc. Gstack:  the global stack, normally called gstack, is the place where lists, compound structures and strings are placed. The Gstack is only released during backtracking. Trail:  the trail is only used when the program uses reference variables. It holds information about which reference variables must be unbound during backtracking. The trail is allocated in the heap.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

ARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCEARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCE
Sabique Khan
 

What's hot (20)

Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming Language
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
POST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEMPOST’s CORRESPONDENCE PROBLEM
POST’s CORRESPONDENCE PROBLEM
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
 
Prolog
PrologProlog
Prolog
 
ARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCEARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCE
 
prolog ppt
prolog pptprolog ppt
prolog ppt
 
Deep Learning for Natural Language Processing: Word Embeddings
Deep Learning for Natural Language Processing: Word EmbeddingsDeep Learning for Natural Language Processing: Word Embeddings
Deep Learning for Natural Language Processing: Word Embeddings
 
A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
 
Lecture 3 general problem solver
Lecture 3 general problem solverLecture 3 general problem solver
Lecture 3 general problem solver
 
INTRODUCTION TO LISP
INTRODUCTION TO LISPINTRODUCTION TO LISP
INTRODUCTION TO LISP
 
#4 formal methods – predicate logic
#4 formal methods – predicate logic#4 formal methods – predicate logic
#4 formal methods – predicate logic
 
Compiler design syntax analysis
Compiler design syntax analysisCompiler design syntax analysis
Compiler design syntax analysis
 
Truth management system
Truth  management systemTruth  management system
Truth management system
 
Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and Reasoning
 
Lecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language TechnologyLecture 1: Semantic Analysis in Language Technology
Lecture 1: Semantic Analysis in Language Technology
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Parsing
ParsingParsing
Parsing
 

Similar to Artificial intelligence Prolog Language

Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiers
butest
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory building
ClarkTony
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programación
Software Guru
 

Similar to Artificial intelligence Prolog Language (20)

AI Lab Manual.docx
AI Lab Manual.docxAI Lab Manual.docx
AI Lab Manual.docx
 
Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiers
 
Erlang session1
Erlang session1Erlang session1
Erlang session1
 
Fol
FolFol
Fol
 
Prolog PPT_merged.pdf
Prolog PPT_merged.pdfProlog PPT_merged.pdf
Prolog PPT_merged.pdf
 
Chaps 1-3-ai-prolog
Chaps 1-3-ai-prologChaps 1-3-ai-prolog
Chaps 1-3-ai-prolog
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
app4.pptx
app4.pptxapp4.pptx
app4.pptx
 
R language
R languageR language
R language
 
CPPDS Slide.pdf
CPPDS Slide.pdfCPPDS Slide.pdf
CPPDS Slide.pdf
 
Prolog 7-Languages
Prolog 7-LanguagesProlog 7-Languages
Prolog 7-Languages
 
Prolog & lisp
Prolog & lispProlog & lisp
Prolog & lisp
 
2015 bioinformatics python_strings_wim_vancriekinge
2015 bioinformatics python_strings_wim_vancriekinge2015 bioinformatics python_strings_wim_vancriekinge
2015 bioinformatics python_strings_wim_vancriekinge
 
Python slide
Python slidePython slide
Python slide
 
Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.Lab report for Prolog program in artificial intelligence.
Lab report for Prolog program in artificial intelligence.
 
3.5
3.53.5
3.5
 
Pl vol1
Pl vol1Pl vol1
Pl vol1
 
Dsm as theory building
Dsm as theory buildingDsm as theory building
Dsm as theory building
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programación
 

More from REHMAT ULLAH

More from REHMAT ULLAH (20)

Poker Game
Poker GamePoker Game
Poker Game
 
Men's clothing at style war
Men's clothing  at style warMen's clothing  at style war
Men's clothing at style war
 
software project management Software development life cycle
software project  management Software development life cyclesoftware project  management Software development life cycle
software project management Software development life cycle
 
Software project management Improving Team Effectiveness
Software project management Improving Team EffectivenessSoftware project management Improving Team Effectiveness
Software project management Improving Team Effectiveness
 
software project management Software inspection
software project management Software inspectionsoftware project management Software inspection
software project management Software inspection
 
Improving of software processes
Improving of software processesImproving of software processes
Improving of software processes
 
software project management Elaboration phase
software project management Elaboration phasesoftware project management Elaboration phase
software project management Elaboration phase
 
software project management Improvement in size
software project management  Improvement in sizesoftware project management  Improvement in size
software project management Improvement in size
 
Software development life cycle Construction phase
Software development life cycle Construction phaseSoftware development life cycle Construction phase
Software development life cycle Construction phase
 
software project management Artifact set(spm)
software project management Artifact set(spm)software project management Artifact set(spm)
software project management Artifact set(spm)
 
software project management Waterfall model
software project management Waterfall modelsoftware project management Waterfall model
software project management Waterfall model
 
Software project management Software economics
Software project management Software economicsSoftware project management Software economics
Software project management Software economics
 
Introduction of software project management
Introduction of software project managementIntroduction of software project management
Introduction of software project management
 
software project management Cocomo model
software project management Cocomo modelsoftware project management Cocomo model
software project management Cocomo model
 
software project management Assumption about conventional model
software project management Assumption about conventional modelsoftware project management Assumption about conventional model
software project management Assumption about conventional model
 
Usability engineering Usability testing
Usability engineering Usability testingUsability engineering Usability testing
Usability engineering Usability testing
 
Usability engineering Usability issues(iphone)
Usability engineering Usability issues(iphone)Usability engineering Usability issues(iphone)
Usability engineering Usability issues(iphone)
 
Usability engineering Usability issues in mobile web
Usability engineering Usability issues in mobile webUsability engineering Usability issues in mobile web
Usability engineering Usability issues in mobile web
 
Usability engineering Usability issues in firefox
Usability engineering Usability issues in firefoxUsability engineering Usability issues in firefox
Usability engineering Usability issues in firefox
 
Software Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testingSoftware Quality Assurance(Sqa) automated software testing
Software Quality Assurance(Sqa) automated software testing
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

Artificial intelligence Prolog Language

  • 1.  
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Variables in Prolog get their values by being unified with values. Until it gets a value, a variable is said to be free ; when it gets a value, it becomes bound . When backtracking; variables becomes free again. Variables are used as part of the pattern-matching, process, not as a kind of information storage.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. domains mydom = i(integer); s(string) predicates procedure wr(mydom) - (i) clauses wr(i(Int)):- write("Was integer: ",Int). wr(s(Str)) :- write("Was String: ",Str). GOAL wr(i(88)). Passing input to the predicate The variable will be bound to 88 Procedure means no fail! Only input flow accepted! Case/switch statement!
  • 13.
  • 14. Erroneous - Always exit failure - Always fail procedure - Always success determ - succeed or fails multi - 1 or more solutions (never fail) nondeterm - 0 or more solutions predicates append(list,list,list)- procedure (i,i,o), determ (i,i,i) nondeterm (o,i,i)
  • 15. write(Param1, Param2, Param3, ..., ParamN) readln(Line) readchar(CharParam) file_str(Filename, Text) - file_str("t.dat", My_text) openread(SymbolicFileName, OSFileName) openwrite(SymbolicFileName, OSFileName) closefile(SymbolicFileName)
  • 16.
  • 17. Stack: the stack is used for transferring arguments and return addresses for predicate calls. The stack also holds the information for backtrackpoints. Heap: the heap holds all objects that are more or less permanent, such as database facts, window buffers, file buffers etc. Gstack: the global stack, normally called gstack, is the place where lists, compound structures and strings are placed. The Gstack is only released during backtracking. Trail: the trail is only used when the program uses reference variables. It holds information about which reference variables must be unbound during backtracking. The trail is allocated in the heap.
  • 18.