A Knowledge-based System for CAPP