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

id = 149
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 ).
'''