A theory of appropriateness with applications to generative artificial intelligence