X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2FnCicParamod.ml;fp=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2FnCicParamod.ml;h=ff34709e9c7a262453de6a124ba6e641919b11b6;hb=38c54dd8e2234836d5f3e8011c478daf7d59fa25;hp=8c740a0e4605c5d282ff89270b6f1134587553f2;hpb=8a3045a162622e8a76ffdb267309faff496ee7ec;p=helm.git diff --git a/helm/software/components/ng_paramodulation/nCicParamod.ml b/helm/software/components/ng_paramodulation/nCicParamod.ml index 8c740a0e4..ff34709e9 100644 --- a/helm/software/components/ng_paramodulation/nCicParamod.ml +++ b/helm/software/components/ng_paramodulation/nCicParamod.ml @@ -11,7 +11,7 @@ (* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *) -let nparamod rdb metasenv subst context t table = +let nparamod rdb metasenv subst context (g_t,g_ty) table = let module C = struct let metasenv = metasenv @@ -20,21 +20,49 @@ let nparamod rdb metasenv subst context t table = end in let module B : Orderings.Blob - with type t = NCic.term and type input = NCic.term + with type t = NCic.term = Orderings.NRKBO(NCicBlob.NCicBlob(C)) in let module P = Paramod.Paramod(B) in let module Pp = Pp.Pp(B) in - let bag, maxvar = Terms.empty_bag, 0 in - let (bag,maxvar), passives = + + let rec embed = function + | NCic.Meta (i,_) -> Terms.Var i, [i] + | NCic.Appl l -> + let rec aux acc l = function + |[] -> acc@l + |hd::tl -> if List.mem hd l then aux acc l tl else aux (hd::acc) l tl + in + let res,vars = List.fold_left + (fun (r,v) t -> let r1,v1 = embed t in (r1::r),aux [] v v1) ([],[]) l + in (Terms.Node (List.rev res)), vars + | t -> Terms.Leaf t, [] + in + + let embed t = fst (embed t) in + + let saturate ~is_goal t ty = + let sty, _, args = + NCicMetaSubst.saturate ~delta:max_int C.metasenv C.subst C.context ty 0 + in + let proof = + if args = [] then Terms.Leaf t + else Terms.Node (Terms.Leaf t :: List.map embed args) + in + let sty = embed sty in + proof, if is_goal then [sty],[] else [],[sty] + in + let goal = saturate ~is_goal:true g_t g_ty in + let hypotheses = List.map (fun (t,ty) -> saturate ~is_goal:false t ty) table in + (*let (bag,maxvar), passives = HExtlib.list_mapi_acc (fun x _ a -> P.mk_passive a x) (bag,maxvar) table in let (bag,maxvar), goals = HExtlib.list_mapi_acc (fun x _ a -> P.mk_goal a x) (bag,maxvar) [t] - in + in*) match - P.paramod ~useage:true ~max_steps:max_int ~timeout:(Unix.gettimeofday () +. 300.0) - ~g_passives:goals ~passives (bag,maxvar) + P.paramod ~useage:true ~max_steps:max_int ~print_problem:true + goal hypotheses with | P.Error _ | P.GaveUp | P.Timeout _ -> [] | P.Unsatisfiable solutions ->