summaryrefslogtreecommitdiff
path: root/prolog/problems/license_plates/genexp_2/en.py
blob: 5bf883175d09b0c86423faa37e5b97b774cf03ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
name = 'genexp/2'
slug = 'generate an arithmetic expression from a list'

description = '''\
<p><code>genexp(L, E)</code>: the expression <code>E</code> is obtained from the list <code>L</code> by inserting arithmetic operators between list elements. Your code should generate all valid solutions.</p>
<pre>
?- genexp([1,2,3], L).
  L = 1+2+3 ;
  L = 1+2-3 ;
  L = (1+2)*3 ;
  L = (1+2)/3 ;
  L = 1-2+3 ;
  L = 1-2-3 ;
  …
</pre>'''

hint = {}