Grammar: keep probabilities in the right order

after _indexrules() is called, rules are in different order,
so use .no attribute to get original rule number when
registering / switching probability models.