- | ((head, _, _), _) :: _ -> [ Node ([loc], Id head, []) ] in
- let do_branch ((head, _, args), term) =
- let (term_context, args_domain) =
- List.fold_left
- (fun (cont, dom) (name, typ) ->
- (CicNotationUtil.cic_name_of_name name :: cont,
- (match typ with
- | None -> dom
- | Some typ -> dom @ domain_of_term ~loc ~context:cont typ)))
- (context, []) args
- in
- domain_of_term ~loc ~context:term_context term @ args_domain
+ | (Ast.Pattern (head, _, _), _) :: _ -> [ Node ([loc], Id head, []) ]
+ | _ :: tl -> get_first_constructor tl in
+ let do_branch =
+ function
+ Ast.Pattern (head, _, args), term ->
+ let (term_context, args_domain) =
+ List.fold_left
+ (fun (cont, dom) (name, typ) ->
+ (CicNotationUtil.cic_name_of_name name :: cont,
+ (match typ with
+ | None -> dom
+ | Some typ -> dom @ domain_of_term ~loc ~context:cont typ)))
+ (context, []) args
+ in
+ domain_of_term ~loc ~context:term_context term @ args_domain
+ | Ast.Wildcard, term ->
+ domain_of_term ~loc ~context term