When the productions associated with n 1 and n 2 are different, we can avoid to evaluate ∆(n 1 , n 2 ) since it is 0.
we look for a node pair set where p(n) returns the production rule associated with n. To efficiently build N p , we (i) extract the L 1 and L 2 lists of the production rules from T 1 and T 2 , (ii) sort them in the alphanumeric order and (iii) scan them to find the node pairs time, but, if p(n 1 ) appears r 1 times in T 1 and p(n 2 ) is repeated r 2 times in T 2 , we need to consider r 1 × r 2 pairs.