100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Notas de lectura

Lecture Notes on Grammars (COMP11212)

Puntuación
-
Vendido
-
Páginas
1
Subido en
30-05-2024
Escrito en
2023/2024

Gain a thorough understanding of formal grammars with these comprehensive lecture notes for COMP11212. Covering context-free grammars and their role in language generation and parsing, these notes provide detailed explanations, examples, and diagrams. Ideal for students aiming to excel in the study of grammars and their applications in computation.

Mostrar más Leer menos
Institución
Grado








Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Estudio
Desconocido
Grado

Información del documento

Subido en
30 de mayo de 2024
Número de páginas
1
Escrito en
2023/2024
Tipo
Notas de lectura
Profesor(es)
Francisco lobo
Contiene
Todas las clases

Temas

Vista previa del contenido

Grammars

Definition Definition (I UE)
*
.
18 A
context-free grammar or CFG is
given by the following : 19 : A string e is a string generated by grammar G if there is a




also called the object alphabet Sequence of strings
· an alphabet I of terminal symbol ,
.




S =
Xo = X, =... = Xn X
non-terminal symbol the elements
=
·
an
alphabet""of ,
of which are also referred to as


auxiliary characters , placeholders in some books variables, with"" called the start
of G
or
,
step the application of
,
is obtained by
such that each Xi = Vit1 one
symbol .




rules to
production a non-terminal occurring in Xi as
follows
·
a
special non-terminal Symbol Set called the start symbol
that there production rule R Y
.
Let RE
is a <
: : occur in Xi and assume
production rules of the form R where RE , non-terminal
· a
finite get of > X is a

the
Then is obtained from Zi by replacing one occurrence of R in Xi by
(EUE)
ite
and non-terminal
*

Symbol and Xe is an arbitrary string of terminal
String Y
Symbols which ,
can be read as 'R can be replaced by X:

The language generated by grammar G is the set of all strings over which are



generated by G .




I
L xample :




asbe
5 :
Example : DFA to Grammar


S xaSb xaaSbbxaaabb
i in
· = aabb

b
· S E >




anabbb
· SxaSb -aaSbbxaaaSbbbxaaaEbbb =
S W




L =
LahbIneIN] non-regular language S - aS bT

T > aT bUE


Recap W >
E


Grammars consist of a number of production rules telling us how to rewrite non-terminals into

strings of terminals and non-terminals .




A Context Free Language is one defined by a
grammar.

strict subset of the set of Context Free
The set of Regular Languages over an alphabet is a




Languages.




Parsing
Practical Example 1: Practical Example 2:


S - aBC S S > aT Ta

B > bB/E T >
aT bTlE

C > CIE a B C

S

s
· S XaBC XabBCxabaC xabacC abca = abc
b
B C
· S X aBC XaBc(XabBcCX abECa abc
=
a T A




E E A
-

I a T



E E
Practical Example 3



=ht
Se S S aas = an aea = ga




S + 55x S
S >
S + S

S -
5 xs
A SxS St S A
S > A

1 A A A A 2
A > ⑧

A = 1
0210 Context Free Languages

A >
2




Recap
A Parse Tree shows how string
a
may be generated from a
grammar .




An ambiguous where there strings that have multiple
parse trees
is
grammar one are
$4.85
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
jpxoi

Conoce al vendedor

Seller avatar
jpxoi The University of Manchester
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
1 año
Número de seguidores
0
Documentos
20
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes