Tutorial 1

1 0 0
Tutorial 1

Đang tải... (xem toàn văn)

Thông tin tài liệu

COMPILER CONSTRUCTION COMPILER CONSTRUCTION Week 2 Tutorial Questions Regular Expressions, NFA and DFA 1 Let ∑ = {a,b} Write regular expressions for the languages over ∑ that contain a All strings b T[.]

COMPILER CONSTRUCTION Week Tutorial Questions Regular Expressions, NFA and DFA Let ∑ = {a,b} Write regular expressions for the languages over ∑ that contain: a All strings b The empty string c The string abb d The strings ba and aba e All strings beginning with ab f All strings beginning with a a and ending with a b g All strings that contain exactly two a’s h All strings in which every a is followed by a b Construct nondeterministic finite automata (NFA) from the following regular expressions: a (a|b)(a|b) b a(a|b)+ c (ab|b)*a d abb(a|b)?a Note: You may use Thompson’s construction algorithm Construct deterministic finite automata (DFA) from the NFA’s constructed in question Minimise the following DFA: a B a a a A b a C b b D E b b Write a phrase using wildcards to find the following words in a document written in MSWord: a Any number b “get” and “got” c Any word that starts with a ‘s’ and ends with ‘t’ E.g “sit”, “shoot”,… d Any word whose beginning is “re” E.g “repeat”, “recharge” but not “trend”

Ngày đăng: 11/04/2023, 11:05

Tài liệu cùng người dùng

Tài liệu liên quan