A Hierarchically Structured Knowledge-Based System for Welding Automation and Control