A THEORY OF PLANS