]> matita.cs.unibo.it Git - helm.git/commitdiff
Bug fixed: projection redexes obtained reducing other projection redexes were
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 3 Feb 2010 15:41:02 +0000 (15:41 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 3 Feb 2010 15:41:02 +0000 (15:41 +0000)
not reduced.

helm/software/components/ng_kernel/nCicUntrusted.ml

index 1d8f6c49e3527ceccacc3a32a2952d7bd2252ec0..524a00cd35f73cdd4477b8e3191f30ceff7bca31 100644 (file)
@@ -175,21 +175,23 @@ let rec fire_projection_redex on_args = function
       in
       if pragma <> `Projection || List.length args <= rno then conclude ()
       else
-        (match List.nth args rno with
+        (match List.nth l (rno+1) with
         | C.Appl (C.Const(Ref.Ref(_,Ref.Con _))::_) ->
             let _, _, _, _, fbody = List.nth ifl fno in (* fbody is closed! *)
-            let t = C.Appl (fbody::args) in
+            let t = C.Appl (fbody::List.tl l) in
             (match NCicReduction.head_beta_reduce ~delta:max_int t with
-            | C.Match (_,_,C.Appl(C.Const(Ref.Ref(_,Ref.Con (_,_,leftno)))::kargs),[pat])->
+             | C.Match (_,_, C.Appl(C.Const(Ref.Ref(_,Ref.Con (_,_,leftno)))
+                ::kargs),[pat])->
                   let _,kargs = HExtlib.split_nth leftno kargs in
-        fire_projection_redex false 
-                  (NCicReduction.head_beta_reduce 
-                    ~delta:max_int (C.Appl (pat :: kargs)))
-            | C.Appl(C.Match(_,_,C.Appl(C.Const(Ref.Ref(_,Ref.Con (_,_,leftno)))::kargs),[pat]) :: args) ->
+                   fire_projection_redex false 
+                    (NCicReduction.head_beta_reduce 
+                      ~delta:max_int (C.Appl (pat :: kargs)))
+            | C.Appl(C.Match(_,_,C.Appl(C.Const(Ref.Ref(_,Ref.Con (_,_,leftno)))
+               ::kargs),[pat]) :: args) ->
                   let _,kargs = HExtlib.split_nth leftno kargs in
-        fire_projection_redex false 
-                  (NCicReduction.head_beta_reduce 
-                    ~delta:max_int (C.Appl (pat :: kargs @ args)))
+                   fire_projection_redex false 
+                    (NCicReduction.head_beta_reduce 
+                      ~delta:max_int (C.Appl (pat :: kargs @ args)))
             | _ -> conclude ()) 
         | _ -> conclude ())
   | t when on_args -> NCicUtils.map (fun _ x -> x) true fire_projection_redex t