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

id = 108
group = 'lists'
number = 15
visible = True
facts = None

solution = '''\
min([X], X).
min([H|T], Min):-
  min(T, Min1),
  ( H < Min1, Min is H
    ;
    H >= Min1, Min is Min1 ).
'''