In order to process binary rules r : A → BC, we need to account for the spans of the nonterminals B and C, which depend on whether r is anchored or not.
if r is anchored we need to introduce a vertex in between B and C. We use a special term α(r) = 1 for anchored r and α(r) = 0 for unanchored r. Rule r is then processed by the nested loops at line 9, which use index k and α(r) to indicate the boundary between the spans of B and C. We choose a mapping φ r from r's vertices to the input vertices, with the proviso that if r is anchored then r's anchored vertex is mapped to v k .