Exercício 09.02

Apresente uma derivação para a sentença bacbca sobre a gramática a seguir.

G = ({S, A, B, C}, {a, b, c}, P, S)
P = {< S >        ->  < A > < B > < C > | < A > < B > < C > < S > 
     < A > < B >  ->  < B > < A >
     < A > < C >  ->  < C > < A >
     < B > < A >  ->  < A > < B >
     < B > < C >  ->  < C > < B >
     < C > < A >  ->  < A > < C >
     < C > < B >  ->  < B > < C >
     < A >        ->  a
     < B >        ->  b
     < C >        ->  c }

Resposta

< S >
< A > < B > < C > < S >
< A > < B > < C > < A > < B > < C >
< B > < A > < C > < A > < B > < C >
b < A > < C > < A > < B > < C >
b a < C > < A > < B > < C >
b a c < A > < B > < C >
b a c < B > < A > < C >
b a c < B > < C > < A >
b a c b < C > < A >
b a c b c < A >
b a c b c a

Recomendamos

Clickarvore Vida de Programador Kinghost