Week 3: finite automata conversions and lexing

Ace your homework & exams now with Quizwiz!

If an NFA contains states, what is the lowest upper bound on the number of states in the DFA created by the subset construction algorithm?

2^n

What is the lowest upper bound on the number of states in the NFA created by Thompson's contruction

2n

In subset construction, a DFA state represents

A subset of all NFA states

What is an epsilon transition?

A transition on the empty string

In subset construction, a DFA state is accepting if and only if

At least one of the NFA states that it represents is final

What are the benefits of Hand-coded lexers

Better I/O performance More efficient interfacing w/ other phases

Describe the process of Thompson's Construction

Create NFA inductively, bottom up starting with individual alphabet symbol NFA always has exactly one start state and one accepting state

Describe the process of Subset Construction

Each DFA represents a subset of NFA states, using the null closure to collapse null transitions

What method is used for DFA Minimization

Hopcroft's Algorithm -create paritions, then keep splitting

Hopcroft's algorithm splits a partition

If it contains states that have different behavior for some input string

What is the main issue with handling keywords?

Keywords are valid identifiers

How do you convert from DFA to RE

Kleene's constructions -eliminating states by combining regex

Describe Kleene's Construction

Replace edge labels with REs Eliminate staes by combining REs Build RE

Describe Hopcroft's DFA Minimization

Split into two partitions (final/non-final) Keep splitting partition while there are states with differing behaviors

How do you convert NFA to DFA

Subset Construction -subsets of NFA nodes and null closure

What are the space and time requirements to run and build a DFA?

Subset construction (NFA to DFA) can result in state space explosion because for an n-state NFA, there can be up to 2^n DFA states, but the run time is proportional to the length of the input string

What are the 2 types of auto-generated lexers

Table driven: generic scanner, auto-generated tables Direct-coded: hard-code transitions using jumps

How do you convert Regex to NFA

Thompson's Construction -templates and null transitions

What are the space and time requirements to run and build a NFA?

Thompson's construction (from RE to NFA) is proportional to the size of the length of the regular expression, but the resulting NFA runs proportional to both the size of the NFA and the input string

A DFA runs proportional to

the length of the input string

An NFA runs in time proportional to

the number of states and the length of the input string


Related study sets

Quiz 11: Public Goods and Externalities

View Set

GS MGT 439 CH 9 Ethics, CSR, Environmental Sustainability, and Strategy

View Set

Chapter 3 (Mastery) - Nursing 299

View Set

HIM Technology : An Applied Approach

View Set

Crash accident Investigation test 1

View Set

Chapter 22: Antihypertensive Drugs

View Set

NU 310 Chapter 16: End of Life Care

View Set