I'm having a hard time understanding how left/right derivations work. I have a very simple example that I've attempted but I don't really know how to check if it's correct.
$S-> NP$ $V$ $NP$
$NP ->$ the $N$
$N ->$ cat | mouse
$V ->$ ate
LEFT
$S-> NP$ $V$ $NP$
$S->$ the $N$ $V$ $NP$
$S->$ the $N$ $V$ the $N$
$S->$ the cat $V$ the $N$
$S->$ the cat ate the $N$
$S->$ the cat ate the mouse
RIGHT
$S->NP$ $V$ $NP$
$S->NP$ $V$ the $N$
$S->$ the $N$ $V$ the $N$
$S->$ the $N$ $V$ the mouse
$S->$ the $N$ ate the mouse
$S->$ the cat ate the mouse
My Thoughts
My lecture material says that we operate on the left/rightmost non terminal, I'm not 100% sure how to differentiate terminals and non-terminals but I assumed that if it became an English word it was a terminal hence I skipped it as long as there was a production remaining with another identifier in it.
Parse Tree
I genuinely don't know how to create the parse trees and I appreciate any input in helping me figure it out.
edit: I forgot to mention, I know that the parse tree should be the same for the left and right derivation of the above grammar, just don't know how to build one, all examples I find online are too complex for my understanding, I just started learning about this stuff very recently.