12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)openGoptionsmoduleDyn=Dyn.Make()moduleDMap=Dyn.Map(structtype'at='a->unitProofview.tacticend)letinterp_map=refDMap.emptytypeinterpretable=I:'aDyn.tag*'a->interpretabletype'atactic_interpreter=Interpreterof('a->interpretable)letregister_tactic_interpreternaf=lett=Dyn.createnaininterp_map:=DMap.addtf!interp_map;Interpreter(funx->I(t,x))letinterp_tac(I(tag,t))=letf=DMap.findtag!interp_mapinfttypeparallel_solver=pstate:Declare.Proof.t->info:intoption->interpretable->abstract:bool->with_end_tac:bool->Declare.Proof.tlet{Goptions.get=print_info_trace}=declare_intopt_option_and_ref~key:["Info";"Level"]~value:None()letsolve_core~pstaten~infot~with_end_tac:b=letpstate,status=Declare.Proof.map_fold_endline~f:(funetacp->letwith_end_tac=ifbthenSomeetacelseNoneinletinfo=Option.appendinfo(print_info_trace())inlet(p,status)=Proof.solveninfot?with_end_tacpin(* in case a strict subtree was completed,
go back to the top of the prooftree *)letp=Proof.maximal_unfocusVernacentries.command_focuspinp,status)pstateinifnotstatusthenFeedback.feedbackFeedback.AddedAxiom;pstateletsolve~pstaten~infot~with_end_tac=lett=interp_tactinsolve_core~pstaten~infot~with_end_tacletcheck_par_applicablepstate=Declare.Proof.foldpstate~f:(funp->(Proof.datap).Proof.goals|>List.iter(fungoal->letis_ground=let{Proof.sigma=sigma0}=Declare.Proof.foldpstate~f:Proof.datainletg=Evd.find_undefinedsigma0goalinletconcl,hyps=Evd.evar_conclg,Evd.evar_contextginEvarutil.is_ground_termsigma0concl&&List.for_all(Context.Named.Declaration.for_all(Evarutil.is_ground_termsigma0))hypsinifnotis_groundthenCErrors.user_errPp.(strbrk("The par: goal selector does not support goals with existential variables"))))letpar_implementation=ref(fun~pstate~infot~abstract~with_end_tac->lett=interp_tactinlett=Proofview.Goal.enter(fun_->ifabstractthenAbstract.tclABSTRACTNone~opaque:truetelset)insolve_core~pstateGoal_select.SelectAll~infot~with_end_tac)letset_par_implementationf=par_implementation:=fletsolve_parallel~pstate~infot~abstract~with_end_tac=check_par_applicablepstate;!par_implementation~pstate~infot~abstract~with_end_tac