SlideShare a Scribd company logo
1 of 24
LISP and PROLOG AI
Programming Language
          Submitted To:
       Dr. Hesham El-Zoka

          Submitted By:
   Eng. Ismail Fathalla El-Gayar
AI Programming
   Languages
Language         Year                                    Features
  IPL        Information          support programs that could perform general problem
              Processing               solving, including lists, associations, schemas
              Language                  (frames), dynamic memory allocation, data
                                types, recursion,, functions as arguments, and cooperative
                                                        multitasking
  LISP     LISt Processing        practical mathematical notation for computer programs
                                   based on lambda calculus. Linked lists are one of Lisp
                                             languages' major data structures
PLANNER       MIT 1969         is a hybrid between procedural and logical languages. It gives
                                   a procedural interpretation to logical sentences where
                                implications are interpreted with pattern-directed inference.
PROLOG     programmatio        declarative language where programs are expressed in terms
            n en logique        of relations, and execution occurs by running queries over
               1970s             these relations. Prolog is particularly useful for symbolic
                                 reasoning, database and language parsing applications.
 STRIPS    Stanford Research      language for expressing automated planning problem
           Institute Problem                            instances
              Solver1971
System Usability

P R O L O G has many
denotation, functional
      languages
    other than Lisp
Why Prolog here?
       System Usability
• It is a particularly interesting language
        - the “feeling” is completely different from
               Java,C,...
        - forces to see programming in a different
          way
        - programming as writing a “logic theory”
• Recently, renewed interest in Prolog in order to
rapidly prototype:
        – complex algorithms, reasoning-like
        computations, dynamic structures, XML-like
               features
        – governing interaction inside system
               infrastructures
System Usability
Why Prolog here?
Conceptual reasons:
• new programming idiom
      – programming is NOT writing in Java language
• Prolog as an “engine” to study models and language
Practical reasons:
• integration between Prolog and Java
      – Java as the part handling more “in-the-large”
      aspects network, graphics, connection with the O.S.
      and libraries
      – Prolog as the engine to handle (complex)
      algorithms optimization algorithms, reasoning, core
      logic, data structures
System Usability
Comparing Java / Prolog
• Java (C,C++) forces a procedural and deterministic view
over computation
• Prolog allows for a more declarative way of programming
       – expressing the problem, not the solution!
       – it works very well when finding solutions is
       “exploring a tree”.
• Other applications
       – dealing with knowledge representation and
       knowledge inference, typical use in AI
System Usability


   LISP & PROLOG
Programming Language
ATOM & LIST
• Atom: One Component Out Of List
     ex: x , y , k
• LIST: Brackets Containing Atom
     ex: ( 2 3 x )
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) + 4 )
Logic Operations
   Point Of
 Comparison       LISP       PROLOG
    Smaller       (< 3 4)      3<4
                   True        Yes

    Greater       (> 2 5)      2>5
                    Nil        no
Smaller than or   (<= 3 2)    3 =<2
    equal           Nil        no

Greater than or   (>= 6 2)     6=>2
    equal           True        Yes

     Equal        (= 3 4)     3 =:= 4
                    Nil         no

   Not Equal      (= 3 4)    3==4
                    True       yes
Functions


  Point Of
Comparison         LISP                PROLOG
   Max       ( max 1 2 4 6 53 0 )   max([1,2,4,6,53,0],X).
                      53                    X=53
   Min       ( min 1 2 4 6 53 0 )   min([1,2,46,53,0],X).
                       0                    X=0
   Sum           plus(A, B, C)           sum(X,Y,Z)
                  C is A + B.


   the both languages are Object
       Oriented Programming
             Languages
List Processing Language
• Since We Said that Lisp Is A List
  Processing Language we will talk
  about how we deals with List:-
   -(list '1 '2 'foo)  ( 1 2 Foo )
   - list 1 2 (list 3 4)) => ( 1 2 (3 4))
   - ( + 1 2 3 4)  10
   - (if nil (list 1 2 "foo") (list 3 4"bar"))
    if (var)=nill Do (1 2 Foo)
                       else (3 4 bar)
List Processing Language
• Lambda(to assign A variable)
  (lambda (arg) (+ arg 1)) =>arg=arg+1
  ((lambda (arg) (+ arg 1)) 5) =>arg =6
Lists In PROLOG
• Example :
     [mia, vincent, jules, yolanda]
• Dealing With List:
[Head| Tail] = [mia, vincent, jules, yolanda]
  means:-
     Head = mia
     Tail = [vincent,jules,yolanda]
     yes
Example: Concatenation

In an imperative language
                            list procedure cat(list a, list b)
                                                {
                                 list t = list u = copylist(a);
                                while (t.tail != nil) t = t.tail;
                                            t.tail = b;
                                             return u;
                                                }

 In a functional language
                                       cat(a,b)
                                    if b = nil then a
                                          else
                              cons(head(a), cat(tail(a),b))

  In a declarative language
                                   cat([], Z, Z).
                        cat([H|T], L, [H|Z]) :- cat(T, L, Z).
Example in PROLOG ( Fact&Rule)


                   Predicate


          Procedure for
            elephant
                                          Facts


               elephant(george).
Clauses        elephant(mary).
               elephant(X) :- grey(X), mammal(X), hasTrunk(X).
  Rule
Example in PROLOG ( Fact&Rule)



                 ?- elephant(george).
Queries
                         yes

                  ?- elephant(jane).
Replies
                         no
Execution of Prolog Programs
•Prove that goal is satisfiable

•Search of facts/rules is top-down

•Execution of sub-goals is left to right

•Closed-world assumption:
     – anything not in database is false

•Integer calculation, I/O don’t fit well into logical
proof search
Applications of Prolog:-

•Expert systems

•Relational database queries

•Parsing of context-free languages

•Natural language processing

•Teaching programming
        , as early as in grade school
LISP Compiler   PROLOG Compiler
•BEE            •B-Prolog
•POPLOG         •GNU Prolog
•LISP WORKS     •C# PROLOG
•GNU C LISP     •Open Prolog
                •Strawberry Prolog
References
•Paul Brna ,Prolog Programming A First Course.

•Fernando C. N. Pereira , Stuart M. Shieber ,Prolog and Natural
Language Analysis.

• Ulf Nilsson , Jan Maluszynski ,Logic Programming and Prolog 2nd
edition.

• Amzi ,Adventure in Prolog.

•- Patrick Blackburn, Johan Bos , Kristina Striegnitz , Learn Prolog Now!

•http://en.wikibooks.org/wiki/Prolog/Math,_Functions_and_Equality

•http://en.wikipedia.org/wiki/Prolog

•http://en.wikipedia.org/wiki/Lisp_(programming_language)
Prolog & lisp

More Related Content

What's hot

Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityBhavin Darji
 
Learning sets of rules, Sequential Learning Algorithm,FOIL
Learning sets of rules, Sequential Learning Algorithm,FOILLearning sets of rules, Sequential Learning Algorithm,FOIL
Learning sets of rules, Sequential Learning Algorithm,FOILPavithra Thippanaik
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and LiftingMegha Sharma
 
Inductive analytical approaches to learning
Inductive analytical approaches to learningInductive analytical approaches to learning
Inductive analytical approaches to learningswapnac12
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningPaxcel Technologies
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search techniqueKapil Dahal
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
HML: Historical View and Trends of Deep Learning
HML: Historical View and Trends of Deep LearningHML: Historical View and Trends of Deep Learning
HML: Historical View and Trends of Deep LearningYan Xu
 

What's hot (20)

Uncertainty in AI
Uncertainty in AIUncertainty in AI
Uncertainty in AI
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Learning sets of rules, Sequential Learning Algorithm,FOIL
Learning sets of rules, Sequential Learning Algorithm,FOILLearning sets of rules, Sequential Learning Algorithm,FOIL
Learning sets of rules, Sequential Learning Algorithm,FOIL
 
Frames
FramesFrames
Frames
 
Prolog basics
Prolog basicsProlog basics
Prolog basics
 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
First order logic
First order logicFirst order logic
First order logic
 
Inductive analytical approaches to learning
Inductive analytical approaches to learningInductive analytical approaches to learning
Inductive analytical approaches to learning
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Binary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine LearningBinary Class and Multi Class Strategies for Machine Learning
Binary Class and Multi Class Strategies for Machine Learning
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
 
Ontology engineering
Ontology engineering Ontology engineering
Ontology engineering
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
HML: Historical View and Trends of Deep Learning
HML: Historical View and Trends of Deep LearningHML: Historical View and Trends of Deep Learning
HML: Historical View and Trends of Deep Learning
 

Viewers also liked

Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : BasicsMitul Desai
 
Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog LanguageREHMAT ULLAH
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lispkyleburton
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp languageDavid Gu
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicVishal Tandel
 
LISP Programming Language (Artificial Intelligence)
LISP Programming Language (Artificial Intelligence)LISP Programming Language (Artificial Intelligence)
LISP Programming Language (Artificial Intelligence)wahab khan
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming LangugeYaser Jaradeh
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lispfukamachi
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligencelordmwesh
 
Expert Systems & Prolog
Expert Systems & PrologExpert Systems & Prolog
Expert Systems & PrologFatih Karatana
 
Expert Systems
Expert SystemsExpert Systems
Expert Systemsosmancikk
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceNeil Mathew
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligenceu053675
 
AI & gaming: letters from the land of lisp.
AI & gaming: letters from the land of lisp. AI & gaming: letters from the land of lisp.
AI & gaming: letters from the land of lisp. CS, NcState
 

Viewers also liked (20)

Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
Prolog Programming : Basics
Prolog Programming : BasicsProlog Programming : Basics
Prolog Programming : Basics
 
Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog Language
 
Lisp
LispLisp
Lisp
 
Introduction To Lisp
Introduction To LispIntroduction To Lisp
Introduction To Lisp
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
A brief introduction to lisp language
A brief introduction to lisp languageA brief introduction to lisp language
A brief introduction to lisp language
 
PROLOG: Introduction To Prolog
PROLOG: Introduction To PrologPROLOG: Introduction To Prolog
PROLOG: Introduction To Prolog
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
 
LISP Programming Language (Artificial Intelligence)
LISP Programming Language (Artificial Intelligence)LISP Programming Language (Artificial Intelligence)
LISP Programming Language (Artificial Intelligence)
 
Lisp Programming Languge
Lisp Programming LangugeLisp Programming Languge
Lisp Programming Languge
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lisp
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
Expert Systems & Prolog
Expert Systems & PrologExpert Systems & Prolog
Expert Systems & Prolog
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
AI & gaming: letters from the land of lisp.
AI & gaming: letters from the land of lisp. AI & gaming: letters from the land of lisp.
AI & gaming: letters from the land of lisp.
 

Similar to Prolog & lisp

Programming Languages - Functional Programming Paper
Programming Languages - Functional Programming PaperProgramming Languages - Functional Programming Paper
Programming Languages - Functional Programming PaperShreya Chakrabarti
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To LispLISP Content
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologiesPolad Saruxanov
 
Using Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUUsing Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUSkills Matter
 
Introduction to Functional Languages
Introduction to Functional LanguagesIntroduction to Functional Languages
Introduction to Functional Languagessuthi
 
Learning and Modern Programming Languages
Learning and Modern Programming LanguagesLearning and Modern Programming Languages
Learning and Modern Programming LanguagesRay Toal
 
python programming for beginners and advanced
python programming for beginners and advancedpython programming for beginners and advanced
python programming for beginners and advancedgranjith6
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming LanguageReham AlBlehid
 
Presentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingPresentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingFilip De Sutter
 
Introduction to r bddsil meetup
Introduction to r bddsil meetupIntroduction to r bddsil meetup
Introduction to r bddsil meetupNimrod Priell
 
Go Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional ProgrammingGo Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional ProgrammingLex Sheehan
 
app4.pptx
app4.pptxapp4.pptx
app4.pptxsg4795
 

Similar to Prolog & lisp (20)

Presentation1
Presentation1Presentation1
Presentation1
 
Programming Languages - Functional Programming Paper
Programming Languages - Functional Programming PaperProgramming Languages - Functional Programming Paper
Programming Languages - Functional Programming Paper
 
CPPDS Slide.pdf
CPPDS Slide.pdfCPPDS Slide.pdf
CPPDS Slide.pdf
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
 
Prolog 7-Languages
Prolog 7-LanguagesProlog 7-Languages
Prolog 7-Languages
 
Using Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPUUsing Language Oriented Programming to Execute Computations on the GPU
Using Language Oriented Programming to Execute Computations on the GPU
 
Introduction to Functional Languages
Introduction to Functional LanguagesIntroduction to Functional Languages
Introduction to Functional Languages
 
Learning and Modern Programming Languages
Learning and Modern Programming LanguagesLearning and Modern Programming Languages
Learning and Modern Programming Languages
 
python programming for beginners and advanced
python programming for beginners and advancedpython programming for beginners and advanced
python programming for beginners and advanced
 
Prolog Programming Language
Prolog Programming  LanguageProlog Programming  Language
Prolog Programming Language
 
PARADIGM IT.pptx
PARADIGM IT.pptxPARADIGM IT.pptx
PARADIGM IT.pptx
 
Presentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional ProgrammingPresentation of GetTogether on Functional Programming
Presentation of GetTogether on Functional Programming
 
Logic Programming and ILP
Logic Programming and ILPLogic Programming and ILP
Logic Programming and ILP
 
Introduction to r bddsil meetup
Introduction to r bddsil meetupIntroduction to r bddsil meetup
Introduction to r bddsil meetup
 
Go Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional ProgrammingGo Beyond Higher Order Functions: A Journey into Functional Programming
Go Beyond Higher Order Functions: A Journey into Functional Programming
 
R language
R languageR language
R language
 
3.5
3.53.5
3.5
 
app4.pptx
app4.pptxapp4.pptx
app4.pptx
 

More from Ismail El Gayar

Why computer engineering
Why computer engineeringWhy computer engineering
Why computer engineeringIsmail El Gayar
 
Geographic Information System for Egyptian Railway System(GIS)
Geographic Information System for Egyptian Railway System(GIS)Geographic Information System for Egyptian Railway System(GIS)
Geographic Information System for Egyptian Railway System(GIS)Ismail El Gayar
 
System science documentation
System science documentationSystem science documentation
System science documentationIsmail El Gayar
 
Parallel architecture &programming
Parallel architecture &programmingParallel architecture &programming
Parallel architecture &programmingIsmail El Gayar
 
Object oriented methodology & unified modeling language
Object oriented methodology & unified modeling languageObject oriented methodology & unified modeling language
Object oriented methodology & unified modeling languageIsmail El Gayar
 

More from Ismail El Gayar (7)

Neural Networks
Neural NetworksNeural Networks
Neural Networks
 
Why computer engineering
Why computer engineeringWhy computer engineering
Why computer engineering
 
What is ETL?
What is ETL?What is ETL?
What is ETL?
 
Geographic Information System for Egyptian Railway System(GIS)
Geographic Information System for Egyptian Railway System(GIS)Geographic Information System for Egyptian Railway System(GIS)
Geographic Information System for Egyptian Railway System(GIS)
 
System science documentation
System science documentationSystem science documentation
System science documentation
 
Parallel architecture &programming
Parallel architecture &programmingParallel architecture &programming
Parallel architecture &programming
 
Object oriented methodology & unified modeling language
Object oriented methodology & unified modeling languageObject oriented methodology & unified modeling language
Object oriented methodology & unified modeling language
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Prolog & lisp

  • 1. LISP and PROLOG AI Programming Language Submitted To: Dr. Hesham El-Zoka Submitted By: Eng. Ismail Fathalla El-Gayar
  • 2. AI Programming Languages
  • 3. Language Year Features IPL Information support programs that could perform general problem Processing solving, including lists, associations, schemas Language (frames), dynamic memory allocation, data types, recursion,, functions as arguments, and cooperative multitasking LISP LISt Processing practical mathematical notation for computer programs based on lambda calculus. Linked lists are one of Lisp languages' major data structures PLANNER MIT 1969 is a hybrid between procedural and logical languages. It gives a procedural interpretation to logical sentences where implications are interpreted with pattern-directed inference. PROLOG programmatio declarative language where programs are expressed in terms n en logique of relations, and execution occurs by running queries over 1970s these relations. Prolog is particularly useful for symbolic reasoning, database and language parsing applications. STRIPS Stanford Research language for expressing automated planning problem Institute Problem instances Solver1971
  • 4.
  • 5. System Usability P R O L O G has many denotation, functional languages other than Lisp
  • 6. Why Prolog here? System Usability • It is a particularly interesting language - the “feeling” is completely different from Java,C,... - forces to see programming in a different way - programming as writing a “logic theory” • Recently, renewed interest in Prolog in order to rapidly prototype: – complex algorithms, reasoning-like computations, dynamic structures, XML-like features – governing interaction inside system infrastructures
  • 7. System Usability Why Prolog here? Conceptual reasons: • new programming idiom – programming is NOT writing in Java language • Prolog as an “engine” to study models and language Practical reasons: • integration between Prolog and Java – Java as the part handling more “in-the-large” aspects network, graphics, connection with the O.S. and libraries – Prolog as the engine to handle (complex) algorithms optimization algorithms, reasoning, core logic, data structures
  • 8. System Usability Comparing Java / Prolog • Java (C,C++) forces a procedural and deterministic view over computation • Prolog allows for a more declarative way of programming – expressing the problem, not the solution! – it works very well when finding solutions is “exploring a tree”. • Other applications – dealing with knowledge representation and knowledge inference, typical use in AI
  • 9. System Usability LISP & PROLOG Programming Language
  • 10. ATOM & LIST • Atom: One Component Out Of List ex: x , y , k • LIST: Brackets Containing Atom ex: ( 2 3 x )
  • 11. 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) + 4 )
  • 12. Logic Operations Point Of Comparison LISP PROLOG Smaller (< 3 4) 3<4 True Yes Greater (> 2 5) 2>5 Nil no Smaller than or (<= 3 2) 3 =<2 equal Nil no Greater than or (>= 6 2) 6=>2 equal True Yes Equal (= 3 4) 3 =:= 4 Nil no Not Equal (= 3 4) 3==4 True yes
  • 13. Functions Point Of Comparison LISP PROLOG Max ( max 1 2 4 6 53 0 ) max([1,2,4,6,53,0],X). 53 X=53 Min ( min 1 2 4 6 53 0 ) min([1,2,46,53,0],X). 0 X=0 Sum plus(A, B, C) sum(X,Y,Z) C is A + B. the both languages are Object Oriented Programming Languages
  • 14. List Processing Language • Since We Said that Lisp Is A List Processing Language we will talk about how we deals with List:- -(list '1 '2 'foo)  ( 1 2 Foo ) - list 1 2 (list 3 4)) => ( 1 2 (3 4)) - ( + 1 2 3 4)  10 - (if nil (list 1 2 "foo") (list 3 4"bar"))  if (var)=nill Do (1 2 Foo) else (3 4 bar)
  • 15. List Processing Language • Lambda(to assign A variable) (lambda (arg) (+ arg 1)) =>arg=arg+1 ((lambda (arg) (+ arg 1)) 5) =>arg =6
  • 16. Lists In PROLOG • Example : [mia, vincent, jules, yolanda] • Dealing With List: [Head| Tail] = [mia, vincent, jules, yolanda] means:- Head = mia Tail = [vincent,jules,yolanda] yes
  • 17. Example: Concatenation In an imperative language list procedure cat(list a, list b) { list t = list u = copylist(a); while (t.tail != nil) t = t.tail; t.tail = b; return u; } In a functional language cat(a,b) if b = nil then a else cons(head(a), cat(tail(a),b)) In a declarative language cat([], Z, Z). cat([H|T], L, [H|Z]) :- cat(T, L, Z).
  • 18. Example in PROLOG ( Fact&Rule) Predicate Procedure for elephant Facts elephant(george). Clauses elephant(mary). elephant(X) :- grey(X), mammal(X), hasTrunk(X). Rule
  • 19. Example in PROLOG ( Fact&Rule) ?- elephant(george). Queries yes ?- elephant(jane). Replies no
  • 20. Execution of Prolog Programs •Prove that goal is satisfiable •Search of facts/rules is top-down •Execution of sub-goals is left to right •Closed-world assumption: – anything not in database is false •Integer calculation, I/O don’t fit well into logical proof search
  • 21. Applications of Prolog:- •Expert systems •Relational database queries •Parsing of context-free languages •Natural language processing •Teaching programming , as early as in grade school
  • 22. LISP Compiler PROLOG Compiler •BEE •B-Prolog •POPLOG •GNU Prolog •LISP WORKS •C# PROLOG •GNU C LISP •Open Prolog •Strawberry Prolog
  • 23. References •Paul Brna ,Prolog Programming A First Course. •Fernando C. N. Pereira , Stuart M. Shieber ,Prolog and Natural Language Analysis. • Ulf Nilsson , Jan Maluszynski ,Logic Programming and Prolog 2nd edition. • Amzi ,Adventure in Prolog. •- Patrick Blackburn, Johan Bos , Kristina Striegnitz , Learn Prolog Now! •http://en.wikibooks.org/wiki/Prolog/Math,_Functions_and_Equality •http://en.wikipedia.org/wiki/Prolog •http://en.wikipedia.org/wiki/Lisp_(programming_language)