Planning and Understanding: A Computational Approach to Human Reasoning