Diagrammatic Reasoning for Planning and Intelligent Control