123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375(************************************************************************)(* * 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) *)(************************************************************************)openLocopenNamesopenConstrexpropenLibnamesopenGenredexpropenGenargopenPatternopenTactypesopenLocustypeltac_constant=KerName.ttypedirection_flag=bool(* true = Left-to-right false = right-to-right *)typelazy_flag=|General(* returns all possible successes *)|Select(* returns all successes of the first matching branch *)|Once(* returns the first success in a matching branch
(not necessarily the first) *)typeglobal_flag=(* [gfail] or [fail] *)|TacGlobal|TacLocaltypeevars_flag=bool(* true = pose evars false = fail on evars *)typerec_flag=bool(* true = recursive false = not recursive *)typeadvanced_flag=bool(* true = advanced false = basic *)typeletin_flag=bool(* true = use local def false = use Leibniz *)typeclear_flag=booloption(* true = clear hyp, false = keep hyp, None = use default *)typecheck_flag=bool(* true = check false = do not check *)type('c,'d,'id)inversion_strength=|NonDepInversionofInv.inversion_kind*'idlist*'dor_and_intro_pattern_exprCAst.tor_varoption|DepInversionofInv.inversion_kind*'coption*'dor_and_intro_pattern_exprCAst.tor_varoption|InversionUsingof'c*'idlisttype'idmessage_token=|MsgStringofstring|MsgIntofint|MsgIdentof'idtype('dconstr,'id)induction_clause='dconstrwith_bindingsTactics.destruction_arg*(Namegen.intro_pattern_naming_exprCAst.toption(* eqn:... *)*'dconstror_and_intro_pattern_exprCAst.tor_varoption)(* as ... *)*'idclause_exproption(* in ... *)type('constr,'dconstr,'id)induction_clause_list=('dconstr,'id)induction_clauselist*'constrwith_bindingsoption(* using ... *)type'awith_bindings_arg=clear_flag*'awith_bindings(* Type of patterns *)type'amatch_pattern=|Termof'a|SubtermofId.toption*'a(* Type of hypotheses for a Match Context rule *)type'amatch_context_hyps=|Hypoflname*'amatch_pattern|Defoflname*'amatch_pattern*'amatch_pattern(* Type of a Match rule for Match Context and Match *)type('a,'t)match_rule=|Patof'amatch_context_hypslist*'amatch_pattern*'t|Allof't(** Extension indentifiers for the TACTIC EXTEND mechanism. *)typeml_tactic_name={mltac_plugin:string;(** Name of the plugin where the tactic is defined, typically coming from a
DECLARE PLUGIN statement in the source. *)mltac_tactic:string;(** Name of the tactic entry where the tactic is defined, typically found
after the TACTIC EXTEND statement in the source. *)}typeml_tactic_entry={mltac_name:ml_tactic_name;mltac_index:int;}(** Composite types *)typeopen_constr_expr=unit*constr_exprtypeopen_glob_constr=unit*Genintern.glob_constr_and_exprtypeintro_pattern=delayed_open_constrintro_pattern_exprCAst.ttypeintro_patterns=delayed_open_constrintro_pattern_exprCAst.tlisttypeor_and_intro_pattern=delayed_open_constror_and_intro_pattern_exprCAst.ttypeintro_pattern_naming=Namegen.intro_pattern_naming_exprCAst.t(** Generic expressions for atomic tactics *)type'agen_atomic_tactic_expr=(* Basic tactics *)|TacIntroPatternofevars_flag*'dtrmintro_pattern_exprCAst.tlist|TacApplyofadvanced_flag*evars_flag*'trmwith_bindings_arglist*('nam*'dtrmintro_pattern_exprCAst.toption)list|TacElimofevars_flag*'trmwith_bindings_arg*'trmwith_bindingsoption|TacCaseofevars_flag*'trmwith_bindings_arg|TacMutualFixofId.t*int*(Id.t*int*'trm)list|TacMutualCofixofId.t*(Id.t*'trm)list|TacAssertofevars_flag*bool*'tacexproptionoption*'dtrmintro_pattern_exprCAst.toption*'trm|TacGeneralizeof('trmwith_occurrences*Name.t)list|TacLetTacofevars_flag*Name.t*'trm*'namclause_expr*letin_flag*Namegen.intro_pattern_naming_exprCAst.toption(* Derived basic tactics *)|TacInductionDestructofrec_flag*evars_flag*('trm,'dtrm,'nam)induction_clause_list(* Conversion *)|TacReduceof('trm,'cst,'pat)red_expr_gen*'namclause_expr|TacChangeofcheck_flag*'patoption*'dtrm*'namclause_expr(* Equality and inversion *)|TacRewriteofevars_flag*(bool*Equality.multi*'dtrmwith_bindings_arg)list*'namclause_expr*(* spiwack: using ['dtrm] here is a small hack, may not be
stable by a change in the representation of delayed
terms. Because, in fact, it is the whole "with_bindings"
which is delayed. But because the "t" level for ['dtrm] is
uninterpreted, it works fine here too, and avoid more
disruption of this file. *)'tacexproption|TacInversionof('trm,'dtrm,'nam)inversion_strength*quantified_hypothesisconstraint'a=<term:'trm;dterm:'dtrm;pattern:'pat;constant:'cst;reference:'ref;name:'nam;tacexpr:'tacexpr;level:'lev>(** Possible arguments of a tactic definition *)type'agen_tactic_arg=|TacGenericofstringoption*'levgeneric_argument|ConstrMayEvalof('trm,'cst,'pat)may_eval|Referenceof'ref|TacCallof('ref*'agen_tactic_arglist)CAst.t|TacFreshIdofstringor_varlist|Tacexpof'tacexpr|TacPretypeof'trm|TacNumgoalsconstraint'a=<term:'trm;dterm:'dtrm;pattern:'pat;constant:'cst;reference:'ref;name:'nam;tacexpr:'tacexpr;level:'lev>(** Generic ltac expressions.
't : terms, 'p : patterns, 'c : constants, 'i : inductive,
'r : ltac refs, 'n : idents, 'l : levels *)and'agen_tactic_expr_r=|TacAtomof'agen_atomic_tactic_expr|TacThenof'agen_tactic_expr*'agen_tactic_expr|TacDispatchof'agen_tactic_exprlist|TacExtendTacof'agen_tactic_exprarray*'agen_tactic_expr*'agen_tactic_exprarray|TacThensof'agen_tactic_expr*'agen_tactic_exprlist|TacThens3partsof'agen_tactic_expr*'agen_tactic_exprarray*'agen_tactic_expr*'agen_tactic_exprarray|TacFirstof'agen_tactic_exprlist|TacCompleteof'agen_tactic_expr|TacSolveof'agen_tactic_exprlist|TacTryof'agen_tactic_expr|TacOrof'agen_tactic_expr*'agen_tactic_expr|TacOnceof'agen_tactic_expr|TacExactlyOnceof'agen_tactic_expr|TacIfThenCatchof'agen_tactic_expr*'agen_tactic_expr*'agen_tactic_expr|TacOrelseof'agen_tactic_expr*'agen_tactic_expr|TacDoofintor_var*'agen_tactic_expr|TacTimeoutofintor_var*'agen_tactic_expr|TacTimeofstringoption*'agen_tactic_expr|TacRepeatof'agen_tactic_expr|TacProgressof'agen_tactic_expr|TacAbstractof'agen_tactic_expr*Id.toption|TacIdof'nmessage_tokenlist|TacFailofglobal_flag*intor_var*'nmessage_tokenlist|TacLetInofrec_flag*(lname*'agen_tactic_arg)list*'agen_tactic_expr|TacMatchoflazy_flag*'agen_tactic_expr*('p,'agen_tactic_expr)match_rulelist|TacMatchGoaloflazy_flag*direction_flag*('p,'agen_tactic_expr)match_rulelist|TacFunof'agen_tactic_fun_ast|TacArgof'agen_tactic_arg|TacSelectofGoal_select.t*'agen_tactic_expr(* For ML extensions *)|TacMLofml_tactic_entry*'agen_tactic_arglist(* For syntax extensions *)|TacAliasofKerName.t*'agen_tactic_arglistconstraint'a=<term:'t;dterm:'dtrm;pattern:'p;constant:'c;reference:'r;name:'n;tacexpr:'tacexpr;level:'l>and'agen_tactic_expr='agen_tactic_expr_rCAst.tconstraint'a=<term:'t;dterm:'dtrm;pattern:'p;constant:'c;reference:'r;name:'n;tacexpr:'tacexpr;level:'l>and'agen_tactic_fun_ast=Name.tlist*'agen_tactic_exprconstraint'a=<term:'t;dterm:'dtrm;pattern:'p;constant:'c;reference:'r;name:'n;tacexpr:'te;level:'l>(** Globalized tactics *)typeg_trm=Genintern.glob_constr_and_exprtypeg_pat=Genintern.glob_constr_pattern_and_exprtypeg_cst=Tacred.evaluable_global_referenceGenredexpr.and_short_nameor_vartypeg_ref=ltac_constantlocatedor_vartypeg_nam=lidenttypeg_dispatch=<term:g_trm;dterm:g_trm;pattern:g_pat;constant:g_cst;reference:g_ref;name:g_nam;tacexpr:glob_tactic_expr;level:glevel>andglob_tactic_expr=g_dispatchgen_tactic_exprtypeglob_atomic_tactic_expr=g_dispatchgen_atomic_tactic_exprtypeglob_tactic_arg=g_dispatchgen_tactic_arg(** Raw tactics *)typer_ref=qualidtyper_nam=lidenttyper_lev=rleveltyper_dispatch=<term:r_trm;dterm:r_trm;pattern:r_pat;constant:r_cst;reference:r_ref;name:r_nam;tacexpr:raw_tactic_expr;level:rlevel>andraw_tactic_expr=r_dispatchgen_tactic_exprtyperaw_atomic_tactic_expr=r_dispatchgen_atomic_tactic_exprtyperaw_tactic_arg=r_dispatchgen_tactic_arg(** Interpreted tactics *)typet_trm=EConstr.constrtypet_pat=constr_patterntypet_cst=Tacred.evaluable_global_referencetypet_ref=ltac_constantlocatedtypet_nam=Id.ttypet_dispatch=<term:t_trm;dterm:g_trm;pattern:t_pat;constant:t_cst;reference:t_ref;name:t_nam;tacexpr:unit;level:tlevel>typeatomic_tactic_expr=t_dispatchgen_atomic_tactic_expr(** Misc *)typeraw_red_expr=(r_trm,r_cst,r_pat)red_expr_gentypeglob_red_expr=(g_trm,g_cst,g_pat)red_expr_gen(** Traces *)typeltac_call_kind=|LtacMLCallofglob_tactic_expr|LtacNotationCallofKerName.t|LtacNameCallofltac_constant|LtacAtomCallofglob_atomic_tactic_expr|LtacVarCallofKerName.toption*Id.t*glob_tactic_expr|LtacConstrInterpofEnviron.env*Evd.evar_map*Glob_term.glob_constr*Ltac_pretype.ltac_var_maptypeltac_stack=ltac_call_kindLoc.locatedlisttypeltac_trace=ltac_stack*Geninterp.Val.tId.Map.tlisttypetacdef_body=|TacticDefinitionoflident*raw_tactic_expr(* indicates that user employed ':=' in Ltac body *)|TacticRedefinitionofqualid*raw_tactic_expr(* indicates that user employed '::=' in Ltac body *)