What is the definition of a foil?

A. a character who experiences a shift in attitude during the course of a literary work

B. a character who does not have a major role in the story

C. a character who confirms to a standardized mental picture held in common by many people

D. a character who provides contrast to another character