A theory of case-based decisions