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

id = 123
number = 30
visible = True
facts = None

solution = '''\
sins123(X, [], [X]).
sins123(X, [Y|T], [X,Y|T]) :-
  X =< Y.
sins123(X, [Y|T], [Y|L]) :-
  X > Y,
  sins123(X, T, L).
isort([], []).
isort([H|T], SL) :-
  isort(T, ST),
  sins123(H, ST, SL).
'''