25.08.2015 Views

Grammatiche e Linguaggi Liberi da Contesto

Grammatiche libere da contesto Grammatiche e Linguaggi Liberi da ...

Grammatiche libere da contesto Grammatiche e Linguaggi Liberi da ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Forme sentenzialiSia G =(V , T , P, S) una CFG, e α ∈ (V ∪ T ) ∗ .Se S ∗ ⇒ α diciamo che α e’ una forma sentenziale.Se S ⇒lmα diciamo che α e’ una forma sentenziale sinistra,Se S ⇒ rmα diciamo che α e’ una forma sentenziale destraNota: L(G) contiene le forme sentenziali che sono in T ∗ .<strong>Grammatiche</strong> libere <strong>da</strong> contestoEsempiPrendiamo la G delle espressioni. Allora E ∗ (I + E) e’ unaforma sentenziale perche’E ⇒ E ∗ E ⇒ E ∗ (E) ⇒ E ∗ (E + E) ⇒ E ∗ (I + E)Questa derivazione non e’ ne’ a sinistra ne’ a destraa ∗ E e’ una forma sentenziale sinistra, perche’E ⇒lmE ∗ E ⇒lmI ∗ E ⇒lma ∗ EE ∗ (E + E) e’ una forma sentenziale destra, perche’E ⇒ rmE ∗ E ⇒ rmE ∗ (E) ⇒ rmE ∗ (E + E)<strong>Grammatiche</strong> libere <strong>da</strong> contesto

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!