summaryrefslogtreecommitdiff
path: root/prolog/problems/clp_fd/gcd_3/en.py
blob: 6d64602070193b95e2a94bce49fa8771a19feeb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
id = 149
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 = {}