Datalog is a declarative logic programming language that extends Prolog by allowing function-free Horn clauses, which are rules consisting of a head and a body. It is used in database systems for expressing queries and constraints.
Here is an example of a Datalog program that defines a query to find all books written by an author:
?- writ(john, Book1).
?- writ(mary, Book2).
?- findall(wrote(X), Book(X)).