diff options
Diffstat (limited to 'prolog/problems/family_relations/ancestor_2')
-rw-r--r-- | prolog/problems/family_relations/ancestor_2/en.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/prolog/problems/family_relations/ancestor_2/en.py b/prolog/problems/family_relations/ancestor_2/en.py index 322ab92..8e253bd 100644 --- a/prolog/problems/family_relations/ancestor_2/en.py +++ b/prolog/problems/family_relations/ancestor_2/en.py @@ -2,7 +2,8 @@ name = 'ancestor/2' slug = 'the ancestor relation' description = '''\ -<p><code>ancestor(X, Y)</code>: <code>X</code> is an ancestor (parent, grandparent, grandgrandparent, ...) of <code>Y</code>.</p> +<p><code>ancestor(X, Y)</code>: <code>X</code> is an ancestor (parent, grandparent, great-grandparent, ...) +of <code>Y</code>.</p> <pre> ?- ancestor(patricia, X). X = john ; @@ -15,13 +16,16 @@ described with predicates <code>parent/2</code>, <code>male/1</code>, and ''' plan = ['''\ -<p>It's time to use recursion for the first time... how can we transpose the problem to a smaller one (a single step smaller that is)?</p> -<p><img src="[%@resource Prolog_ancestor_03.svg%]" alt="A parent of someone, who is a parent of Y, is also an ancestor of Y." /></p> +<p>It's time to use recursion for the first time... how can we transpose the problem to a smaller one +(a single step smaller that is)?</p> +<p><img src="[%@resource Prolog_ancestor_03.svg%]" alt="A parent of someone, who is a parent of Y, +is also an ancestor of Y." /></p> ''', '''\ <p>If <code>X</code> is a parent of some <code>Z</code> and that <code>Z</code> is an ancestor of <code>Y</code>, then <code>X</code> is also an ancestor of <code>Y</code>.</p> ''', '''\ -<p><img src="[%@resource Prolog_ancestor_04.svg%]" alt="If X is a parent of Z, and Z is an ancestor of Y, then X is also an ancestor of Y." /></p> +<p><img src="[%@resource Prolog_ancestor_04.svg%]" alt="If X is a parent of Z, and Z is an ancestor of Y, +then X is also an ancestor of Y." /></p> '''] hint = { @@ -63,7 +67,7 @@ one another -- assigned values to variables in one branch do not transfer to the 'only_two_levels_deep': '''\ <p>Your solution is not general enough. An ancestor can also be someone "more steps away" than grandparents, -e.g. grandgrandparents or grandgrandgrandparents are also ancestors.</p> +e.g. great-grandparents or great-great-grandparents are also ancestors.</p> ''', 'descendant_need_not_be_parent': '''\ |