You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
399 B
Plaintext
16 lines
399 B
Plaintext
10 years ago
|
// ancestors
|
||
|
parentof("douglas", "john").
|
||
|
parentof("john", "bob").
|
||
|
parentof("bob", "ebbon").
|
||
|
|
||
|
parentof("douglas", "jane").
|
||
|
parentof("jane", "jan").
|
||
|
|
||
|
ancestorof(A, B) <- parentof(A, B).
|
||
|
ancestorof(A, C) <- ancestorof(A, B), parentof(B,C).
|
||
|
|
||
|
grandparentof(A, B) <- parentof(A, C), parentof(C, B).
|
||
|
|
||
|
cousins(A,B) <- grandparentof(C,A), grandparentof(C,B).
|
||
|
|
||
|
parentof[`arg](A, B) -> int[32](A), !string(B).
|