 Hello everyone, I am Mrs. Sunita Doh topic covered here is Constructing SLR Passing Table. In this video we are going to consider how to construct SLR passing table for given context free grammar. Learning outcome at the end of the session students will be able to find LR0 atom for given context free grammar. Simple LR or in short SLR is easiest to implement. We refer the passing table constructed by this method as SLR table and to an LR passer using SLR passing table as an SLR passing. A grammar for which an SLR passer can be constructed is said to be an SLR grammar. And LR0 atoms of grammar G is a production of G with a dot at some position of the right side. Thus the production A derives x, y, z is the 4 atom, A derives dot x, y, z, A derives x dot y, z, A derives x, y, dot, z and A derives x, y, z dot. The production A derives epsilon generates only 1 atom, A derives dot. An atom indicates how much of a production we have seen at a given point in passing process. For example, the first atom above indicates that we hope to see a string derivable from x, y, z next on input. The second atom indicates that we have just seen on input a string derivable from x and that we hope to see a string derivable from y, z. A collection of set of LR0 atoms is called as the canonical LR0 collection and it is also a basis for constructing SLR passer. To construct the canonical LR0 atom, we define augmented grammar and to function closure and go to. Augmented grammar, so if G is a grammar with a start symbol S, then G dash the augmented grammar for G is with a new production rule S dash derives S, where S dash is a new starting symbol. The purpose of this new starting production is to indicate to the passer that it should stop passing when the passer is about to reduce S dash derives S. The example of the grammar and the augmented grammar by adding the production E dash derives E is given here on the slide. The closure operation, if i is a set of LR0 atoms for a grammar G, then closure i is a set of LR0 atom constructed from i by the two rules. First rule, initially every LR0 atom in i is added to the closure i. Second rule, a derives alpha dot b beta in closure i indicate that at some point in the passing process, we might see a substring derivable from b beta as input. So, if b derives gamma is a production, we also expect we might see a substring derivable from gamma at this point. Hence, we include b derives dot gamma in the closure i. We will apply this rule until no more new LR0 atoms can be added to the closure i. Example, consider the augmented expression grammar given here on the slide. If i is a set of one atom E dash derives dot e, the closure i contains the atom given here on the slide. Here, E dash derives dot e is put in closure of i by rule 1. Since there is an e immediately to the right of the dot, so by rule 2, we add e production with the dot at the left end that is e derives dot e plus t and e derives dot t. Now, there is a immediately t to the right of the dot, so we add the production with a dot at the left end that is t derives dot t star f and t derives dot f. Next, f to right of the dot forces f derives dot in parenthesis e and f derives dot id to be added. Now, no other atoms are put into the closure of i by rule 2. The closure operation algorithm is given on the slide. So, in this algorithm, if 1 b production is added to the closure of i with the dot at the left end, then all b production will similarly added to the closure. Kernel atom include the initial atom s dash derives dot s and all the atom whose dots are not at the left end. Non-kernel atom have their dots at the left end. So, each set of atom is formed by taking the closure of set of kernel atoms. The second useful function is go to. So, go to of i comma x is defined to be the closure of set of all the atoms a derives alpha x dot beta such that a derives alpha dot x beta is in i. If i is a set of atoms given on the slide, then the go to operation for the terminal and the non-terminal of this grammar are given on this slide. Then we compute the go to of i comma e by examining e for the atoms with e immediately to the right of the dot. So, such atoms are e dash derives dot e and e derives dot e plus t. So, we move the dot over the e to get e dash derives e dot, e derives e dot plus t and then took the closure of the atom. So, closure of the e dash derives e dot is e dash derives e dot. Well the closure of e derives e dot plus t is e derives e plus e dot plus t only as after dot there is terminal plus. In similar way we compute the go to of the remaining terminal and the non-terminal. We now give the set of atom construction algorithm to construct the C the canonical collection of set of L R 0 atom for an augmented grammar G dash which is given here on the slide. Consider the grammar and augmented grammar for this grammar by adding the production e dash derives e. i 0 is a set of one atom e dash derives dot e. So, the closure i 0 contains the atom given here on this slide and same is explained on the previous slide in the closure operation. We also compute the go to i 0 comma e by examining i 0 for the atoms with e immediately to the right of the dot in the go to operation which is i 1. Then we compute the go to of i 0 comma t by examining i 0 for the atoms with t immediately to the right of the dot. So, such atoms are e derives dot t and t derives dot t star f. So, we move the dot over the t to get the e derives t dot and t derives t dot star f and then took the closure of this atom. We compute here go to i 0 comma x f by examining i 0 for the atom with f immediately to the right of the dot. So, such atoms are t derives dot f. So, we move the dot over the f to get t derives f dot and then took the closure of this atom. Then we compute the go to of i 0 comma left parenthesis by examining i 0 for the atoms with the left parenthesis immediately to the right of the dot. So, such atoms are f derives dot in parenthesis e. So, we move the dot over the left parenthesis to get f derives left parenthesis dot e right parenthesis and then took the closure of this atom. We compute the go to i 0 comma id by examining i 0 for the atoms with id immediately to the right of the dot. So, such atoms are f derives dot id. So, we move the dot over the id to get f derives id dot and then took the closure of this atom. Now, we consider the go to operation on i 0 for all the terminals and the non-terminals. So, now similarly consider the go to operation on i 1 go to i 1 comma plus is given on this slide which is i 6 go to i 2 comma star is i 7 atom go to operation on i 3 atom is not possible. So, consider go to i 4 comma e which is i 8 that is given here on the slide go to i 4 comma t is i 2 go to i 4 comma f is i 3 go to i 4 comma left parenthesis is i 4 go to i 4 comma id is i 5 go to operation for i 5 is not possible. So, consider go to i 6 comma t which is i 9 go to i 6 comma f is i 3 go to i 6 comma left parenthesis is i 4 and go to i 6 comma id is i 5. Now, go to i 7 comma f is i 10 go to i 7 comma left parenthesis is i 4 go to i 7 comma id is i 5 now go to i 8 comma left parenthesis is i 11 go to i 8 comma plus is i 6 go to i 9 comma star is i 7. Now, the transition diagram of D F A D for this L R 0 atoms are given on this slide. So, till now we consider the L R passing algorithm SL L R passing algorithm that is SLR. Now, pause this video and reflect on this question for a minute or 2 minute and write your response. Once you return the answer to this question then you can restart playing this video the question is find L R 0 atoms for the following grammar. I hope all of you have completed this activity. So, L R 0 atoms for this grammar is given on this slide also the transition diagram for this L R atom are given on this slide. So, this is the reference used for preparing this presentation. Thank you.