X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2FproofEngineHelpers.mli;h=219d426e475b04f12d00cba5b060fabf9117251d;hb=b8ac0d11d5cd4083838a3848fce68683a518b54a;hp=5a4f145f995a07c1130f0b05460178fa2dd59f60;hpb=7b922ad1f9832c1edb3acea8f0c910fa2c0c20e5;p=helm.git diff --git a/helm/ocaml/tactics/proofEngineHelpers.mli b/helm/ocaml/tactics/proofEngineHelpers.mli index 5a4f145f9..219d426e4 100644 --- a/helm/ocaml/tactics/proofEngineHelpers.mli +++ b/helm/ocaml/tactics/proofEngineHelpers.mli @@ -23,6 +23,8 @@ * http://cs.unibo.it/helm/. *) +exception Bad_pattern of string + (* Returns the first meta whose number is above the *) (* number of the higher meta. *) val new_meta_of_proof : proof:ProofEngineTypes.proof -> int @@ -35,3 +37,43 @@ val subst_meta_and_metasenv_in_proof : ProofEngineTypes.proof -> int -> (Cic.term -> Cic.term) -> Cic.metasenv -> ProofEngineTypes.proof * Cic.metasenv + +(* returns the list of goals that are in newmetasenv and were not in + oldmetasenv *) +val compare_metasenvs : + oldmetasenv:Cic.metasenv -> newmetasenv:Cic.metasenv -> int list + + +(** { Patterns } + * A pattern is a Cic term in which Cic.Implicit terms annotated with `Hole + * appears *) + +(** create a pattern from a term and a list of subterms. +* the pattern is granted to have a ? for every subterm that has no selected +* subterms +* @param equality equality function used while walking the term. Defaults to +* physical equality (==) *) +val pattern_of: + ?equality:(Cic.term -> Cic.term -> bool) -> term:Cic.term -> Cic.term list -> + Cic.term + + +(** select metasenv conjecture pattern +* select all subterms of [conjecture] matching [pattern]. +* It returns the set of matched terms (that can be compared using physical +* equality to the subterms of [conjecture]) together with their contexts. +* The representation of the set mimics the conjecture type (but for the id): +* a list of (possibly removed) hypothesis (without their names) together with +* the list of its matched subterms (and their contexts) + the list of matched +* subterms of the conclusion with their context. Note: in the result the list +* of hypotheses * has an entry for each entry in the context and in the same +* order. Of course the list of terms (with their context) associated to one +* hypothesis may be empty. *) +val select: + metasenv:Cic.metasenv -> + conjecture:Cic.conjecture -> + pattern:ProofEngineTypes.pattern -> + [ `Decl of (Cic.context * Cic.term) list + | `Def of (Cic.context * Cic.term) list * (Cic.context * Cic.term) list option + ] option list * + (Cic.context * Cic.term) list