This practical is based on the related lecture: Lecture 5: Context-Sensitive Grammars, LBAs and Chomsky’s Hierarchy
Given the following context-sensitive grammar (variables $S, U$; terminals ☺, ☹, ☻):
Provide a derivation and a parse tree for ☺☺☺☹☹☹☻☻☻ if these exist. If they don't exist, explain why.
Provide a context-sensitive grammar (CSG) for the language $L=\{\mathtt{a}^n\mathtt{b}^{2n}\mathtt{c}^n \mid n\in\mathbb{N}\}$. Show derivations for strings when $n=0, 1,$ and $2$.
Given the following LBA, where a transition $(q',a',d) \in \delta(q,a)$ is represented as an arrow from $q$ to $q'$ labelled $a, a'/d$:

LBA for Question 3
Provide a computation/run for the following inputs:
Define a linear-bounded automaton to recognise $\{\mathtt{0}^n\mathtt{1}^n\mathtt{2}^n \mid n\in\mathbb{N}\}$.
Describe how an NFA $N=(Q,\Sigma,\delta,q_0,F)$ can be converted to an equivalent LBA $M=(Q',\Sigma',\Gamma',\delta',q'_0,F')$.