当前位置:网站首页>Lecture on Compilation Principles
Lecture on Compilation Principles
2022-06-13 01:09:00 【includeSteven】
DFA To minimize
Why minimize
DFA To minimize the number of States is to seek the minimum number of states , And with the original DFA equivalent DFA
significance : Minimization can reduce the complexity of compiler construction , Improve the running efficiency of the compiler
Minimize whether there is
P56 Theorem 3.2: To any one DFA N There is an equivalent DFA M bring M Contains the minimum number of States , And M only ( Except for isomorphism with different state names )
The minimization algorithm
Pre knowledge
1. Equivalence and distinguishability between states :
hypothesis s and t by M Two states of
If from the State s And status t You can read a word when you start α And stop in the final state , said s and t Equivalent
There is a word α, bring s and t One readout α Stop in the final state , The other reads α Stop in a non final state , said s and t Distinguishable
So through the empty string , All non final states and final states are distinguishable
2. Useless state and unreachable state
Useless state : There is no path from this state to the final state
Inaccessible state : There is no path from the initial state to this state
eg:
The detailed steps
1. Preprocessing : Delete N All useless and unreachable states in
2. Yes N The state set of
Initial division :Π={F,S-F [,{error}] }
Yes Π Each subset of P division , until Π The states of any two different subsets of are distinguishable , And any two states of the same subset are equivalent ( Basis of division )
Basis of division :
For any subset of States
I j = { q 1 , q 2 , q 3 . . . q k } I_j = \bigr\{ {q_1,q_2,q_3...q_k}\bigr\} Ij={ q1,q2,q3...qk}
If there is an input in the alphabet a, bring
T ( q i , a ) = s , T ( q j , a ) = t , s and t No stay When front draw branch Π Of ren What One individual shape state Son Set in T ( q i , a ) and T ( q j , a ) Of ren What One individual nothing set The righteous T(q_i,a)=s,T(q_j,a)=t,s and t Not in current partition Π Any state subset of \\ T(q_i,a) and T(q_j,a) There is no definition of any of the T(qi,a)=s,T(qj,a)=t,s and t No stay When front draw branch Π Of ren What One individual shape state Son Set in T(qi,a) and T(qj,a) Of ren What One individual nothing set The righteous
Then you can put I j I_j Ij Split in two
3. Let each subset choose a representative , At the same time, other states of the subset are eliminated
example
P55 chart 3-13

边栏推荐
- The tle4253gs is a monolithic integrated low dropout tracking regulator in a small pg-dso-8 package.
- Et5.0 configuring Excel
- redis
- Five classic articles worth reading
- The scope builder coroutinescope, runblocking and supervisorscope of kotlin collaboration processes run synchronously. How can other collaboration processes not be suspended when the collaboration pro
- Introduction to convolutional neural network
- Kotlin coroutine suspend function suspend keyword
- Unity calls alertdialog
- 数学知识整理:极值&最值,驻点,拉格朗日乘子
- Dynamic planning - good article link
猜你喜欢

redis
![[003] embedded learning: creating project templates - using stm32cubemx](/img/18/43dfa98f1711e8e544828453e36812.jpg)
[003] embedded learning: creating project templates - using stm32cubemx

Memory learning book reference
![[JS component] dazzle radio box and multi box](/img/2a/00620bee312972db93e1db4313385f.jpg)
[JS component] dazzle radio box and multi box

Introduction to convolutional neural network

ArrayList underlying source code

FLIP动画实现思路

Alexnet实现Caltech101数据集图像分类(pytorch实现)

Mathematical knowledge arrangement: extremum & maximum, stagnation point, Lagrange multiplier

Status of the thread
随机推荐
[003] embedded learning: creating project templates - using stm32cubemx
The tle4253gs is a monolithic integrated low dropout tracking regulator in a small pg-dso-8 package.
np.concatenate中axis的理解
Exercise 5.14 input n strings, arrange them in alphabetical order and output them.
[JS component] floating text
Pytorch's leafnode understanding
Polymorphism and virtual function
Ecological convergence NFT attacks, metaverse ape leads the new paradigm revolution of Web 3.0 meta universe
数学知识整理:极值&最值,驻点,拉格朗日乘子
[JS component library] drag sorting component
Google play console crash information collection
Traditional machine learning classification model predicts the rise and fall of stock prices
4K sea bottom and water surface fabrication method and ocean bump displacement texture Download
[JS component] calendar
关于#数据库#的问题,如何解决?
Jenkins持续集成操作
Bubble sort - alternate sort at both ends
Can GPU acceleration pytorch work?
Leetcode-9-palindromes (simple)
Method of cleaning C disk