X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_notation%2FcicNotationFwd.ml;h=4f17e80496c9a9b44831e4fec56d8754170e2309;hb=95977594b05ba0320784a445d480b3fe11ef4e55;hp=8e955c0b10a8d562647833d501477c3aa87a28ff;hpb=c27b932e5adcf89dc9de0e28f65e3370fe3e6b05;p=helm.git diff --git a/helm/ocaml/cic_notation/cicNotationFwd.ml b/helm/ocaml/cic_notation/cicNotationFwd.ml index 8e955c0b1..4f17e8049 100644 --- a/helm/ocaml/cic_notation/cicNotationFwd.ml +++ b/helm/ocaml/cic_notation/cicNotationFwd.ml @@ -23,6 +23,8 @@ * http://helm.cs.unibo.it/ *) +open Printf + open CicNotationEnv open CicNotationPt @@ -240,9 +242,25 @@ let instantiate_level2 env term = | _ -> assert false in instantiate_fold_right env) - | If (_, p_true, p_false) as t -> aux env (CicNotationUtil.find_branch (Magic t)) + | If (_, p_true, p_false) as t -> + aux env (CicNotationUtil.find_branch (Magic t)) | Fail -> assert false | _ -> assert false in aux env term +let instantiate_appl_pattern env appl_pattern = + let lookup name = + try List.assoc name env + with Not_found -> + prerr_endline (sprintf "Name %s not found" name); + assert false + in + let rec aux = function + | UriPattern uri -> CicUtil.term_of_uri uri + | ImplicitPattern -> Cic.Implicit None + | VarPattern name -> lookup name + | ApplPattern terms -> Cic.Appl (List.map aux terms) + in + aux appl_pattern +