) (subst,metasenv,ugraph,[]) patterns
in
subst,metasenv,ugraph,resoutty @ resindterm @ respatterns
-(*CSC: c'e' ancora un problema: il caso vs Meta puo' alterare il goal ==>
- bisogna ricominciare da capo sul nuovo goal per preservare i puntatori
- fisici
| Cic.Fix (_, funl) ->
let tys =
List.map (fun (n,_,ty,_) -> Some (Cic.Name n,(Cic.Decl ty))) funl
in
List.fold_left (
- fun acc (_, _, ty, bo) ->
- find context w ty @ find (tys @ context) w bo @ acc
- ) [] funl
+ fun (subst,metasenv,ugraph,acc) (_, _, ty, bo) ->
+ let subst,metasenv,ugraph,resty =
+ find subst metasenv ugraph context w ty in
+ let subst,metasenv,ugraph,resbo =
+ find subst metasenv ugraph (tys @ context) w bo
+ in
+ subst,metasenv,ugraph, resty @ resbo @ acc
+ ) (subst,metasenv,ugraph,[]) funl
| Cic.CoFix (_, funl) ->
let tys =
List.map (fun (n,ty,_) -> Some (Cic.Name n,(Cic.Decl ty))) funl
in
List.fold_left (
- fun acc (_, ty, bo) ->
- find context w ty @ find (tys @ context) w bo @ acc
- ) [] funl
-*)
+ fun (subst,metasenv,ugraph,acc) (_, ty, bo) ->
+ let subst,metasenv,ugraph,resty =
+ find subst metasenv ugraph context w ty in
+ let subst,metasenv,ugraph,resbo =
+ find subst metasenv ugraph (tys @ context) w bo
+ in
+ subst,metasenv,ugraph, resty @ resbo @ acc
+ ) (subst,metasenv,ugraph,[]) funl
in
find subst metasenv ugraph context wanted t