From eca7d4651ea9e16e8a92520bad7d00fccef867bc Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Tue, 9 Aug 2016 16:32:15 +0200 Subject: English translation for descendant/2 added. --- prolog/problems/family_relations/ancestor_2/en.py | 7 ++- .../problems/family_relations/descendant_2/en.py | 66 ++++++++++++---------- 2 files changed, 39 insertions(+), 34 deletions(-) (limited to 'prolog') diff --git a/prolog/problems/family_relations/ancestor_2/en.py b/prolog/problems/family_relations/ancestor_2/en.py index cec2a29..322ab92 100644 --- a/prolog/problems/family_relations/ancestor_2/en.py +++ b/prolog/problems/family_relations/ancestor_2/en.py @@ -77,12 +77,13 @@ e.g. grandgrandparents or grandgrandgrandparents are also ancestors.

''', 'predicate_always_false': '''\ -

It seems your predicate is always "false". Did you give it the correct name, or is it perhaps misspelled?

+

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 parent and a sister of Y, or -something similar).

+(as would be, for example, the condition that X is both a parent and a sister of Y, or +something similarly impossible).

''', 'timeout': '''\ diff --git a/prolog/problems/family_relations/descendant_2/en.py b/prolog/problems/family_relations/descendant_2/en.py index 535ef23..c50ac17 100644 --- a/prolog/problems/family_relations/descendant_2/en.py +++ b/prolog/problems/family_relations/descendant_2/en.py @@ -15,81 +15,85 @@ described with predicates parent/2, male/1, and ''' plan = ['''\ -

I believe recursion is needed... how can we transpose the problem to a smaller one (a single step smaller that is)?

-

A descendant of someone, who is a child of Y, is also a descendant of Y.

+

I believe recursion is needed... how can we transpose the problem to a smaller one +(a single step smaller that is)?

+

A descendant of someone, who is a child of Y,
+is also a descendant of Y.

''', '''\

If Z is a parent of some X and at the same time Z is a descendant of Y, then X is also a descendant of Y.

''', '''\ -

If X is a descendant of Z, and Z is a child of Y, then X is also a descendant of Y.

+

If X is a descendant of Z, and Z is a child of Y,
+then X is also a descendant of Y.

'''] hint = { 'gender_is_irrelevant': '''\ -

Je spol res pomemben?

+

Is gender really important?

''', 'gender_is_irrelevant_markup': '''\ -

Je to res potrebno?

+

Is this necessary?

''', 'grandparent_used': '''\ -

Rešitev z "grandparent" bo premalo splošna, poskusi nadomestiti to z rekurzijo. -Skratka, poskusi prevesti na "manjši" problem, npr. potomec v enem koraku manj -(en korak bližji potomec)...

+

The solution using the grandparent relation will not be general enough, try using recursion instead. +Try to transpose the problem into a "smaller" one, e.g. a descendant in one step less (a closer descendant).

''', 'grandparent_used_markup': '''\ -

Bi se dalo rešiti brez tega?

+

Can you solve without using this?

''', 'base_case': '''\ -

Si pomislil na robni pogoj? Rekurzija se mora enkrat tudi ustaviti. -Kaj je najbolj enostaven par (potomec, prednik)?

+

Did you think of a base case? The recursion has to stop at some point. +What is the most obvious pair (descendand, ancestor)?

''', # TODO: morda ta hint naredim z "more": najprej tekst, ob kliku pa še slika... (sicer je preveč očitno) 'descendant_of_oneself': '''\ -

Kako je lahko nekdo potomec samega sebe? Iz trenutne verzije rešitve se da izpeljati tudi to. -Premisli, morda se ti splača tudi grafično skicirati tvojo trenutno rešitev.

+

How can anyone be a descendant of him- or herself? This can be inferred from the current version of the program. +It might also help to graphically sketch your current solution.

''', 'descendant_of_oneself_with_or': '''\ -

Kako je lahko nekdo potomec samega sebe? Iz trenutne verzije rešitve se da izpeljati tudi to. -Premisli, morda se ti splača tudi grafično skicirati tvojo trenutno rešitev.

-

Morda se ti splača preveriti tudi uporabo podpičja. To praktično naredi dva ločena stavka oz. veji -(eno ali drugo velja, morda tudi oboje). Vendar pazi, ker sta ti dve veji med seboj neodvisni --- vrednosti iz ene se ne prenašajo v drugo vejo.

+

How can anyone be a descendant of him- or herself? This can be inferred from the current version of the program. +It might help to graphically sketch your current solution.

+

Perhaps you should also check your use of the semicolon. The semicolon basically creates two separate clauses or +branches (one or the other can hold, or even both). However, be careful, as this two branches are independent of +one another -- assigned values to variables in one branch do not transfer to the other branch.

''', 'descendant_need_not_be_parent': '''\ -

Potomec X pravzaprav ne rabi imeti otrok...

+

The descendant X doesn't actually need to have any children...

''', 'predicate_always_false': '''\ -

Vse kaže, da tvoj predikat vedno vrne "false". Si mu dal pravilno ime, si se morda pri imenu zatipkal?

-

Če je ime pravilno, se morda splača preveriti tudi, če se nisi zatipkal kje drugje, -je morda kakšna pika namesto vejice ali obratno, morda kakšna spremenljivka z malo začetnico?

-

Možno je seveda tudi, da so tvoji pogoji prestrogi ali celo nemogoči (kot bi bila npr. zahteva, -da je X hkrati starš in sestra od Y ali kaj podobnega).

+

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).

''', 'timeout': '''\ -

Je morda na delu potencialno neskončna rekurzija? Kako se bo ustavila?

-

Morda pa je kriv tudi manjkajoč, neustrezen ali preprosto nekompatibilen (s splošnim primerom) robni pogoj?

+

Is there an infinite recursion at work here? How will it ever stop?

+

Or perhaps is there a missing, faulty, or simply incompatible (with the general recursive case) base case?

''', 'wrong_direction': '''\ -

Si morda sprogramiral ravno obratno in zamenjal prednika s potomcem? -X naj bo potomec od Y in ne obratno!

+

Did you perhaps program exactly the reverse relation, ancestor instead of descendant? +X should be a descendant of Y and not the other way around!

''', # TODO: Tim, kako bi lahko še query poslali med parametri v Hint dict? Je to predvideno? Tukaj bi recimo pasalo... 'final_hint': '''\ -

Zanimivost: nalogo bi lahko rešil tudi z uporabo rešitve za relacijo ancestor/2. -Samo obrni spremenljivki X in Y; -če je X potomec od Y, potem je Y prednik od X.

+

Interesting tidbit. This exercise could also be solved using the solution to the ancestor/2 +relation. Simply reverse the variables X and Y; +if X is a descendant of Y, then Y is an ancestor of X.

''', } -- cgit v1.2.1