Logic basics

Prolog programs consist of clauses.
They are of three types: facts, rules, querries.

Facts



    vertebrate(giraffe).
    vertebrate(trout).
    vertebrate(human).

    swim(trout).


        

Rules


    fish(X):-vertebrate(X),swim(X).
        

List & term basics

How are lists constructed in prolog? What are terms?

Arithmetic

Try to scroll this section and look at the navigation list while scrolling!

Graphs

How are graphs represented in Prolog, BFS,DFS,shortest weighte, Depth search

BFS

DFS

Dijkstra

Minimum spanning tree

Arithmetic

Here I explain how arithmetic in prolog works and give few examples.

Lloyd 15

Try to scroll this section and look at the navigation list while scrolling!

Sudoku

What is sudoku and how can it be solved by using prolog.

8 queens

What is 8 queens problem and how can it be solved with prolog.

Binary tree

N-ary tree

Red-black tree

AVL tree