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

name = 'paren/3'
slug = 'properly nested parens with meaning'

description = '''\
<p>Write a DCG with the starting symbol <code>paren</code> for the language of properly nested sequences of parentheses. The meaning of a word in this language is the maximum depth of the nested parentheses.</p>
<pre>
  ?- paren(D, ['(','(',')',')','(',')'], []).  % (())()
    D = 2.
</pre>
'''

hint = {}