Answer: 5
To find the number of items in the set GOTO(I0,⟨), we first construct the initial state I0 and then compute the transition on the terminal symbol ⟨.
Step 1: Compute the initial state I0
The state I0 is defined as CLOSURE({[S’→⋅S]}).
I0={S′→⋅S,S→⋅⟨L⟩,S→⋅id}
Step 2: Compute GOTO(I0,⟨)
The GOTO operation is defined as the closure of the set of items obtained by shifting the dot past the symbol ⟨ in I0:
GOTO(I0,⟨)=CLOSURE({[S→⟨⋅L⟩]})
Now, we compute the closure of this kernel item:
- Add the kernel item:
S→⟨⋅L⟩
- Since the dot is before the non-terminal L, we add the productions of L with the dot at the beginning:
L→⋅L,S
L→⋅S
- Since the dot is before the non-terminal S in the item L→⋅S, we add the productions of S with the dot at the beginning:
S→⋅⟨L⟩
S→⋅id
Combining all these, the set of items in GOTO(I0,⟨) is:
1.2.3.4.5.S→⟨⋅L⟩L→⋅L,SL→⋅SS→⋅⟨L⟩S→⋅id
Thus, the total number of items in the set GOTO(I0,⟨) is 5.