This document provides an introduction to Prolog, including:
- Current popular Prolog implementations like SWI-Prolog.
- SWI-Prolog can be downloaded for free and runs on Windows and Linux.
- Prolog is a logical and declarative programming language, where programs logic to solve problems.
- Prolog has applications in areas like intelligent data retrieval, expert systems, machine learning, and robot planning by using facts, rules, queries, variables, and unification.
Python Modules
Python Package
Python File I/O
Modules refer to a file containing Python statements and definitions.
A file containing Python code, for e.g.: filename.py, is called a module and its module name would be filename.
We use modules to break down large programs into small manageable and organized files. Furthermore, modules provide reusability of code.
We can define our most used functions in a module and import it, instead of copying their definitions into different programs.
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
Prolog, Prolog Programming IN AI. Prolog is an Artificial Intelligence programming language. Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Its applications include natural language understanding and expert systems. Prolog is notably a so-called nonprocedural, or declarative, language.
Python Modules
Python Package
Python File I/O
Modules refer to a file containing Python statements and definitions.
A file containing Python code, for e.g.: filename.py, is called a module and its module name would be filename.
We use modules to break down large programs into small manageable and organized files. Furthermore, modules provide reusability of code.
We can define our most used functions in a module and import it, instead of copying their definitions into different programs.
Python Session - 4
if
nested-if
if-else
elif (else if)
for loop (for iterating_var in sequence: )
while loop
break
continnue
pass
What is a function in Python?
Types of Functions
How to Define & Call Function
Scope and Lifetime of variables
lambda functions(anonymous functions)
Prolog, Prolog Programming IN AI. Prolog is an Artificial Intelligence programming language. Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Its applications include natural language understanding and expert systems. Prolog is notably a so-called nonprocedural, or declarative, language.
In this PDF you will find the basics of Turbo Prolog 2.0 with some good program and it's output. Also it's second part is coming in next month or week.
For any query ------------------> sohupatel8828@gmail.com
For programs ----------------> https://github.com/UltraHopeful/Turbo-Prolog-2.0
Mixi is one of the largest social networking services in Japan, providing various communication services for over 14M monthly active users. The latest internal mixi project is to replace the in-house search engine with Apache Solr. This session covers two topics; a simple packaging system for Solr that eases the installation process and daily operations, and implementation of a "Did you mean" facility for Japanese queries using a log mining tool. These tools have been released as OSS projects.
Workshop slides originally given at the WOPR Summit in Atlantic City. Use JavaScript parsers and generators like Shift combined with Puppeteer and Chrome to reverse engineer web applications
www.denizoguz.com-For an in company JDK 7 orientation I have prepared a presentation which summaries new features of JDK 7. I would like to make it public for everyone who needs it.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxcargillfilberto
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer to th.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxdrandy1
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer to th.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxmonicafrancis71118
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code here and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer t.
Microsoft azure data fundamentals (dp 900) practice tests 2022SkillCertProExams
• For a full set of 450+ questions. Go to
https://skillcertpro.com/product/microsoft-azure-data-fundamentals-dp-900-exam-questions/
• SkillCertPro offers detailed explanations to each question which helps to understand the concepts better.
• It is recommended to score above 85% in SkillCertPro exams before attempting a real exam.
• SkillCertPro updates exam questions every 2 weeks.
• You will get life time access and life time free updates
• SkillCertPro assures 100% pass guarantee in first attempt.
In this PDF you will find the basics of Turbo Prolog 2.0 with some good program and it's output. Also it's second part is coming in next month or week.
For any query ------------------> sohupatel8828@gmail.com
For programs ----------------> https://github.com/UltraHopeful/Turbo-Prolog-2.0
Mixi is one of the largest social networking services in Japan, providing various communication services for over 14M monthly active users. The latest internal mixi project is to replace the in-house search engine with Apache Solr. This session covers two topics; a simple packaging system for Solr that eases the installation process and daily operations, and implementation of a "Did you mean" facility for Japanese queries using a log mining tool. These tools have been released as OSS projects.
Workshop slides originally given at the WOPR Summit in Atlantic City. Use JavaScript parsers and generators like Shift combined with Puppeteer and Chrome to reverse engineer web applications
www.denizoguz.com-For an in company JDK 7 orientation I have prepared a presentation which summaries new features of JDK 7. I would like to make it public for everyone who needs it.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxcargillfilberto
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer to th.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxdrandy1
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer to th.
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxmonicafrancis71118
COMM 166 Final Research Proposal Guidelines
The proposal should contain well-developed sections (Put clear titles on the top of each section) of your outline that you submitted earlier. The proposal should have seven (7) major sections:
1. Introduction: A brief overview of all your sections. Approx. one page
2. A summary of the literature review. In this section you would summarize the previous research (summarize at least 8-10 scholarly research articles), and also your field data collection results (if it was connected to your proposal topic). Also indicate the gaps in the previous research, including your pilot study, and the need for your research study. Please devote around three pages in reviewing the previous research and finding the gaps.
3. Arising from the literature review, write the Purpose Statement of your research (purpose statement should have all its parts clearly written. Follow the examples from textbook).
4. Identify two to three main hypotheses or research questions (based on the quantitative/qualitative research design). Also give some of your supporting research questions. Follow the examples from textbook.
5. Describe the research strategy of inquiry and methods that you would use and why. The method part should be the substantial part of your paper, around three pages. Define your knowledge claims, strategies, and methods from the textbook (and cite), why you chose them, and how you will conduct the research in detail.
6. A page on the significance of your study.
7. A complete reference list of your sources in APA style.
The total length of the paper should be between 8-10 pages (excluding the reference and cover pages).
If you have further questions, please do not hesitate to contact me.
Best wishes
Dev
mportant notes about grading:
1. Compiler errors: All code you submit must compile. Programs that do not compile will receive an automatic zero. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.
2. Late assignments: You must submit your code before the deadline. Verify on Sakai that you have submitted the correct version. If you submit the incorrect version before the deadline and realize that you have done so after the deadline, we will only grade the version received before the deadline.
A Prolog interpreter
In this project, you will implement a Prolog interpreter in OCaml.
If you want to implement the project in Python, download the source code here and follow the README file. Parsing functions and test-cases are provided.
Pseudocode
Your main task is to implement the non-deterministic abstract interpreter covered in the lecture Control in Prolog. The pseudocode of the abstract interpreter is in the lecture note.
Bonus
There is also a bonus task for implementing a deterministic Prolog interpreter with support for backtracking (recover from bad choices) and choice points (produce multiple results). Please refer t.
Microsoft azure data fundamentals (dp 900) practice tests 2022SkillCertProExams
• For a full set of 450+ questions. Go to
https://skillcertpro.com/product/microsoft-azure-data-fundamentals-dp-900-exam-questions/
• SkillCertPro offers detailed explanations to each question which helps to understand the concepts better.
• It is recommended to score above 85% in SkillCertPro exams before attempting a real exam.
• SkillCertPro updates exam questions every 2 weeks.
• You will get life time access and life time free updates
• SkillCertPro assures 100% pass guarantee in first attempt.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
2. 2
Introduction
CURRENT IMPLEMENTATIONS
SWI_PROLOG
Fundamentals of PROLOG
Applications
References
Objective
3. Prolog is the most popular language of the logic
programing languages.
It is goal based language, it has automatic
backtracking and uses recursion.
Prolog stands for programmation en logique", or
programming in logic.“
3
Introduction
4. CURRENT
IMPLEMENTATIONS
There are several popular Prolog interpreters
available. They include:
1.GNU Prolog (http://pauillac.inria.fr/vdiaz/gnuprolog/)
2. Visual Prolog (http://www.visualprolog.com/vip6/Download/Default.htm)
3. Bprolog
(http://www.cad.mse.kyutech.ac.jp/people/zhou/bpr
olog.html)
4. SWI_PROLOG
4
5. SWI-Prolog offers a comprehensive FREE
Software Prolog environment.
Link for downloading:
http://www.swi-prolog.org/download/stable
A Self-installing executable for Windows: swipl-win.exe
Works on Windows XP
LINUX versions are also available.
5
SWI_PROLOG
6. o Prolog is a logical and a declarative
programming language.
o The name itself, Prolog, is short for
Programming in Logics.
o Prolog is the major example of a fourth
generation
programming language supporting the
declarative programming paradigm.
6
What is Prolog ?
7. Applications of Prolog
Some applications of Prolog are:
Intelligent data base retrieval
Natural language understanding
Expert systems
Specification language
Machine learning
Robot planning
Problem solving
7
9. The Prolog system uses the facts to work out how
to accomplish the solution by searching through
the space of possible solutions.
It is defined by an identifier followed by an n-
tuple of constants.
A relation identifier is referred to as a predicate
When a tuple of values is in a relation we say the
tuple satisfies the predicate.
Names of relationship and objects must begin
with a lowercase letter.
9
Facts
10. 1. Specifies under what conditions a tuple of
values satisfies a predicate.
2. The basic building block of a rule is called an
atom
3. Atom :- Atom1, ..., Atomn
If each of Atom1,...,Atomn is true, then Atom is
also true.
10
Rules
11. There are two types of queries:
1.Ground Query
edge(a,b)
This query is called a ground query because it consists only of
value identifiers as parameters to the predicate.
a ground query is posed we expect a yes/no answer.
2. Non Ground Query
They have variables as parameters
tedge(a,X)
11
Query
12. Always begin with a capital letter
?- likes (john,X).
?- likes (john, Something).
But not
?- likes (john,something)
12
Variables
13. Example
Facts: ()
◦ likes(john,mary).
◦ likes(john,X). % Variables begin with capital
Queries
◦ ?- likes(X,Y).
◦ X=john, Y=Mary. % hit “;” for more
◦ ?- likes(X,X).
◦ X=john.
13
14. Prolog associates variables and values using a
process
known as unification
Variables that receive a value are said to be
instantiated
14
Unification
15. Arithmetic in prolog
Prolog provides a number of basic arithmetic tools.
Arithmetic examples Prolog Notation
6 + 2 = 8 8 is 6+2.
6 *2 = 12 12 is 6*2.
Answers to arithmetic questions by using ariables.
For example:
?- X is 6+2.
X=8
15