summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/rev_2/common.py
blob: c31e25b60541c32d67358be6293c4400103c4640 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# coding=utf-8

id = 111
group = 'lists'
number = 18
visible = True
facts = None

solution = '''\
conc111([], L, L).
conc111([H|T], L2, [H|L]) :-
  conc111(T, L2, L).
rev([], []).
rev([H|T], R):-
  rev(T, R1),
  conc111(R1, [H], R).
'''