let check_duplication role =
  let role_name = Globals.string_id#get_name role#get_name in
  (* recursive check of a list of vars *)
  let rec check_duplicates list_string = function
      [] -> ()
    | head::tail ->
         if List.exists (fun x -> x#get_id=head#get_id) tail then
          add_sem_error
            (13,(Globals.string_id#get_name head#get_id),
             role_name,"","",(list_string^" list"));
        check_duplicates list_string tail
  in
  check_duplicates "parameters or local" (role#get_param@role#get_local);
  check_duplicates "owned" role#get_owned