SlideShare a Scribd company logo
Presentation1
Topic:
Languages Of AI (lisp/prolog)

Group Members:
Shagufta Arif (027)
Sania Alyas (020)
Maryam Afza (006)
What is LISP??
LISP stands for (LIST
PROCESSING). It was invented
by John McCarthy in 1958. As its
name implies, LISP is a
programming language that
manipulates LISTS.
LISP Discription:
A list is either empty or non-empty.
[a, b, c, d]
Empty: []
Non-empty: head=[a] tail=[b, c, d]
Example:
 We can implement a function to compute

factorials using recursion:
 (defun factorial (N)
"Compute the factorial of N."
(if (= N 1)
1
(* N (factorial (- N 1)))))
Example:
 Here are some simple example using the if

operator:
 CL-USER(): (if (> 3 4)"yes“ "no")
ANS:
"no“
Applications of LISP:
 Mathematics
 Artificial intelligence and natural language

processing.
 Expert Systems (diagnosis, identification,
design )
Advantages of LISP:
 Common Lisp is :
 a general-purpose programming language and an AI

language

 Common Lisp programs are:
 easy to test
 easy to maintain (depending on programming
style)

 intractive
Cont…
 Provides clear syntax
 LISP expressions are case-insensitive.
 runtime typing:
the programmer need not bother about type
declarations

 several data types:
numbers, strings, arrays, lists, char, symbols etc.
Disadvantages of LISP
 The major disadvantage is due to the

lack of popularity and lack of
widespread support and knowledge.
 It is relatively hard to find Lisp
programmers.
What is PROLOG?
 PROLOG is a declarative language

where programs are expressed in
terms of relations.
 A program in PROLOG can use logical
reasoning to answer questions that
can be inferred from the knowledge
base.
Cont …
A Prolog language designed in Europe to
support natural language processing.
It was created by Alain and Robert 1972 as an
alternative to the Lisp programming languages.
Conti…
 There are three basic stratgies in Prolog:
facts, rules, and queries.
 A collection of facts and rules which
describe some collection of relationships is
called a knowledge base.
 That is, Prolog programs simply are
knowledge bases.
Conti…
Prolog includes an inference engine, which is
a process for reasoning logically about
information. The inference engine includes a
pattern matcher, which retrieves stored
(known) information by matching answers to
questions.
One important feature of Prolog is find all
possible solutions rather than only one.
Presentation1
Presentation1
Presentation1
Presentation1
Presentation1
Presentation1
PROLOG Example
mortal(X) :- man(X)

% Xismortal
if X is a man.
% Socrates is a man

man(socrates).
and then ask Prolog
?- mortal(socrates). % Is Socrates
mortal?
and it will immediately tell me yes
Applications of PROLOG
 Expert systems
 Relational queries
 Parsing of context free language
 Natural language processing

 Natural support of

pattern-matching
Advantages of PROLOG
 The language works well for tasks like

proving mathematical theorems
 It has built-in list handling, very useful for
representing sequences, trees, and so on.
 It is easy to read and write programs which
build structures.
Similarities:
 One of the similarities that makes these

languages unique is their ability to rewrite
themselves as the program is running.
 In Lisp, the program itself can be treated as
data that the program can manipulate.
 The both languages are object oriented
programming languages.
Differences:
 The main difference between the two languages
is the way problems are described.
 In Lisp, the programmer must describe how the
computer will solve the problem (chess game).
 In Prolog, the developer does not need to
describe how, but rules points the program

toward the desired results. (medical symptoms).
 Prolog is not a general-purpose theorem prover.
LISP is a general purpose theorem
 PROLOG has many functional languages other
than LISP.
LISP & PROLOG

PROGRAMMING LANGUAGE
Arithmetic Operations
Point of comparison

LISP

PROLOG

ADD

(+2 3)

2+3

SUBTRACT

(-5 2)

(5-2)

MULTIPLICATION

(* 3 2)

(2*3)

DIVISION

(/ 6 2)

(6/2)

BRACES

(+3 (* 3 2 ) 4)

(3+ (3 *2)
Logical operations
Point of comparison

LISP

PROLOG

SMALLER

(< 3 4 )
True

3<4
yes

GREATER

(> 3 4 )
NIL

3>4
No

Smaller than or equal (< = 3 2)
Nil

Greater than or equal ( > = 3 2)

3=<2
No

true

3>=2
Yes

Equal

( = 3 4)
Nil

3 =:= 4
no

Not Equal

( = 3 4 )
True

( 3 == 4)
Yes
PROLOG Example
 age(john,32).
 age(agnes,41).

 age(george,72).
 age(hiba,2).
 age(thomas,25).

QUERIES
age(hiba,2).
agnes(41).
Thanks

More Related Content

PPTX
Prolog & lisp
Ismail El Gayar
 
PDF
Learn a language : LISP
Devnology
 
PPTX
Scheme Programming Language
Reham AlBlehid
 
PPT
Logic Programming and Prolog
Sadegh Dorri N.
 
PPTX
A brief introduction to lisp language
David Gu
 
PDF
Numeric Data types in Python
jyostna bodapati
 
PDF
Data types in python
Learnbay Datascience
 
PDF
Data handling CBSE PYTHON CLASS 11
chinthala Vijaya Kumar
 
Prolog & lisp
Ismail El Gayar
 
Learn a language : LISP
Devnology
 
Scheme Programming Language
Reham AlBlehid
 
Logic Programming and Prolog
Sadegh Dorri N.
 
A brief introduction to lisp language
David Gu
 
Numeric Data types in Python
jyostna bodapati
 
Data types in python
Learnbay Datascience
 
Data handling CBSE PYTHON CLASS 11
chinthala Vijaya Kumar
 

What's hot (20)

PPTX
Presentation on python data type
swati kushwaha
 
PPTX
Python Data-Types
Akhil Kaushik
 
PPT
Advance LISP (Artificial Intelligence)
wahab khan
 
PPTX
Intro to python
Mohamed Essam
 
PPTX
Datastrucure
Mohamed Essam
 
PDF
Object reusability in python
Learnbay Datascience
 
PPTX
Chapter 10 data handling
Praveen M Jigajinni
 
PPTX
Ground Gurus - Python Code Camp - Day 3 - Classes
Chariza Pladin
 
PPTX
Regular Expressions
Akhil Kaushik
 
PDF
Bhushan Rathi
Bhushan Rathi
 
PDF
Labelled Variables in Logic Programming: A First Prototipe in tuProlog
Roberta Calegari
 
PPT
Compiler_Project_Srikanth_Vanama
Srikanth Vanama
 
PPTX
Clean code
Smita Prasad
 
PPTX
Data types in python lecture (2)
Ali ٍSattar
 
PDF
Aaa ped-3. Pythond: advanced concepts
AminaRepo
 
PPTX
Python 3 Programming Language
Tahani Al-Manie
 
PPTX
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
 
PPTX
Python libraries
Venkat Projects
 
PDF
record_linking
Robert Berry
 
PDF
Doppl development iteration #4
Diego Perini
 
Presentation on python data type
swati kushwaha
 
Python Data-Types
Akhil Kaushik
 
Advance LISP (Artificial Intelligence)
wahab khan
 
Intro to python
Mohamed Essam
 
Datastrucure
Mohamed Essam
 
Object reusability in python
Learnbay Datascience
 
Chapter 10 data handling
Praveen M Jigajinni
 
Ground Gurus - Python Code Camp - Day 3 - Classes
Chariza Pladin
 
Regular Expressions
Akhil Kaushik
 
Bhushan Rathi
Bhushan Rathi
 
Labelled Variables in Logic Programming: A First Prototipe in tuProlog
Roberta Calegari
 
Compiler_Project_Srikanth_Vanama
Srikanth Vanama
 
Clean code
Smita Prasad
 
Data types in python lecture (2)
Ali ٍSattar
 
Aaa ped-3. Pythond: advanced concepts
AminaRepo
 
Python 3 Programming Language
Tahani Al-Manie
 
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
 
Python libraries
Venkat Projects
 
record_linking
Robert Berry
 
Doppl development iteration #4
Diego Perini
 
Ad

Viewers also liked (20)

PPTX
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock
 
PPT
Introduction to XML
shannonsdavis
 
PPTX
What&rsquo;s new in Visual C++
Microsoft
 
PPTX
Making Information Usable: The Art & Science of Information Design
Hubbard One
 
PPS
Vb.net session 15
Niit Care
 
PDF
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Nikola Plejic
 
PPTX
Prolog -Cpt114 - Week3
a_akhavan
 
PDF
Part 1 picturebox using vb.net
Girija Muscut
 
PDF
Transforming the world with Information technology
Glenn Klith Andersen
 
ZIP
Logical Programming With ruby-prolog
Preston Lee
 
PPTX
Debugging in visual studio (basic level)
Larry Nung
 
PDF
How Not To Be Seen
Mark Pesce
 
PPTX
Cognitive information science
S. Kate Devitt
 
PPTX
Part 5 create sequence increment value using negative value
Girija Muscut
 
PDF
Part2 database connection service based using vb.net
Girija Muscut
 
PPTX
Part 8 add,update,delete records using records operation buttons in vb.net
Girija Muscut
 
PPTX
Information Overload and Information Science / Mieczysław Muraszkiewicz
Zakład Systemów Informacyjnych, Instytut Informacji Naukowej i Studiów Bibliologicznych (UW)
 
PDF
Part 3 binding navigator vb.net
Girija Muscut
 
PPTX
Science Information Literacy Tutorials and Pedagogy
Eleni Zazani
 
PDF
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock
 
Introduction to XML
shannonsdavis
 
What&rsquo;s new in Visual C++
Microsoft
 
Making Information Usable: The Art & Science of Information Design
Hubbard One
 
Vb.net session 15
Niit Care
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Nikola Plejic
 
Prolog -Cpt114 - Week3
a_akhavan
 
Part 1 picturebox using vb.net
Girija Muscut
 
Transforming the world with Information technology
Glenn Klith Andersen
 
Logical Programming With ruby-prolog
Preston Lee
 
Debugging in visual studio (basic level)
Larry Nung
 
How Not To Be Seen
Mark Pesce
 
Cognitive information science
S. Kate Devitt
 
Part 5 create sequence increment value using negative value
Girija Muscut
 
Part2 database connection service based using vb.net
Girija Muscut
 
Part 8 add,update,delete records using records operation buttons in vb.net
Girija Muscut
 
Information Overload and Information Science / Mieczysław Muraszkiewicz
Zakład Systemów Informacyjnych, Instytut Informacji Naukowej i Studiów Bibliologicznych (UW)
 
Part 3 binding navigator vb.net
Girija Muscut
 
Science Information Literacy Tutorials and Pedagogy
Eleni Zazani
 
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML
 
Ad

Similar to Presentation1 (20)

PDF
Programming Languages - Functional Programming Paper
Shreya Chakrabarti
 
PPTX
PARADIGM IT.pptx
jamesmarken1
 
PPTX
LISP: назад в будущее, Микола Мозговий
Sigma Software
 
PDF
CPPDS Slide.pdf
Fadlie Ahdon
 
PPTX
Programming paradigms Techniques_part2.pptx
ssuser5ecd1a
 
PPTX
Lecture 2 lisp-Overview
Student at University Of Malakand, Pakistan
 
PPTX
Prolog (present)
Melody Joey
 
PPT
Declarative programming language
Vinisha Pathak
 
PPTX
LISP: Introduction to lisp
DataminingTools Inc
 
PPTX
LISP: Introduction To Lisp
LISP Content
 
PPTX
Learning and Modern Programming Languages
Ray Toal
 
PDF
Programing paradigm &amp; implementation
Bilal Maqbool ツ
 
PPTX
Python programming
noor_faiza
 
PDF
3.5
Samimvez
 
PPTX
Unit 3 Prolog.pptxUnit 3 Prolog.pptxUnit 3 Prolog.pptxUnit 3 Prolog.pptxUnit
ManishYadav243888
 
DOCX
OBJECT ORIENTED PROGRAMMING.docx
AleKi2
 
PPTX
Prolog Programming Language
Reham AlBlehid
 
PPTX
Let's LISP like it's 1959
Mohamed Essam
 
PDF
On being a professional software developer
Anton Kirillov
 
DOCX
JAVA
sonali_iul
 
Programming Languages - Functional Programming Paper
Shreya Chakrabarti
 
PARADIGM IT.pptx
jamesmarken1
 
LISP: назад в будущее, Микола Мозговий
Sigma Software
 
CPPDS Slide.pdf
Fadlie Ahdon
 
Programming paradigms Techniques_part2.pptx
ssuser5ecd1a
 
Prolog (present)
Melody Joey
 
Declarative programming language
Vinisha Pathak
 
LISP: Introduction to lisp
DataminingTools Inc
 
LISP: Introduction To Lisp
LISP Content
 
Learning and Modern Programming Languages
Ray Toal
 
Programing paradigm &amp; implementation
Bilal Maqbool ツ
 
Python programming
noor_faiza
 
Unit 3 Prolog.pptxUnit 3 Prolog.pptxUnit 3 Prolog.pptxUnit 3 Prolog.pptxUnit
ManishYadav243888
 
OBJECT ORIENTED PROGRAMMING.docx
AleKi2
 
Prolog Programming Language
Reham AlBlehid
 
Let's LISP like it's 1959
Mohamed Essam
 
On being a professional software developer
Anton Kirillov
 

Recently uploaded (20)

PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
PPTX
CDH. pptx
AneetaSharma15
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
CDH. pptx
AneetaSharma15
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 

Presentation1

  • 2. Topic: Languages Of AI (lisp/prolog) Group Members: Shagufta Arif (027) Sania Alyas (020) Maryam Afza (006)
  • 3. What is LISP?? LISP stands for (LIST PROCESSING). It was invented by John McCarthy in 1958. As its name implies, LISP is a programming language that manipulates LISTS.
  • 4. LISP Discription: A list is either empty or non-empty. [a, b, c, d] Empty: [] Non-empty: head=[a] tail=[b, c, d]
  • 5. Example:  We can implement a function to compute factorials using recursion:  (defun factorial (N) "Compute the factorial of N." (if (= N 1) 1 (* N (factorial (- N 1)))))
  • 6. Example:  Here are some simple example using the if operator:  CL-USER(): (if (> 3 4)"yes“ "no") ANS: "no“
  • 7. Applications of LISP:  Mathematics  Artificial intelligence and natural language processing.  Expert Systems (diagnosis, identification, design )
  • 8. Advantages of LISP:  Common Lisp is :  a general-purpose programming language and an AI language  Common Lisp programs are:  easy to test  easy to maintain (depending on programming style)  intractive
  • 9. Cont…  Provides clear syntax  LISP expressions are case-insensitive.  runtime typing: the programmer need not bother about type declarations  several data types: numbers, strings, arrays, lists, char, symbols etc.
  • 10. Disadvantages of LISP  The major disadvantage is due to the lack of popularity and lack of widespread support and knowledge.  It is relatively hard to find Lisp programmers.
  • 11. What is PROLOG?  PROLOG is a declarative language where programs are expressed in terms of relations.  A program in PROLOG can use logical reasoning to answer questions that can be inferred from the knowledge base.
  • 12. Cont … A Prolog language designed in Europe to support natural language processing. It was created by Alain and Robert 1972 as an alternative to the Lisp programming languages.
  • 13. Conti…  There are three basic stratgies in Prolog: facts, rules, and queries.  A collection of facts and rules which describe some collection of relationships is called a knowledge base.  That is, Prolog programs simply are knowledge bases.
  • 14. Conti… Prolog includes an inference engine, which is a process for reasoning logically about information. The inference engine includes a pattern matcher, which retrieves stored (known) information by matching answers to questions. One important feature of Prolog is find all possible solutions rather than only one.
  • 21. PROLOG Example mortal(X) :- man(X) % Xismortal if X is a man. % Socrates is a man man(socrates). and then ask Prolog ?- mortal(socrates). % Is Socrates mortal? and it will immediately tell me yes
  • 22. Applications of PROLOG  Expert systems  Relational queries  Parsing of context free language  Natural language processing  Natural support of pattern-matching
  • 23. Advantages of PROLOG  The language works well for tasks like proving mathematical theorems  It has built-in list handling, very useful for representing sequences, trees, and so on.  It is easy to read and write programs which build structures.
  • 24. Similarities:  One of the similarities that makes these languages unique is their ability to rewrite themselves as the program is running.  In Lisp, the program itself can be treated as data that the program can manipulate.  The both languages are object oriented programming languages.
  • 25. Differences:  The main difference between the two languages is the way problems are described.  In Lisp, the programmer must describe how the computer will solve the problem (chess game).  In Prolog, the developer does not need to describe how, but rules points the program toward the desired results. (medical symptoms).  Prolog is not a general-purpose theorem prover. LISP is a general purpose theorem  PROLOG has many functional languages other than LISP.
  • 27. Arithmetic Operations Point of comparison LISP PROLOG ADD (+2 3) 2+3 SUBTRACT (-5 2) (5-2) MULTIPLICATION (* 3 2) (2*3) DIVISION (/ 6 2) (6/2) BRACES (+3 (* 3 2 ) 4) (3+ (3 *2)
  • 28. Logical operations Point of comparison LISP PROLOG SMALLER (< 3 4 ) True 3<4 yes GREATER (> 3 4 ) NIL 3>4 No Smaller than or equal (< = 3 2) Nil Greater than or equal ( > = 3 2) 3=<2 No true 3>=2 Yes Equal ( = 3 4) Nil 3 =:= 4 no Not Equal ( = 3 4 ) True ( 3 == 4) Yes
  • 29. PROLOG Example  age(john,32).  age(agnes,41).  age(george,72).  age(hiba,2).  age(thomas,25). QUERIES age(hiba,2). agnes(41).