blob: f4d4c3b2628cc21eae636cc7e07ae3a0eb93dc6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
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 = {}
|