exception CicReductionInternalError;;
exception WrongUriToInductiveDefinition;;
exception Impossible of int;;
exception CicReductionInternalError;;
exception WrongUriToInductiveDefinition;;
exception Impossible of int;;
CicPp.ppobj (C.Variable ("DEBUG", None, t, [])) ^ "\n" ^ i
in
if !fdebug = 0 then
CicPp.ppobj (C.Variable ("DEBUG", None, t, [])) ^ "\n" ^ i
in
if !fdebug = 0 then
| C.Cast (te,ty) -> C.Cast (unwind_aux m te, unwind_aux m ty) (*CSC ???*)
| C.Prod (n,s,t) -> C.Prod (n, unwind_aux m s, unwind_aux (m + 1) t)
| C.Lambda (n,s,t) -> C.Lambda (n, unwind_aux m s, unwind_aux (m + 1) t)
| C.Cast (te,ty) -> C.Cast (unwind_aux m te, unwind_aux m ty) (*CSC ???*)
| C.Prod (n,s,t) -> C.Prod (n, unwind_aux m s, unwind_aux (m + 1) t)
| C.Lambda (n,s,t) -> C.Lambda (n, unwind_aux m s, unwind_aux (m + 1) t)
match List.nth context (n - 1 - k) with
None -> assert false
| Some (_,C.Decl _) -> None
match List.nth context (n - 1 - k) with
None -> assert false
| Some (_,C.Decl _) -> None
let t' = unwind k e ens t in
if s = [] then t' else C.Appl (t'::(RS.from_stack_list ~unwind s))
| (k, e, _, (C.Sort _ as t), s) -> t (* s should be empty *)
let t' = unwind k e ens t in
if s = [] then t' else C.Appl (t'::(RS.from_stack_list ~unwind s))
| (k, e, _, (C.Sort _ as t), s) -> t (* s should be empty *)
- | (k, e, _, (C.Implicit as t), s) -> t (* s should be empty *)
+ | (k, e, _, (C.Implicit _ as t), s) -> t (* s should be empty *)
| (k, e, ens, (C.Cast (te,ty) as t), s) ->
reduce (k, e, ens, te, s) (* s should be empty *)
| (k, e, ens, (C.Prod _ as t), s) ->
| (k, e, ens, (C.Cast (te,ty) as t), s) ->
reduce (k, e, ens, te, s) (* s should be empty *)
| (k, e, ens, (C.Prod _ as t), s) ->
| (k, e, ens, (C.LetIn (_,m,t) as t'), s) ->
let m' = RS.compute_to_env ~reduce ~unwind k e ens m in
reduce (k+1, m'::e, ens, t, s)
| (k, e, ens, (C.LetIn (_,m,t) as t'), s) ->
let m' = RS.compute_to_env ~reduce ~unwind k e ens m in
reduce (k+1, m'::e, ens, t, s)
- | (_, _, _, C.Appl [], _) -> raise (Impossible 1)
+ | (_, _, _, C.Appl [], _) -> assert false
| (k, e, ens, C.Appl (he::tl), s) ->
let tl' =
List.map
| (k, e, ens, C.Appl (he::tl), s) ->
let tl' =
List.map
in
(* ts are already unwinded because they are a sublist of tl *)
reduce (k, e, ens, (List.nth pl (j-1)), (RS.to_stack_list ts)@s)
in
(* ts are already unwinded because they are a sublist of tl *)
reduce (k, e, ens, (List.nth pl (j-1)), (RS.to_stack_list ts)@s)
) true l1 l2
| (C.Sort s1, C.Sort s2) -> true (*CSC da finire con gli universi *)
| (C.Prod (name1,s1,t1), C.Prod(_,s2,t2)) ->
) true l1 l2
| (C.Sort s1, C.Sort s2) -> true (*CSC da finire con gli universi *)
| (C.Prod (name1,s1,t1), C.Prod(_,s2,t2)) ->
| (C.Lambda (name1,s1,t1), C.Lambda(_,s2,t2)) ->
| (C.Lambda (name1,s1,t1), C.Lambda(_,s2,t2)) ->
| (C.LetIn (name1,s1,t1), C.LetIn(_,s2,t2)) ->
| (C.LetIn (name1,s1,t1), C.LetIn(_,s2,t2)) ->
| (C.Appl l1, C.Appl l2) ->
(try
List.fold_right2 (fun x y b -> aux context x y && b) l1 l2 true
| (C.Appl l1, C.Appl l2) ->
(try
List.fold_right2 (fun x y b -> aux context x y && b) l1 l2 true
b && aux context ty1 ty2 && aux (tys@context) bo1 bo2)
fl1 fl2 true
| (C.Cast _, _) | (_, C.Cast _)
b && aux context ty1 ty2 && aux (tys@context) bo1 bo2)
fl1 fl2 true
| (C.Cast _, _) | (_, C.Cast _)
- | (C.Implicit, _) | (_, C.Implicit) ->
- raise (Impossible 3) (* we don't trust our whd ;-) *)
+ | (C.Implicit _, _) | (_, C.Implicit _) ->
+ assert false