Set notation of a grammar Say I have a grammar e.g,

$$\begin{align}S&amp;\to AB\mid abc\\
A&amp;\to aAb \mid \lambda\\
B&amp;\to bBa \mid ba
\end{align}$$

Now it is obvious the notation for this would be something like,
$$L(G) = \{a^{i}b^{i}b^{k}a^{k} |  i \ge 0, k &gt; 0\}$$

My question is how do I account for the starting state going to abc. How can I represent this in set notation? My only thought would be to append $(abc)^{m}$ to the statement and then say something like if i,k == 0 then m = 1. Though I'm not sure if that is allowed?
In contrast to popular thought, the description of a language doesn't have to be of the exact form
$$
L = \{a^i b^j c^k \mid \text{conditions on $i,j,k$}\}.
$$
A language is a set, and you can describe it in exactly the same variety of ways as you describe sets. For example, we can write
$$
L = \{a,b\}^* \setminus \{a^nb^n \mid n \geq 0\}.
$$
In your case, as rici mentions in the comments, you might as well just take a union with $\{abc\}$ to account for the additional case.