Answer the question
In order to leave comments, you need to log in
Prolog SWI - how to reverse the order of elements in a list?
Prolog SWI. There is a list L1, the elements of which are lists L, it is necessary to reverse the order of the elements in the lists L, and then replace the order of the lists L in the list L1 with the reverse.
Answer the question
In order to leave comments, you need to log in
If I understand correctly, then:
p(L, R):-
maplist(reverse, L, RL),
reverse(RL, R).
?- p(, X).
X = .
?- p(, X).
X = .
?-
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question