Graphs in PROLOG Adam Volk PROLOG Introduction Programmer tells - - PowerPoint PPT Presentation

graphs in prolog
SMART_READER_LITE
LIVE PREVIEW

Graphs in PROLOG Adam Volk PROLOG Introduction Programmer tells - - PowerPoint PPT Presentation

Graphs in PROLOG Adam Volk PROLOG Introduction Programmer tells the system what to find, not how to find it 2 parts to using PROLOG Declaration of facts and rules Asking questions dependent on those facts and rules Pattern


slide-1
SLIDE 1

Graphs in PROLOG

Adam Volk

slide-2
SLIDE 2

PROLOG Introduction

  • Programmer tells the system what to find, not how to find it
  • 2 parts to using PROLOG
  • Declaration of facts and rules
  • Asking questions dependent on those facts and rules
  • Pattern matching key!
  • Example
slide-3
SLIDE 3

Problem Considered

  • PROLOG implementation of graphs
  • G = (Vertices, Edges)
  • G = ( {x,y,z} , {(x,y), (y,z), (x,z)} )
  • graph( [ [x,y,z], [ [x,y],[y,z],[x,z] ] ] ).
slide-4
SLIDE 4

Methods Studied

  • graph(G)
  • vertex(G,V)
  • edge(G,E)
  • complete(G)
  • has_cycle(G,V)
  • chain(G,Start,End,Chain)
  • tree (G)
  • outdegree(G,V)

Complete graph K5

slide-5
SLIDE 5

Methods Studied

  • graph(G)
  • vertex(G,V)
  • edge(G,E)
  • complete(G)
  • has_cycle(G,V)
  • chain(G,Start,End,Chain)
  • tree (G)
  • outdegree(G,V)

Complete graph K5

slide-6
SLIDE 6

Demo

slide-7
SLIDE 7

Thank you

slide-8
SLIDE 8

References

  • Bratko, I., Programming in Prolog for Artificial Intelligence, 4th Edition.

Addison-Wesley, 2011, chapters 1-5.

  • Matuszek, D., A Concise Introduction to Prolog.
  • Pereira, F., A Brief Introduction to Prolog. ACM Digital Library.