3 - Closure
ucla | CS 181 | 2024-04-05 14:20
Table of Contents
Basic Notions
- Regular Language - a language for which there exists a DFA/NFA that recognizes it
- Regular languages remain regular under regular operations, the definition is bidirectional.
Regular Operations
Fundamental Ops
- Complement
for DFAs- We need to inspect state transitions for NFAs to ensure the complement is regular.
- Union
- Combine using
transitions - Combine
and s.t. their union model is defined by the cartesian products of and definitions$F’=\bigg{(q,r)\space \space q\in F_1\lor r\in F_2\bigg}=(F_1\times Q_2)\cup(Q_1\times F_2)$
- Combine using
- Intersection
- DeMorgan’s =>
- We showed complement is regular, and the union is regular; thus, the intersection is regular bc the complement is regular
$F’=\bigg{(q,r)\space \space q\in F_1\land r\in F_2\bigg}=F_1\times F_2$
- DeMorgan’s =>
- Concatenation
Functional Ops
Add $L={x\sigma y\space \space \sigma\in\Sigma,xy\in L}$ - sps DFA
accepts - make 2 copies:
, and for some state that transitions on - Now, make the state
in have a transition on to the same state in - but adjust
so that all states are rejecting and do NOT include a start transition in
- sps DFA
Skip $L={xy\space \space x\sigma y\in L,\sigma\in\Sigma}$ - Similar to add, sps
are the same DFA but 2 copies that both accept has the start transition but is all rejecting and has no start transition- now, from some state
draw transitions for each symbol in the alphabet to the same state but unique copies for each symbol - i.e.,
will have 2 transitions for the binary alphabet to 2 copies of
Corollaries
If
are regular, then the language described by any regular operations on any number of them is also regular e.g. e.g.
- Similar to add, sps
Every finite language is regular Pf:
- sps.
is finite then, is regular by the corollary above WLOG