|
Prolog is excellent for queries on
relational data (as in the Mathematical sense of a "relation"), e.g.
born(charles, elizabeth2, philip).
born(anne, elizabeth2, philip).
born(andrew, elizabeth2, philip).
born(edward, elizabeth2, philip).
born(diana, frances, edwardSpencer).
born(william, diana, charles).
born(henry, diana, charles).
born(Peter, anne, markPhillips).
born(Zara, anne, markPhillips).
born(beatrice, sarah, andrew).
born(eugenie, sarah, andrew).
born(louise, sophie, edward).
born(james, sophie, edward).
born(george, catherine, william).
born(charlotte, catherine, william).
? born(S, elizabeth2, Y) and born(G, M, S).
|
Note,
Peter Phillips and Zara Phillips do not have titles
because they are female-line descendants of royalty.)
Also see [aunts and uncles].
|
|