summaryrefslogtreecommitdiff
path: root/prolog/problems/dcg/paren_2/en.py
blob: 3041a67b6c4dd1d5cf595d6eacffafefbd1705ae (plain)
1
2
3
4
5
6
7
8
9
10
11
# coding=utf-8

name = 'paren/2'
slug = 'properly nested parens'

description = '''\
<p>Write a DCG with the starting symbol <code>paren</code> for the language of properly nested sequences of parentheses. The terminal symbols in the grammar should be written like this: <code>['(']</code> and <code>[')']</code>.</p>
<p>Example words: <code>()</code>, <code>(())</code>, <code>()(())</code>, <code>(()())()</code>.</p>
<p>Example non-words: <code>)(</code>, <code>((()</code>, <code>))</code>.</p>'''

hint = {}