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

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