]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCicReduction.ml
...
[helm.git] / helm / software / components / ng_kernel / nCicReduction.ml
index a7dfc50fad582819e0a62a2d97c076e8b51d9db9..6105dd3a08c68739c3a0e208c19923c38bd86a09 100644 (file)
@@ -114,7 +114,9 @@ module Reduction(RS : Strategy) = struct
          aux (k, e, he, tl' @ s)
      | (_, _, C.Const
             (Ref.Ref (_,Ref.Def height) as refer), s) as config ->
-         if delta >= height then config, false else 
+         if delta >= height then 
+           config, false
+         else 
            let _,_,body,_,_,_ = NCicEnvironment.get_checked_def refer in
            aux (0, [], body, s) 
      | (_, _, C.Const (Ref.Ref (_,
@@ -154,18 +156,20 @@ module Reduction(RS : Strategy) = struct
              c
           | config -> config
         in
-        (match decofix (fst (reduce ~delta:0 ~subst context (k,e,term,[]))) with
+        let match_head = k,e,term,[] in
+        let reduced,_ = reduce ~delta:0 ~subst context match_head in
+        (match decofix reduced with
         | (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,_))),[]) ->
             aux (k, e, List.nth pl (j-1), s)
         | (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,lno))), s')->
           let _,params = HExtlib.split_nth lno s' in
           aux (k, e, List.nth pl (j-1), params@s)
-        | _ -> config,true)
+        | _ -> config, true)
    in
     aux
   ;;
 
-  let whd ?(delta=0) ?(subst=[]) context t = 
+  let whd ?(delta=0) ~subst context t = 
    unwind (fst (reduce ~delta ~subst context (0, [], t, [])))
   ;;