(*CSC: siamo nel contesto errato. Metto il try, ma che schifo!!!! *)
(*CSC: Anche perche' cosi' catturo anche quelle del replace che non dovrei *)
try
- let terms' = List.map (reduction context) terms in
+ let terms, terms' =
+ List.split
+ (List.map
+ (fun i, t -> t,
+ (let x, _, _ = CicMetaSubst.delift_rels [] metasenv i t in
+ let t' = reduction context x in
+ CicSubstitution.lift i t'))
+ terms)
+ in
ProofEngineReduction.replace ~equality:(==) ~what:terms ~with_what:terms'
~where:where
- with
- _ -> where
+ (* FIXME this is a catch ALL... bad thing *)
+ with exc -> (*prerr_endline (Printexc.to_string exc);*) where
in
let find_pattern_for name =
try Some (snd(List.find (fun (n, pat) -> Cic.Name n = name) hyp_patterns))
in
let ty' =
match goal_pattern with
- | None -> replace context ty [ty]
+ | None -> replace context ty [0,ty]
| Some pat ->
let terms = CicUtil.select ~term:ty ~context:pat in
- let terms = List.map snd terms in
replace context ty terms
in
let context' =
| None -> entry::context
| Some pat ->
let terms = CicUtil.select ~term ~context:pat in
- let terms = List.map snd terms in
let where = replace context term terms in
let entry = Some (name,Cic.Decl where) in
entry::context)
| None -> entry::context
| Some pat ->
let terms = CicUtil.select ~term ~context:pat in
- let terms = List.map snd terms in
let where = replace context term terms in
let entry = Some (name,Cic.Def (where,None)) in
entry::context)