Similar to CFGs: variables, terminal and rules
However rules have a more flexible format
Variables and terminals may appear on both sides of "$\rightarrow$"
$\mathtt{0}{\color{red}{A}}\mathtt{1}B\rightarrow \mathtt{0}{\color{green}{\mathtt{01}}}\mathtt{1}B$
<aside> ⚠️
DEFINITION
A context-sensitive grammar $G$ is a 4-tuple $G=(V,\Sigma,R,S)$, where
$V$ is the finite set of variables
$\Sigma$ is the finite set of terminals ($V\cap\Sigma=\emptyset, V$ and $\Sigma$ are disjoint sets)
$R$ is the finite set of rules of the form $\alpha A\beta\rightarrow \alpha\gamma\beta,$ where $\alpha, \beta \in (V\cup\Sigma)^,$ and $\gamma\in ((V\cup\Sigma)^ \setminus \{\epsilon\})$
$S\in V$ is the start variable </aside>
$\alpha$ and $\beta$ are strings of variables and terminals
For any $u\alpha v$, $u,v\in(V\cup\Sigma)^*$, if $(\alpha\rightarrow\beta)\in R$, we say that $u\alpha v$ yields $u\beta v$, written as $u\alpha v\Rightarrow u\beta v$