I have been trying to implement an algorithm for the semi naive evaluation of a datalog program but couldn't get a straight answer anywhere that explains the difference in simple words.

According to my understanding naive is a bottom-up evaluation technique so it is semi-naive.

In the first iteration, both evaluation techniques start with an empty set.

As the iterations proceed further both end up having iterations and producing tuples until a new tuple is reached.

So the semi-naive starts from the head or body of the rule?

path (X,Y):- edge(X,Y).

path (X,Y):- edge(X,Z),path (Z,Y).

Can someone please explain how the EDB and IDB get updated at the end of each iteration for the above program. Are the tuples stored under each predicate? Like a separate column for edge and a separate column for the path or they get stored as a collection.

Also, what is the difference between global and local unification?