Different consequences may follow the same behavior in different situations. When we respond differently in those different situations, we have formed a discrimination between the situations. For instance, when you tell a ribald tale to friends at a party, but refrain from doing so at a church gathering, this is an example of discrimination. A past history of positive reinforcement in the first case and a past history of positive punishment in the second could clearly be responsible for this illustration of discriminative responding.
Failure to have discriminated between these different situations would represent a case of inappropriate stimulus generalization.
Discrimination comes about when you chose the content of your joke depending on who is the listener (e.g., friend versus priest). Based on the joke that you tell, the positive reinforcement of the listener's laughter or the positive punishment of the listener's frown can tell you whether or not you made the right choice in the joke told.
Discrimination results when different situations occasion different responses based on the contingencies of reinforcement. Inappropriate stimulus generalization occurs when those different situations fail to produce discriminative operant responding. Generalization is not always inappropriate and occurs when you respond the same to two stimuli that are not identical.
For example, a child may learn to say "dog" when it sees the drawing of a rottweiler in a book. If the child later says "dog" when it sees a schnauzer on the street, it has generalized between the two distinct stimuli (the rottweiler and the schnauzer).
Discrimination and generalization are behavioral processes that said to jointly produce conceptual behavior.