blob: 4a8e0a878dba7c29674bd4a407fcc2efc33f401b (
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 = {}
|