(* ||M|| This file is part of HELM, an Hypertextual, Electronic ||A|| Library of Mathematics, developed at the Computer Science ||T|| Department, University of Bologna, Italy. ||I|| ||T|| HELM is free software; you can redistribute it and/or ||A|| modify it under the terms of the GNU General Public License \ / version 2 or (at your option) any later version. \ / This software is distributed as is, NO WARRANTY. V_______________________________________________________________ *) (* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *) open Printf let debug = false let debug_print s = if debug then prerr_endline (Lazy.force s) else () open Continuationals.Stack open NTacStatus module Ast = CicNotationPt (* =================================== paramod =========================== *) let auto_paramod ~params:(l,_) status goal = let gty = get_goalty status goal in let n,h,metasenv,subst,o = status#obj in let status,t = term_of_cic_term status gty (ctx_of gty) in let status, l = List.fold_left (fun (status, l) t -> let status, t = disambiguate status t None (ctx_of gty) in let status, ty = typeof status (ctx_of t) t in let status, t = term_of_cic_term status t (ctx_of gty) in let status, ty = term_of_cic_term status ty (ctx_of ty) in (status, (t,ty) :: l)) (status,[]) l in match NCicParamod.nparamod status metasenv subst (ctx_of gty) (NCic.Rel ~-1,t) l with | [] -> raise (NTacStatus.Error (lazy "no proof found",None)) | (pt, metasenv, subst)::_ -> let status = status#set_obj (n,h,metasenv,subst,o) in instantiate status goal (NTacStatus.mk_cic_term (ctx_of gty) pt) ;; let auto_paramod_tac ~params status = NTactics.distribute_tac (auto_paramod ~params) status ;; (* =================================== auto =========================== *) let auto_tac ~params status = prerr_endline "I teoremi noti sono"; NDiscriminationTree.DiscriminationTree.iter status#auto_cache (fun _ t -> List.iter (fun t -> prerr_endline (NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] t)) (NDiscriminationTree.TermSet.elements t)); status ;; (* ========================= dispatching of auto/auto_paramod ============ *) let auto_tac ~params:(_,flags as params) = if List.mem_assoc "paramodulation" flags then auto_paramod_tac ~params else auto_tac ~params ;; (* EOF *)