Questions tagged [grammars]
For challenges pertaining to a formal grammar often a context free grammar.
12 questions
9 votes
3 answers
295 views
Convert to Chomsky normal form
Let a context-free language be specified by its production rules and start symbol, e.g. S -> AbB | C C -> b | c B -> AA | AC A -> a | ε Here and in the ...
10 votes
6 answers
1k views
Abstract Rewriting Challenge (Robbers)
This is a somewhat proof-golf-like cops-and-robbers challenge. This is the robbers' thread; the cops' thread is here. Robbers The cops will post abstract rewriting systems. Your task is to crack ...
4 votes
2 answers
336 views
My program knows your language. Does yours?
Given a list of production rules and start symbol of a proper finite context-free grammar (CFG) of printable characters, your program or function must output its formal language (the set of all ...
14 votes
2 answers
1k views
Please parse this aLL1en language
Background Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of ...
0 votes
3 answers
320 views
Create a Question Asker! [closed]
Writing questions for programming puzzles is tiring and takes many minutes to do. This is where you come in. Your job is to write a program that randomly generates plausible-sounding (but not ...
6 votes
1 answer
611 views
Write a CFG acceptor
Write a program that, given a context free grammar and a string, returns whether the string is a word of the language defined by the grammar. Input Your program should read a context free grammar and ...