]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/extlib/hExtlib.ml
Final implementation of proof irrelevant conversion, which hadn't
[helm.git] / helm / software / components / extlib / hExtlib.ml
index 6af86f9cd4d4ac0b620d004976ea6a83fc951a6e..e2063e451a692ccb25fa045de3f88b21c726a499 100644 (file)
@@ -164,6 +164,23 @@ let rec list_forall_default3 f l1 l2 def l3 =
     | a::ta, b::tb, [] -> f a b def && list_forall_default3 f ta tb def [] 
 ;;
 
+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
+;;
+
 let sharing_map f l =
   let unchanged = ref true in
   let rec aux b = function