summaryrefslogtreecommitdiff
path: root/prolog/problems/license_plates/genexp_2/en.py
blob: de168ec48709b0e0db07cb55dc214c3113eae270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# coding=utf-8

id = 146
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 = {}