Prolog - PowerPoint PPT Presentation

About This Presentation
Title:

Prolog

Description:

Prolog CSE 473 Autumn 2003 Today First-order logic resolution proofs Answer extraction Resolution strategies Prolog The 5th Generation Project FOL Resolution ... – PowerPoint PPT presentation

Number of Views:199
Avg rating:3.0/5.0
Slides: 13
Provided by: CSE128
Category:
Tags: lectures | prolog

less

Transcript and Presenter's Notes

Title: Prolog


1
Prolog
  • CSE 473 Autumn 2003

2
Today
  1. First-order logic resolution proofs
  2. Answer extraction
  3. Resolution strategies
  4. Prolog
  5. The 5th Generation Project

3
FOL Resolution Proofs
  • People who love happy people are happy.
  • Rich people are happy.
  • People love their spouse.
  • Mothers love their children.
  • Prove Bill Gates mother-in-law is happy.
  • happy(x), rich(x), loves(x,y)spouse(Melinda,Bill
    )mother(MIL,Melinda)mother(Mary,Bill)

4
Answer Extraction
  • Who is happy?
  • Who loves Bill Gates?
  • Who loves who?

5
Prolog Interpreter
  • binding_list disprove(literal neglit)
  • choose (clause c) such that (binding
    unify(head(c),neglit))
  • if (no choice possible)
  • backtrack to last choice
  • for (each lit in body(c))
  • binding binding U disprove(substitute(li
    t,binding))
  • return binding

6
Properties of Prolog Interpreter
  • Tree-shaped proofs
  • Efficient use of memory (just stack)
  • Builds tree depth-first may enter infinite loop
    even on finite domains!
  • Free implementation SWI Prolog
  • http//www.swi-prolog.org/

7
happy.pl
  • happy(X) - rich(X).
  • happy(X) - loves(X,Y),happy(Y).
  • loves(X,Y) - spouse(X,Y).
  • loves(X,Y) - mother(X,Y).
  • rich(bill).
  • spouse(melinda,bill).
  • mother(mil,melinda).
  • mother(mary,bill).
  • rich(paul).
  • mother(barbara,henry).

8
toohappy.pl
  • happy(X) - rich(X).
  • happy(X) - loves(X,Y),happy(Y).
  • loves(X,Y) - spouse(X,Y).
  • loves(X,Y) - mother(X,Y).
  • rich(bill).
  • spouse(melinda,bill).
  • mother(mil,melinda).
  • mother(mary,bill).
  • rich(paul).
  • mother(barbara,henry).
  • loves(bill,melinda).
  • loves(henry,barbara).

9
hanoi.pl
  • move(1,X,Y,_) -
  • write('Move top disk from '),
  • write(X),
  • write(' to '),
  • write(Y),
  • nl.
  • move(N,X,Y,Z) -
  • Ngt1,
  • M is N-1,
  • move(M,X,Z,Y),
  • move(1,X,Y,_),
  • move(M,Z,Y,X).

10
nlp.pl
  • Try s(a,man,loves,a,woman,).
  • s(S0,S) - np(S0,S1), vp(S1,S).
  • np(S0,S) - det(S0,S1), n(S1,S).
  • vp(S0,S) - tv(S0,S1), np(S1,S).
  • vp(S0,S) - v(S0,S).
  • det(S0,S) - S0theS.
  • det(S0,S) - S0aS.
  • det(S0,S) - S0everyS.
  • n(S0,S) - S0manS.
  • n(S0,S) - S0womanS.
  • n(S0,S) - S0parkS.
  • tv(S0,S) - S0lovesS.
  • tv(S0,S) - S0likesS.
  • v(S0,S) - S0walksS.

11
Japanese 5th Generation Project
  • 1982 1992 400M effort by Japanese
    corporate/government partnership to leapfrog the
    world in creating an epoch-making computer
  • Approach hardware for parallel Prolog
  • In the end, few results
  • General purpose hardware evolved more rapidly
  • Most significant software RD in Europe

12
Prolog Today
  • Natural language processing
  • Datalog database query and integrity
    constraints
  • Function-free definite clauses bottom-up
    resolution strategy
  • Expert systems diagnosis, classification,
  • http//www.amzi.com/AdventureInProlog/
Write a Comment
User Comments (0)
About PowerShow.com