Implemented ArrayList of rules for program (program -> rules*)