Cognitive Modeling of Purposive Actions