SlideShare a Scribd company logo
Introduction
To
PROLOG
PREPARED BY-
SHOWKOT USMAN
ID: 15-02-01-008
DEPT. OF CSE
GUB
1
2
 Introduction
 CURRENT IMPLEMENTATIONS
 SWI_PROLOG
 Fundamentals of PROLOG
 Applications
 References
Objective
 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
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
 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
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 ?
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
1. Facts
2. Rules
3. Query
4. Variables
5. Unification
6. Resolution
8
Fundamentals
 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
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
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
 Always begin with a capital letter
 ?- likes (john,X).
 ?- likes (john, Something).
 But not
 ?- likes (john,something)
12
Variables
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
 Prolog associates variables and values using a
process
known as unification
 Variables that receive a value are said to be
instantiated
14
Unification
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
References
 Artificial Intellegence & Expert System
DAN .W PATERSON
 www.swi-prolog.org/
 http://www.learnprolognow.org
16
Thank You
17

More Related Content

Similar to Artificial Intelligence and Expert System

Why on Earth would I test if I have to just "Let it crash"?
Why on Earth would I test if I have to just "Let it crash"?Why on Earth would I test if I have to just "Let it crash"?
Why on Earth would I test if I have to just "Let it crash"?
Laura M. Castro
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in Perl
Curtis Poe
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : Basics
Mitul Desai
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
Soham Kansodaria
 
Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"
Lucidworks (Archived)
 
Prolog final
Prolog finalProlog final
Prolog final
Hassaan Ahmad
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
Jarrod Overson
 
java Statements
java Statementsjava Statements
java Statements
Usman Ali Kjs
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
Yura Nosenko
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
Deniz Oguz
 
________ ________1.ppt
________ ________1.ppt________ ________1.ppt
________ ________1.ppt
SamiAAli44
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
cargillfilberto
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
drandy1
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
monicafrancis71118
 
Microsoft azure data fundamentals (dp 900) practice tests 2022
Microsoft azure data fundamentals (dp 900) practice tests 2022Microsoft azure data fundamentals (dp 900) practice tests 2022
Microsoft azure data fundamentals (dp 900) practice tests 2022
SkillCertProExams
 
Test Driven Development and Quality Improvement
Test Driven Development and Quality ImprovementTest Driven Development and Quality Improvement
Test Driven Development and Quality Improvement
Carlos Solís
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
Abhijeet Dubey
 
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180
Mahmoud Samir Fayed
 
PYTHON PPT.pptx
PYTHON PPT.pptxPYTHON PPT.pptx
PYTHON PPT.pptx
AbhishekMourya36
 

Similar to Artificial Intelligence and Expert System (20)

Why on Earth would I test if I have to just "Let it crash"?
Why on Earth would I test if I have to just "Let it crash"?Why on Earth would I test if I have to just "Let it crash"?
Why on Earth would I test if I have to just "Let it crash"?
 
55j7
55j755j7
55j7
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in Perl
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : Basics
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
 
Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"Solr Cluster installation tool "Anuenue"
Solr Cluster installation tool "Anuenue"
 
Prolog final
Prolog finalProlog final
Prolog final
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 
java Statements
java Statementsjava Statements
java Statements
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
 
New Features Of JDK 7
New Features Of JDK 7New Features Of JDK 7
New Features Of JDK 7
 
________ ________1.ppt
________ ________1.ppt________ ________1.ppt
________ ________1.ppt
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
 
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docxCOMM 166 Final Research Proposal GuidelinesThe proposal should.docx
COMM 166 Final Research Proposal GuidelinesThe proposal should.docx
 
Microsoft azure data fundamentals (dp 900) practice tests 2022
Microsoft azure data fundamentals (dp 900) practice tests 2022Microsoft azure data fundamentals (dp 900) practice tests 2022
Microsoft azure data fundamentals (dp 900) practice tests 2022
 
Test Driven Development and Quality Improvement
Test Driven Development and Quality ImprovementTest Driven Development and Quality Improvement
Test Driven Development and Quality Improvement
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180
 
PYTHON PPT.pptx
PYTHON PPT.pptxPYTHON PPT.pptx
PYTHON PPT.pptx
 

More from Showkot Usman

Introduction to Prolog
Introduction to Prolog Introduction to Prolog
Introduction to Prolog
Showkot Usman
 
Modes of Operation
Modes of Operation Modes of Operation
Modes of Operation
Showkot Usman
 
HDLC
HDLC HDLC
Management
ManagementManagement
Management
Showkot Usman
 
Electro magnatism
Electro magnatismElectro magnatism
Electro magnatism
Showkot Usman
 
Economice
EconomiceEconomice
Economice
Showkot Usman
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
Showkot Usman
 

More from Showkot Usman (7)

Introduction to Prolog
Introduction to Prolog Introduction to Prolog
Introduction to Prolog
 
Modes of Operation
Modes of Operation Modes of Operation
Modes of Operation
 
HDLC
HDLC HDLC
HDLC
 
Management
ManagementManagement
Management
 
Electro magnatism
Electro magnatismElectro magnatism
Electro magnatism
 
Economice
EconomiceEconomice
Economice
 
System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)System Development Life Cycle (SDLC)
System Development Life Cycle (SDLC)
 

Recently uploaded

J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 

Recently uploaded (20)

J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 

Artificial Intelligence and Expert System

  • 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
  • 8. 1. Facts 2. Rules 3. Query 4. Variables 5. Unification 6. Resolution 8 Fundamentals
  • 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
  • 16. References  Artificial Intellegence & Expert System DAN .W PATERSON  www.swi-prolog.org/  http://www.learnprolognow.org 16