A Theory of Case-Based Decisions