This is a part of Grammars/gra_locomotif_microstate.gap. It is responsible for the index hacking for pknotsRG knots (pseudoknots cannot be modeled by tree grammars in principal, thus we take a subword an manually subdivide it into necessary parts)