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

id = 157
group = 'clp_r'
number = 67
visible = True
facts = None

solution = '''\
bounding_box([], Xa/Ya, Xb/Yb) :-
    minimize(Xb - Xa),
    minimize(Yb - Ya).
bounding_box([X/Y|L], Xa/Ya, Xb/Yb) :-
    { Xa =< X, X =< Xb,
      Ya =< Y, Y =< Yb },
    bounding_box(L, Xa/Ya, Xb/Yb).'''