+
+ | (C.Appl ((C.Const r1) as hd1::tl1), C.Appl (C.Const r2::tl2))
+ when (Ref.eq r1 r2 &&
+ List.length (E.get_relevance r1) >= List.length tl1) ->
+ let relevance = E.get_relevance r1 in
+ let relevance = match r1 with
+ | Ref.Ref (_,Ref.Con (_,_,lno)) ->
+ let _,relevance = HExtlib.split_nth "NR 2" lno relevance in
+ HExtlib.mk_list false lno @ relevance
+ | _ -> relevance
+ in
+ (try
+ HExtlib.list_forall_default3_var
+ (fun t1 t2 b -> not b || aux true context t1 t2 )
+ tl1 tl2 true relevance
+ with Invalid_argument _ -> false
+ | HExtlib.FailureAt fail ->
+ let relevance =
+ !get_relevance ~metasenv ~subst context hd1 tl1 in
+ let _,relevance = HExtlib.split_nth "NR 3" fail relevance in
+ let b,relevance = (match relevance with
+ | [] -> assert false
+ | b::tl -> b,tl) in
+ if (not b) then
+ let _,tl1 = HExtlib.split_nth "NR 4" (fail+1) tl1 in
+ let _,tl2 = HExtlib.split_nth "NR 5" (fail+1) tl2 in
+ try
+ HExtlib.list_forall_default3
+ (fun t1 t2 b -> not b || aux true context t1 t2)
+ tl1 tl2 true relevance
+ with Invalid_argument _ -> false
+ else false)