Accumulators in PROLOG

  Рет қаралды 15,123

Techdose

Techdose

Күн бұрын

Пікірлер: 22
@marcosalmistraro7869
@marcosalmistraro7869 3 жыл бұрын
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 !
@edwardgrabczewski
@edwardgrabczewski 6 жыл бұрын
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?
@techdose4u
@techdose4u 6 жыл бұрын
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.
@estetlinus1
@estetlinus1 4 жыл бұрын
I totally agree. This is as non-intuitive as it gets :'-(
@bal3a100
@bal3a100 6 жыл бұрын
Great Work :D
@techdose4u
@techdose4u 6 жыл бұрын
Thnq for inspiring :) pls share the video to those who needs it.
@bal3a100
@bal3a100 6 жыл бұрын
@@techdose4u Yes I will do, please share more videos we need them asap
@techdose4u
@techdose4u 6 жыл бұрын
@@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
@bal3a100
@bal3a100 6 жыл бұрын
@@techdose4u about append, some sorts ( merge ; quicksort, ..) ; backtracking and cut That will be awesome THX :D
@shresthmishra9329
@shresthmishra9329 4 жыл бұрын
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).
@techdose4u
@techdose4u 4 жыл бұрын
🙏
@shresthmishra9329
@shresthmishra9329 4 жыл бұрын
@@techdose4u sir cse to le liya tha bina soche samghe lekin sab paar apk tutorials se hi ho rha hai🙏🙏🙏❤️❤️❤️
@techdose4u
@techdose4u 4 жыл бұрын
Ho jaega chinta mt kro :) Bas lagey rho.
@Huda-dq9tm
@Huda-dq9tm 5 жыл бұрын
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?
@YoungVinny
@YoungVinny 5 жыл бұрын
Because H is only being used once so Prolog doesn't like that and wants you to use an anonymous variable (underscore)
@shresthmishra9329
@shresthmishra9329 4 жыл бұрын
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-dq9tm
@Huda-dq9tm 4 жыл бұрын
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!
@videosforyou567
@videosforyou567 3 жыл бұрын
@@Huda-dq9tm @Shresth Mishra Do you guys use prolog now?
@alaukiktandlekar114
@alaukiktandlekar114 5 жыл бұрын
I have typed code as shown but i am getting output 0 why?
@MahmoudEssamMustafa
@MahmoudEssamMustafa 2 жыл бұрын
listLen(List,N):- lenAcc(List,0,N). lenAcc([],A,A). lenAcc([_|Tail],A,N):- A1 is A+1,lenAcc(Tail,A1,N).
@MahmoudEssamMustafa
@MahmoudEssamMustafa 2 жыл бұрын
in line 3 you should use the same predicate name as in line 2.
@muyybe
@muyybe 4 ай бұрын
unclear explanation and no advice for tgese problems.
Backtracking in PROLOG (with CODE)
13:23
Techdose
Рет қаралды 38 М.
Recursive search in PROLOG
10:28
Techdose
Рет қаралды 33 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Find if given element is present in list using prolog
5:41
Techdose
Рет қаралды 43 М.
CUT in PROLOG | Control Backtracking
8:37
Techdose
Рет қаралды 29 М.
Prolog 9: Recursion
16:15
Ryan Mattfeld
Рет қаралды 3,3 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
Matrix Factorization in Recommendation Systems | Netflix Recommend Movie
17:36
09 - Recursion with an Accumulator
35:58
Prolog By Example
Рет қаралды 395
Prolog Operators
9:57
The Power of Prolog
Рет қаралды 10 М.