-
Notifications
You must be signed in to change notification settings - Fork 13
Typo in Table 4.4 – Row 6 should reference "Predict 4" instead of "Predict 5" #30
Copy link
Copy link
Closed
Description
Summary
In Table 4.4 of the Earley parsing algorithm demonstration, row 6 incorrectly lists the operation as 预测 5 (Predict 5). It should be 预测 4 (Predict 4) to accurately reflect the dependency chain of the prediction step.
Location
- Document: CS30017 编译原理 (Compiler Principles)
- Section: 4.4 Earley 解析算法
- Table: Table 4.4 – 状态 S[0]: ◦ <UNUM(1)> '+' <UNUM(2)> '*' <UNUM(3)>
- Row: Entry 6 (规范项:
E₂ → • E₃, 起源:S[0]) - Field to correct: "操作" (Operation) column
Current Content (Incorrect)
| 序号 | 操作 | 条目 | 规范项 | 起源 |
|---|---|---|---|---|
| 6 | 预测 5 | - | E₂ → • E₃ |
S[0] |
Expected Content (Corrected)
| 序号 | 操作 | 条目 | 规范项 | 起源 |
|---|---|---|---|---|
| 6 | 预测 4 | - | E₂ → • E₃ |
S[0] |
Reason
In the Earley algorithm, a "Predict X" operation indicates that the current item was generated by applying the prediction step to the item at row X.
- Row 4 contains the item
E₁ → • E₂, which has the non-terminalE₂immediately after the dot (•). - According to the prediction rule, this triggers the expansion of all productions for
E₂(i.e.,E₂ → E₃ OP₃ E₂ | E₃). - Rows 5 and 6 are precisely these predicted productions for
E₂. - Therefore, both rows 5 and 6 should reference Predict 4 as their source.
Row 5 correctly lists 预测 4, but row 6 incorrectly lists 预测 5. Since row 5 itself is a prediction result (not a source item that triggers further predictions for E₂), referencing it as the predictor for row 6 breaks the logical dependency chain.
Suggested Fix
Update the "操作" field of row 6 in Table 4.4 from 预测 5 to 预测 4.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels