# Monotone (context-sensitive) grammar, a special case of an unrestricted grammar: left and right-hand sides are arbitrary strings.
# G = ({S,B,C}, {a,b,c}, S, P) with
#   S -> aSBC | aBC     CB -> BC     aB -> ab     bB -> bb     bC -> bc     cC -> cc
# L(G) = { a^n b^n c^n : n >= 1 }
# A rule x->y may have any strings on both sides (a plain rule is a rewriting rule of a type-0 grammar).

# the words of the language: a string of terminal symbols (lower-case letters) that reaches component 1 is marked
[model.marks]
terminal = '\A[a-z]*\Z'

[axioms]
1 = ["S"]

[rules]
# S -> aSBC | aBC
S -> a S B C
S -> a B C
# CB -> BC: sort the nonterminals, B before C
C B -> B C
# aB -> ab, bB -> bb, bC -> bc, cC -> cc: turn them into terminals from left to right
a B -> a b
b B -> b b
b C -> b c
c C -> c c
