graphs in prolog
play

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


  1. Graphs in PROLOG Adam Volk

  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

  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] ] ] ).

  4. Methods Studied • chain(G,Start,End,Chain) • graph(G) • tree (G) • vertex(G,V) • outdegree(G,V) • edge(G,E) • complete(G) • has_cycle(G,V) Complete graph K5

  5. Methods Studied • chain(G,Start,End,Chain) • graph(G) • tree (G) • vertex(G,V) • outdegree(G,V) • edge(G,E) • complete(G) • has_cycle(G,V) Complete graph K5

  6. Demo

  7. Thank you

  8. References • Bratko, I., Programming in Prolog for Artificial Intelligence, 4 th Edition. Addison-Wesley, 2011, chapters 1-5. • Matuszek, D., A Concise Introduction to Prolog . • Pereira, F., A Brief Introduction to Prolog . ACM Digital Library.

Recommend


More recommend