name = 'grandparent/2' slug = 'the grandparent relation' description = '''\
grandparent(P, C)
: P
is a grandparent of C
.
?- grandparent(tina, X). X = vanessa ; X = patricia. ?- grandparent(tina, vanessa). true.
Family trees are
described with predicates parent/2
, male/1
, and
female/1
.
If X
is a parent of a parent of Y
,
then X
is a grandparent of Y
.
Did you connect X
and Y
through some common person?
We're looking for a grandparent and a grandchild, the gender is not important.
''', 'gender_is_irrelevant_markup': '''\Is this necessary?
''', 'or_instead_of_and': '''\Did you perhaps use a semicolon (that represents logical OR) instead of a comma (logical AND)?
''', 'x_must_be_parent': '''\A grandparent surely has a child, right? So he or she is a parent of someone...
''', 'x_need_not_have_parent': '''\
A parent of X
is not really important if we're looking for a grandchild...
A grandchild Y
must have a parent, right? And that parent is...
''', 'y_need_not_be_parent': '''\
A grandchild Y
doesn't really need to have children...
It seems your predicate is always "false". Did you give it the correct name, or is it perhaps misspelled?
If the name is correct, check whether something else is misspelled, perhaps there is a full stop instead of a comma or vice versa, or maybe you typed a variable name in lowercase?
It is, of course, also possible that your conditions are too restrictive, or even impossible to satisfy
(as would be, for example, the condition that X
is both a parent and a sister of Y
, or
something similarly impossible).