diff options
author | Aleš Smodiš <aless@guru.si> | 2015-08-18 16:06:19 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-08-18 16:06:19 +0200 |
commit | 95e2fe57f6e4639f6ae9f1fef368829d5090dbf6 (patch) | |
tree | 462ba05eb0c4732ca1c97739548801258bf47b40 /prolog/problems/dcg/paren_2 |
Exported all problems from the SQLite database into the new directory structure.
Diffstat (limited to 'prolog/problems/dcg/paren_2')
-rw-r--r-- | prolog/problems/dcg/paren_2/common.py | 10 | ||||
-rw-r--r-- | prolog/problems/dcg/paren_2/en.py | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/prolog/problems/dcg/paren_2/common.py b/prolog/problems/dcg/paren_2/common.py new file mode 100644 index 0000000..ce5ec87 --- /dev/null +++ b/prolog/problems/dcg/paren_2/common.py @@ -0,0 +1,10 @@ +id = 168 +group = 'dcg' +number = 75 +visible = True +facts = None + +solution = '''\ +paren --> []. +paren --> ['('], paren, [')'], paren. +''' diff --git a/prolog/problems/dcg/paren_2/en.py b/prolog/problems/dcg/paren_2/en.py new file mode 100644 index 0000000..a4ab666 --- /dev/null +++ b/prolog/problems/dcg/paren_2/en.py @@ -0,0 +1,10 @@ +id = 168 +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 = {} |