A hybrid automata approach for monitoring the patient in the loop in artificial pancreas systems