what is the pattern rule calculator