* http://cs.unibo.it/helm/.
*)
+(* TODO unify exceptions *)
+
exception CicReductionInternalError;;
exception WrongUriToInductiveDefinition;;
exception Impossible of int;;
match List.nth context (n - 1 - k) with
None -> assert false
| Some (_,C.Decl _) -> None
- | Some (_,C.Def x) -> Some (S.lift (n - k) x)
+ | Some (_,C.Def (x,_)) -> Some (S.lift (n - k) x)
end
with
_ -> None
| (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
module R = Reduction
ClosuresOnStackByValueFromEnvOrEnsByNameOnConstantsStrategy;;
*)
-module R = Reduction ClosuresOnStackByValueFromEnvOrEnsStrategy;;
+module R = Reduction(ClosuresOnStackByValueFromEnvOrEnsStrategy);;
let whd = R.whd;;
) 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)) ->
- aux context s1 s2 && aux ((Some (name1, (C.Decl s1)))::context) t1 t2
+ aux context s1 s2 &&
+ aux ((Some (name1, (C.Decl s1)))::context) t1 t2
| (C.Lambda (name1,s1,t1), C.Lambda(_,s2,t2)) ->
- aux context s1 s2 && aux ((Some (name1, (C.Decl s1)))::context) t1 t2
+ aux context s1 s2 &&
+ aux ((Some (name1, (C.Decl s1)))::context) t1 t2
| (C.LetIn (name1,s1,t1), C.LetIn(_,s2,t2)) ->
- aux context s1 s2 && aux ((Some (name1, (C.Def s1)))::context) t1 t2
+ aux context s1 s2 &&
+ aux ((Some (name1, (C.Def (s1,None))))::context) t1 t2
| (C.Appl l1, C.Appl l2) ->
(try
List.fold_right2 (fun x y b -> aux context x y && b) l1 l2 true
fl1 fl2 true
| (C.Cast _, _) | (_, C.Cast _)
| (C.Implicit, _) | (_, C.Implicit) ->
- raise (Impossible 3) (* we don't trust our whd ;-) *)
+ assert false
| (_,_) -> false
end
in