Automatic Trouble Diagnosis of Complex Logic Circuits