rough deduction algorithm