+exception FailureAt of int;;
+
+let list_forall_default3_var f l1 l2 def l3 =
+ let rec aux f l1 l2 def l3 i =
+ match l1,l2,l3 with
+ | [], [], _ -> true
+ | [], _, _
+ | _, [], _ -> raise (Invalid_argument "list_forall_default3")
+ | a::ta, b::tb, c::tc ->
+ if f a b c then aux f ta tb def tc (i+1)
+ else raise (FailureAt i)
+ | a::ta, b::tb, [] ->
+ if f a b def then aux f ta tb def [] (i+1)
+ else raise (FailureAt i)
+ in aux f l1 l2 def l3 0
+;;
+