Skip to main content

Questions tagged [grammars]

For challenges pertaining to a formal grammar often a context free grammar.

9 votes
3 answers
295 views

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 ...
Parcly Taxel's user avatar
  • 4,749
10 votes
6 answers
1k views

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 ...
N. Virgo's user avatar
  • 7,446
4 votes
2 answers
336 views

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 ...
fireflame241's user avatar
  • 16.4k
14 votes
2 answers
1k views

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 ...
SztupY's user avatar
  • 3,899
0 votes
3 answers
320 views

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 ...
qwr's user avatar
  • 12.4k
6 votes
1 answer
611 views

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 ...
FUZxxl's user avatar
  • 10.2k