Answer: 9
To find the number of items in the set GOTO(I0,S), we first determine the items in I0 that have the dot immediately preceding the non-terminal S.
The initial state I0=CLOSURE({S′→∙S}) contains the following items with ∙S:
- S′→∙S
- S→∙SS
The kernel of GOTO(I0,S) is obtained by shifting the dot over S in these items:
Kernel={S′→S∙,S→S∙S}
To find the complete set GOTO(I0,S), we compute the closure of this kernel. Since the item S→S∙S has the dot before S, we must add all productions of S with the dot at the beginning:
- S→∙SS
- S→∙Aa
- S→∙bAc
- S→∙Bc
- S→∙bBa
Since we added items with ∙A and ∙B, we must also include the productions of A and B with the dot at the beginning:
- A→∙d#
- B→∙@
Combining the kernel and closure items, the complete set GOTO(I0,S) consists of the following 9 items:
- S′→S∙
- S→S∙S
- S→∙SS
- S→∙Aa
- S→∙bAc
- S→∙Bc
- S→∙bBa
- A→∙d#
- B→∙@
Thus, the number of items in GOTO(I0,S) is 9.