Prolog - Recursion in Family Relationship

Поделиться
HTML-код
  • Опубликовано: 6 ноя 2024

Комментарии • 7

  • @NK-ct5os
    @NK-ct5os 4 года назад +4

    Very informative video but what I don't understand, and would appreciate if you could clarify, is about lines: call/fail 'parent(jim, _141) and parent(,jim_129) - they seem out of place and don't make sense to me?! Where has it got that binding of jim to variable x from? According to the ordering you explained, that the second predecessor clause was executing, X should have been bounded to 'peter' when it was invoked and not to jim? If it does now backtracking (that is after failing parent(jim,_23) on line 20, as you explain), it should look something like Fail: parent(peter,_92)?? Also, what exectly prompts this newly, seemingly redundent, invocation of parent(jim,_141)? And if it does fail, why does it come back with yet another anonymous variable, in its place, like parent(jim,_129)?

  • @jieyukong2016
    @jieyukong2016 6 лет назад +2

    Thanks for your video, i now understand the predecessor relationship prolog, Could we write a prolog rule, that can tell us the relation ship not only the relation ship of predeccessor, but future generation? such as: relation(X,Y), X can be the predecessor or the future generation?

  • @1ilfolletto8
    @1ilfolletto8 4 года назад +1

    You're Awesome Carl!!! Thank you so much, I love u!

  • @shahidaibrahim2917
    @shahidaibrahim2917 2 года назад +1

    i have a doubt..
    if X is predecessor of Z, then it should be X is patent of Y, not Z.
    wrong-- predecessor(X,Z):- parent(X,Z).
    correct-- predecessor(X,Z):- parent(X,Y).

  • @RedCandle23
    @RedCandle23 Год назад

    Thank you sir very good video

  • @TheMalcomrj
    @TheMalcomrj 5 лет назад +2

    thankyou this video helped me a lot.

  • @daggabeats6502
    @daggabeats6502 10 месяцев назад

    thanks sir