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

What's hot (20)

R Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RR Programming: Mathematical Functions In R
R Programming: Mathematical Functions In R
 
Prolog (present)
Prolog (present) Prolog (present)
Prolog (present)
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
 
Prolog & lisp
Prolog & lispProlog & lisp
Prolog & lisp
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 
prolog ppt
prolog pptprolog ppt
prolog ppt
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
 
Pattern matching
Pattern matchingPattern matching
Pattern matching
 
Adbms 15 object data management group
Adbms 15 object data management groupAdbms 15 object data management group
Adbms 15 object data management group
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
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.
 
Loops and functions in r
Loops and functions in rLoops and functions in r
Loops and functions in r
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
String matching, naive,
String matching, naive,String matching, naive,
String matching, naive,
 
Language
LanguageLanguage
Language
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 

Similar to Artificial intelligence Prolog Language

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
 
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
 
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
 
Prolog
PrologProlog
Prolog
 
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
 
Plc part 4
Plc  part 4Plc  part 4
Plc part 4
 

More from REHMAT ULLAH

Men's clothing at style war
Men's clothing  at style warMen's clothing  at style war
Men's clothing at style warREHMAT ULLAH
 
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 cycleREHMAT ULLAH
 
Software project management Improving Team Effectiveness
Software project management Improving Team EffectivenessSoftware project management Improving Team Effectiveness
Software project management Improving Team EffectivenessREHMAT ULLAH
 
software project management Software inspection
software project management Software inspectionsoftware project management Software inspection
software project management Software inspectionREHMAT ULLAH
 
Improving of software processes
Improving of software processesImproving of software processes
Improving of software processesREHMAT ULLAH
 
software project management Elaboration phase
software project management Elaboration phasesoftware project management Elaboration phase
software project management Elaboration phaseREHMAT ULLAH
 
software project management Improvement in size
software project management  Improvement in sizesoftware project management  Improvement in size
software project management Improvement in sizeREHMAT ULLAH
 
Software development life cycle Construction phase
Software development life cycle Construction phaseSoftware development life cycle Construction phase
Software development life cycle Construction phaseREHMAT ULLAH
 
software project management Artifact set(spm)
software project management Artifact set(spm)software project management Artifact set(spm)
software project management Artifact set(spm)REHMAT ULLAH
 
software project management Waterfall model
software project management Waterfall modelsoftware project management Waterfall model
software project management Waterfall modelREHMAT ULLAH
 
Software project management Software economics
Software project management Software economicsSoftware project management Software economics
Software project management Software economicsREHMAT ULLAH
 
Introduction of software project management
Introduction of software project managementIntroduction of software project management
Introduction of software project managementREHMAT ULLAH
 
software project management Cocomo model
software project management Cocomo modelsoftware project management Cocomo model
software project management Cocomo modelREHMAT ULLAH
 
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 modelREHMAT ULLAH
 
Usability engineering Usability testing
Usability engineering Usability testingUsability engineering Usability testing
Usability engineering Usability testingREHMAT ULLAH
 
Usability engineering Usability issues(iphone)
Usability engineering Usability issues(iphone)Usability engineering Usability issues(iphone)
Usability engineering Usability issues(iphone)REHMAT ULLAH
 
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 webREHMAT ULLAH
 
Usability engineering Usability issues in firefox
Usability engineering Usability issues in firefoxUsability engineering Usability issues in firefox
Usability engineering Usability issues in firefoxREHMAT ULLAH
 
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 testingREHMAT 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

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Recently uploaded (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

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.