Mode:
Duration:
1
2
3
4
5
parent(alice, bob).
parent(bob, carol).
ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).
? ancestor(alice, carol).Coding works best on desktop or with an external keyboard.
parent(alice, bob).
parent(bob, carol).
ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).
? ancestor(alice, carol).Coding works best on desktop or with an external keyboard.
Queries simple facts from a Datalog database.
parent(alice, bob).
parent(bob, carol).
ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).
? ancestor(alice, carol).Datalog is a declarative logic programming language based on first-order logic and Horn clauses. It is widely used for querying relational data, building rule-based systems, static analysis, and reasoning engines due to its logical purity, strong mathematical foundations, and deterministic evaluation model.
Origin & Creator
Developed in the late 1970s-1980s by the logic programming and database research community, notably at IBM and various academic institutions.
Industrial Note
Datalog is highly influential in static analysis engines, database optimization systems, enterprise rule engines, authorization systems, and graph analytics frameworks such as LogicBlox, Soufflé, and Flix.