Models - Context-Free Grammar Flashcards

1
Q

Informally, what elements define a context-free grammar (CFG)?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define a CFG

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define a context-free language (CFL)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the relationship between Regular languages and CFLs?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
~ Every word of at least "kavua hanipuach" size has a structure that can be inflated with any i.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we prove that a language is not context-free?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Let L1 and L2 be two CFLs. is L1∩L2 a CFL?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is CFL closed to? What is it not closed to?

A

CFL is closed to Union, concatenation and Kleen star.

CFL is not closed to intersection and complement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Please give examples of languages in CFL.

A

Also wwrev is in CFL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Please give examples of languages not in CFL.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How would you go about solving this question?

A

First write out the first few word in the language. Then the grammar will (hopefully) come to you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A

Notes:
1. Always try working with languages like Sigma-star
2. when listing the languages in CFL - don’t just write “REG” - list them!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly