implemented print_compact_rules function (should work naturally with ruby's p function)