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

name = 'gcd/3'
slug = 'greatest common divisor'

description = '''\
<p><code>gcd(X, Y, GCD)</code>: <code>GCD</code> is the greatest common divisor of <code>X</code> and <code>Y</code>. Implement this predicate using constraints.</p>
<p>Hint: try writing a predicate to find <em>all</em> common divisors of two numbers first.</p>
<pre>
  ?- gcd(36, 84, GCD).
    GCD = 12.
</pre>'''

hint = {}