What does this Prolog list manipulation program do?

前端 未结 0 1093
囚心锁ツ
囚心锁ツ 2020-11-22 16:51

I\'m trying to wrap my head around this:

r([], _, []).
r([a(H,_)|T], a(H,X), [a(H,X)|T]).
r([a(H,V)|T], a(I,L), [a(H,V)|R]) :-
    H \\= I,
    r(T, a(I,L), R         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题