Download presentation
Presentation is loading. Please wait.
Published byGary Harrell Modified over 9 years ago
1
“A PROCEDURE FOR CHECKING EQUALITY OF REGULAR EXPRESSIONS” - A. GINZBURG Presented by Kenneth Burgess Ginzburg, A. "A Procedure for Checking Equality of Regular Expressions." Journal of the ACM 14.2 (1967): 355-62. Web.
2
CONNECTION TO CLASS FA -> TG -> RE -> FA Polymorphism In acquiescence to the insatiable demands of a ravening appetite, I require sustenance in the form of ingested nutrition. Yes. The Equality Dilemma
3
MOTIVE – WHY THIS MATTERS Algorithmic Which translates into…
4
FINALLY, THE PROCEDURE Taking advantage of polymorphism RE -> TG -> Finite set of left linear equations Y = aY a + bY b + ^ Y a = aY aa + bY ab Y b = aY ba + bY bb If each possible pairing of derivatives share “^”, the RE’s are equal.
5
THE THEORY BEHIND Taking derivatives of a RE Definition of a derivative R = ab+bab(a+b)* An example derivative: R(b) = ab(a+b)* You try: R(a) =
6
LINEAR EQUATIONS Now we take the finite set of !!unequal!! derivatives R = a + ba* R = aR a + bR b R a = aR aa + bR ab + ^ = aR aa + bR ab + ^ R b = aR ba + bR bb + ^ = aR b + bR aa + ^ R aa = aR aaa + bR aab = aR aa + bR aa
7
CHARACTERISTICS OF DERIVATIVES Every RE has a finite number of unequal derivatives Similar to our proposition -> every RE will produce a TG of finite states Every derivative has a corresponding set of vertices in the graph In short, R x is rep. by the same TG as R, but with A x as initial vertice
8
EXAMPLE – R ~ S
9
PAIRS # of distinct derivatives = # of distinct sets of beginning inputs To consider equality, we have to consider all possible beginning inputs for both regular expressions u (the number of pairs of inputs we have to consider) <= mn u (distinct pairs of R and S) <= m (distinct derivatives of R) n (distinct derivatives of S)
10
PAIRS OF R AND S Pair (R x,S x )InfersR has ^?S has ^? (^,^)(a,a)(b,b) (a,a)Yep (b,b)(ba,ba)Yep However, we do not continue, since ba is considered equal to b Since the columns R has ^? and S has ^? agree, the two RE’s are equivalent.
11
TABLE REPRESENTATION InputsVertices of REqual To^? 123 ^x axx bxx baxbx To streamline this process, we create tables of equivalencies – showing derivatives (or inputs), vertices corresponding, and whether they include ^.
12
HOW DOES THIS HELP US? Examine T 0 When 0 is inputted into the graph, 2 -> 4 3 -> 2
13
HOW DOES THIS HELP US? Examine T ^ When ^ is put into the graph, what happens?
14
HOW DOES THIS HELP US? A ^ are the starting vertices So A ^ T ^ = A ^ Relational functions… so 2 T 1 = 2 (does nothing) 2 T 0 = 4 (input 2, get out 4) 2 T ^ = 2,3
15
HOW DOES THIS HELP US? - A(10) can be computed by relational functions. - Computers can produce the derivatives. - Computers can check equivalency as long as they keep track of which states are accepting states
16
TO REVIEW RE -> TG Construct table representation of possible inputs Represent TG as set of relational matrices Determine U, the set of unique pairs of R and S inputs For each pair in U, determine if both R and S agree on whether or not they accept
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.