Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fd9f0f044b
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (15 sloc) 0.44 kb
#lang semilit datalog
Semi-literate programming works for datalog as well
This is the data portion -- we just declare some basic facts.
> parent(john, douglas).
> parent(mary, john).
The `ancestor` relation computes the transitive closure of the
`parent` relation.
> ancestor(A, B) :-
> parent(A, B).
> ancestor(A, B) :-
> parent(A, C),
> ancestor(C, B).
Now we can ask a question.
> ancestor(mary,A)?
And then we get answers.
Jump to Line
Something went wrong with that request. Please try again.