Chapter 2_Context-Free Grammar (CFG), Formal Languages, Alphabets, String & Notation

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

Alphabet

It is defined as a finite set of symbols. We define an ___________ to be any nonempty finite set. The members of the _________ are the symbols of the ___________.

2
New cards

Alphabet

It is denoted by a sigma symbol

3
New cards

string

A “_________” over an alphabet is a finite sequence of symbols from that alphabet, which is usually written next to one another and not separated by commas.

4
New cards

length

The “________” of a string is its ________ as a sequence. The __________ of a string w is written as |w|.

5
New cards

Epsilon E or ε

Lambda Λ or λ

Symbol for null string (2)

6
New cards

pipe symbol | |

length is denoted by?

7
New cards

palindrome

String that is equivalent in its reverse called ____________

8
New cards

Reverse String

It explains the concept of reversing a string mathematically

9
New cards

substring

A string z is a __________ of w if z appears consecutively within w.

10
New cards

concatenation

Assume a string x of length m and string y of length n, the ______________ of x and y is written xy

It is the process of joining two strings together

11
New cards

suffix

If w = xv for some x, then v is a ______ of w.

12
New cards

prefix

If w = vy for some y, then v is a ______ of w.

13
New cards

Context-Free-Grammar

A more powerful method of describing languages.

14
New cards

Context-Free-Grammar

First used in the study of human languages.

15
New cards

specification, compilation

Application of context-free grammars occurs in the ___________ and ___________ of programming languages.

16
New cards

Parser

a component that most compilers and interpreters have. extracts the meaning of a program before generating the compiled code

17
New cards

4

Context-Free-Grammar is defined by __ tuples

18
New cards

finite set of variables or finite set of Non-terminal Symbols

Context-Free-Grammar

V is a?

19
New cards

finite set of terminals

Context-Free-Grammar

∑ or T is a?

20
New cards

start variables

Context-Free-Grammar

S is a?

21
New cards

finite set of production rules

Context-Free-Grammar

P is a?

22
New cards

can be rewritten as, produces

The symbol "⟶" is read

"_____________.“ or

can also be read as “__________.”

23
New cards

production rules

The difference between regular grammar and context-free grammar is the _______________

24
New cards

productions, variable

A grammar consists of a collection of substitution rules, also called ____________. Each rule appears as a line in the grammar, comprising a symbol and a string separated by an arrow. The symbol is called a ___________.

25
New cards

terminals,

capital letters,

lowercase letters,

start variable

The string consists of variables and other symbols called __________. The variable symbols often are represented by ____________.

The terminals are analogous to the input alphabet and often are represented by _____________, numbers, or special symbols.

One variable is designated as the ___________. It usually occurs on the left-hand side of the topmost rule.