summaryrefslogtreecommitdiff
path: root/prolog/problems/lists_advanced/sublist_2/en.py
blob: 67b50a43322bdcacd9b5c909db970df5c972c8ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
name = 'sublist/2'
slug = 'generate sublists of a list'

description = '''\
<p><code>sublist(L, SL)</code>: <code>SL</code> is a continuous sublist of the
list <code>L</code>. Your program should return every possible sublist; each
answer may be returned more than once.</p>
<pre>
?- sublist([1,2,3], X).
  X = [] ;
  X = [1] ;
  X = [1,2] ;
  X = [1,2,3] ;
  X = [2] ;
  X = [2,3] ;
  X = [3].
</pre>'''

hint = {}