1 / 24

LISP and PROLOG AI Programming Language

LISP and PROLOG AI Programming Language. Submitted To: Dr . Hesham El- Zoka. Submitted By: Eng. Ismail Fathalla El- Gayar. AI Programming Languages. AI Programming Languages. AI applications are also often written in standard languages like C++ and MATLAB.

glenda
Download Presentation

LISP and PROLOG AI Programming Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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. AI Programming Languages

  4. AI applications are also often written in standard languages like C++ and MATLAB. So Why We Learn Logic Programming Languages???

  5. System Usability PROLOG has many denotation, functional languages other than Lisp

  6. System Usability Why Prolog here? • 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

  12. Logic Operations

  13. Functions 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). elephant(mary). elephant(X) :- grey(X), mammal(X), hasTrunk(X). Clauses Rule

  19. Example in PROLOG ( Fact&Rule) ?- elephant(george). yes ?- elephant(jane). no Queries Replies

  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 • BEE • POPLOG • LISP WORKS • GNU C LISP • PROLOG Compiler • B-Prolog • GNU Prolog • C# PROLOG • 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)

  24. Thanks For Attendance

More Related