4.3 context-free languages

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/7

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.

8 Terms

1
New cards

context-free language

a type of language (set of strings) that can be defined by a context-free grammar

2
New cards

context-free grammar

describes which strings are and are not possible in a context-free language by laying out production rules

3
New cards

production rules

rules for context-free grammar, notated by arrows, signifying possible replacements for a character, notated as:

symbol → string (strings can be empty)

4
New cards

backus-naur form

a way of notating context-free languages, using statements in which the left hand side is defined by the right hand side

5
New cards

non-terminals

text placed inside of <angle brackets> in BNF represents a non-terminal

non-terminals can be broken down into terminals and non-terminals

e.x.

<FullName> ::= <Title><Forename><Surname>

6
New cards

terminal

text without any brackets represents a terminal, which cannot be broken down any further and must be taken to be the written value

e.x. <digit> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

( | is the OR operator )

digit is a non-terminal and 1,2,3,4,5,6,7,8,9 and 0 are terminals

7
New cards

recursion

the definition of a non-terminal using itself e.x.

<number> ::= <digit> | <digit><number>

allows numbers to be a string of digits of any length

8
New cards

syntax diagrams

visual, flowchart-like representations of non-terminals in a regular language

use rectangles to represent non-terminals and ellipses to represent terminals

shapes are joined by arrows which indicate how strings can be formed from the definitions

<p>visual, flowchart-like representations of non-terminals in a regular language</p><p>use rectangles to represent non-terminals and ellipses to represent terminals</p><p>shapes are joined by arrows which indicate how strings can be formed from the definitions</p>