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)?
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?
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).
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)?
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?
You're Awesome Carl!!! Thank you so much, I love u!
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).
Thank you sir very good video
thankyou this video helped me a lot.
thanks sir