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

id = 149
group = 'clp_fd'
number = 61
visible = True
facts = None

solution = '''\
cd(X, Y, CD):-
  X #= _ * CD,
  Y #= _ * CD,
  indomain(CD).

gcd(X, Y, GCD):-
  cd(X, Y, GCD),
  \+ ( cd(X, Y, CD), CD > GCD ).
'''