Reorganised the code of transformation rules and predicates.