this whole concept is just infuriating. Following a course on Prolog right now and really can't get my head around it. Thanks for trying to explain !
@edwardgrabczewski6 жыл бұрын
I find recursive programming rather difficult to follow and you do this video at a fast speed. All my experience of programming is with procedural languages like C and PL/SQL. I can see now why Lisp, Prolog and Logo didn't become popular for general programming since recursion, as opposed to iteration, is quite mind-bending! Does recursion get any easier with practice?
@techdose4u6 жыл бұрын
Recursion gets pretty easier with practice. I have made a separate video for Backtraking in PROLOG. Do check it out to get a better understanding of PROLOG Recursion.
@estetlinus14 жыл бұрын
I totally agree. This is as non-intuitive as it gets :'-(
@bal3a1006 жыл бұрын
Great Work :D
@techdose4u6 жыл бұрын
Thnq for inspiring :) pls share the video to those who needs it.
@bal3a1006 жыл бұрын
@@techdose4u Yes I will do, please share more videos we need them asap
@techdose4u6 жыл бұрын
@@bal3a100 Do you need backtracking and cut?? or do you need to understand some code? COMMENT your preferences and accordingly i will make them ASAP
@bal3a1006 жыл бұрын
@@techdose4u about append, some sorts ( merge ; quicksort, ..) ; backtracking and cut That will be awesome THX :D
@shresthmishra93294 жыл бұрын
If anyone wants to execute it-> listlen(L, N) :- listacc(L, 0, N). listacc([], A, A). listacc([_|T], A, N) :- A1 is A+1, listacc(T, A1, N).
@techdose4u4 жыл бұрын
🙏
@shresthmishra93294 жыл бұрын
@@techdose4u sir cse to le liya tha bina soche samghe lekin sab paar apk tutorials se hi ho rha hai🙏🙏🙏❤️❤️❤️
@techdose4u4 жыл бұрын
Ho jaega chinta mt kro :) Bas lagey rho.
@Huda-dq9tm5 жыл бұрын
I tried running both the codes and both showed a same error that said "Singleton Variable: H". I do not understand the error but it went away when I replaced H with an underscore and then the programs worked satisfactorily for all kinds of test cases. Can you explain why this happened?
@YoungVinny5 жыл бұрын
Because H is only being used once so Prolog doesn't like that and wants you to use an anonymous variable (underscore)
@shresthmishra93294 жыл бұрын
listlen(L, N) :- listacc(L, 0, N). listacc([], A, A). listacc([_|T], A, N) :- A1 is A+1, listacc(T, A1, N). Try this . It will work.
@Huda-dq9tm4 жыл бұрын
Shresth that's so nice of you but honestly it was so long ago. I dont even remember why I asked what I asked. But thankyou!
@videosforyou5673 жыл бұрын
@@Huda-dq9tm @Shresth Mishra Do you guys use prolog now?
@alaukiktandlekar1145 жыл бұрын
I have typed code as shown but i am getting output 0 why?
@MahmoudEssamMustafa2 жыл бұрын
listLen(List,N):- lenAcc(List,0,N). lenAcc([],A,A). lenAcc([_|Tail],A,N):- A1 is A+1,lenAcc(Tail,A1,N).
@MahmoudEssamMustafa2 жыл бұрын
in line 3 you should use the same predicate name as in line 2.
@muyybe4 ай бұрын
unclear explanation and no advice for tgese problems.