I'm struggling to find the context-free grammar for the following language: $$ L = \{a^sb^tc^m:s,t,m\in\mathbb{N}^+\land1\leq t\leq3\land s\times t=m\} $$ Any help would be appreciated.
1 Answer
$\begingroup$
$\endgroup$
Write $L$ in the following way: $$ L = \{ a^sbc^s : s \in \mathbb{N}^+ \} \cup \{ a^sb^2c^{2s} : s \in \mathbb{N}^+ \} \cup \{ a^sb^3c^{3s} : s \in \mathbb{N}^+ \}. $$