2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department, University of Bologna, Italy.
6 ||T|| HELM is free software; you can redistribute it and/or
7 ||A|| modify it under the terms of the GNU General Public License
8 \ / version 2 or (at your option) any later version.
9 \ / This software is distributed as is, NO WARRANTY.
10 V_______________________________________________________________ *)
12 (* $Id: orderings.ml 9869 2009-06-11 22:52:38Z denes $ *)
14 let nparamod rdb metasenv subst context t table =
17 let metasenv = metasenv
22 let module B : Orderings.Blob
23 with type t = NCic.term and type input = NCic.term
24 = Orderings.LPO(NCicBlob.NCicBlob(C))
26 let module P = Paramod.Paramod(B) in
27 let module Pp = Pp.Pp(B) in
28 let bag, maxvar = Terms.empty_bag, 0 in
29 let (bag,maxvar), goals =
30 HExtlib.list_mapi_acc (fun x _ a -> P.mk_goal a x) (bag,maxvar) [t]
32 let (bag,maxvar), passives =
33 HExtlib.list_mapi_acc (fun x _ a -> P.mk_passive a x) (bag,maxvar) table
36 P.paramod ~useage:true ~max_steps:max_int ~timeout:(Unix.gettimeofday () +. 300.0)
37 ~g_passives:goals ~passives (bag,maxvar)
39 | P.Error _ | P.GaveUp | P.Timeout _ -> []
40 | P.Unsatisfiable solutions ->
43 (* List.iter (fun x ->
44 print_endline (Pp.pp_unit_clause ~margin:max_int
45 (fst(Terms.M.find x bag)))) l; *)
46 let stamp = Unix.gettimeofday () in
47 let proofterm = NCicProof.mk_proof bag i l in
48 prerr_endline (Printf.sprintf "Got proof term in %fs"
49 (Unix.gettimeofday() -. stamp));
50 let metasenv, proofterm =
51 let rec aux k metasenv = function
52 | NCic.Meta _ as t -> metasenv, t
54 let metasenv,i,_,_=NCicMetaSubst.mk_meta metasenv context `Term in
55 metasenv, NCic.Meta (i,(k,NCic.Irl (List.length context)))
56 | t -> NCicUntrusted.map_term_fold_a
57 (fun _ k -> k+1) k aux metasenv t
59 aux 0 metasenv proofterm
61 let metasenv, subst, proofterm, _prooftype =
63 (rdb#set_coerc_db NCicCoercion.empty_db)
64 metasenv subst context proofterm None
66 proofterm, metasenv, subst)