summaryrefslogtreecommitdiff
path: root/prolog/problems/dcg/paren_3/en.py
blob: 04f21ba52a287ab0445bf59264c04e0df3a25079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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 = {}