Find sum of elements of a list in prolog

preview_player
Показать описание
This video lecture shows how to find sum of all elements present in a list using prolog program. This lecture includes theory explanation as well as code using prolog ide. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
Рекомендации по теме
Комментарии
Автор

You're the only one who can explain recursion in prolog in such a great visual manner. Thanks a lot!

VADroidTS
Автор

That was such a great example of recursion. Thanks!

mylesmontclair
Автор

You explained the recursion very well Thanku so much 😊

avengersmarvelheroes
Автор

I would like you say you are YYDS! which in Chinese it means forever god. to express my appreciation.

yujiayang
Автор

Thanks for the explanation! Well put, great example.

Mike-mbyx
Автор

I make small modifications to the list. sumlist([], 0). sumlist([H|T], N) :- number[H], sumlist(T, N1), N is N1 + H, !; \+ number(H), sumlist(T, N).

kardahim
Автор

Can you make a video on how to duplicate the elements of a list please ^^

xox
Автор

I want to find repeating numbers of a given list for ex. [1, 2, 1, 2, 3, 5] return is [3, 5]

EnvyBeatshamstring
Автор

How can I reverse a list without using an inbuilt function?

aditi
Автор

hey bro, i've got question about code in prolog. i know its about graphs but i dont know how it works and what it does :/ can you help me?


circuit(b, a).
circuit(a, b).
circuit(c, b).
circuit(a, c).

path([]).
path([_]).
path([X, Y|Zs]):- circuit(X, Y), path([Y|Zs]).
path(X, Y).

pastelek
Автор

I literally have the exact same code and its giving me error: false

ashishkonagalla