In find_mapping/2 look in formula.primitive() for matches.