From b8fbccc3b4e92586d5fc704d2d8ca27fdc729adf Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 3 May 2005 12:50:34 +0000 Subject: [PATCH] added instance --- helm/matita/matitaScript.ml | 17 ++++++++++++- helm/ocaml/cic_disambiguation/.depend | 24 +++++++++---------- .../cic_disambiguation/cicTextualParser2.ml | 1 + 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/helm/matita/matitaScript.ml b/helm/matita/matitaScript.ml index 5abba5207..c64653c79 100644 --- a/helm/matita/matitaScript.ml +++ b/helm/matita/matitaScript.ml @@ -117,7 +117,22 @@ let eval_statement status mathviewer user_goal s = in List.iter prerr_endline (MetadataQuery.match_term ~dbd:dbd term); assert false; - + | TacticAst.Instance (_,term) -> + let dbd = MatitaDb.instance () in + let metasenv = MatitaMisc.get_proof_metasenv status in + let context = MatitaMisc.get_proof_context status in + let aliases = MatitaMisc.get_proof_aliases status in + let (_env,_metasenv,term,_graph) = + let interps = + MatitaDisambiguator.disambiguate_term dbd context metasenv aliases term + in + match interps with + | [x] -> x + | _ -> assert false + in + List.iter prerr_endline (MetadataQuery.instance ~dbd term); + assert false + | TacticAst.Check (_,t) -> let metasenv = MatitaMisc.get_proof_metasenv status in let context = MatitaMisc.get_proof_context status in diff --git a/helm/ocaml/cic_disambiguation/.depend b/helm/ocaml/cic_disambiguation/.depend index eeb856c66..e70fbb34f 100644 --- a/helm/ocaml/cic_disambiguation/.depend +++ b/helm/ocaml/cic_disambiguation/.depend @@ -7,17 +7,17 @@ disambiguateChoices.cmo: disambiguateTypes.cmi disambiguateChoices.cmi disambiguateChoices.cmx: disambiguateTypes.cmx disambiguateChoices.cmi cicTextualLexer2.cmo: cicTextualLexer2.cmi cicTextualLexer2.cmx: cicTextualLexer2.cmi -cicTextualParser2.cmo: cicTextualLexer2.cmi disambiguateChoices.cmi \ - disambiguateTypes.cmi cicTextualParser2.cmi -cicTextualParser2.cmx: cicTextualLexer2.cmx disambiguateChoices.cmx \ - disambiguateTypes.cmx cicTextualParser2.cmi -disambiguate.cmo: cicTextualParser2.cmi disambiguateChoices.cmi \ - disambiguateTypes.cmi disambiguate.cmi -disambiguate.cmx: cicTextualParser2.cmx disambiguateChoices.cmx \ - disambiguateTypes.cmx disambiguate.cmi -logic_notation.cmo: cicTextualParser2.cmi disambiguateChoices.cmi -logic_notation.cmx: cicTextualParser2.cmx disambiguateChoices.cmx -arit_notation.cmo: cicTextualParser2.cmi disambiguateChoices.cmi -arit_notation.cmx: cicTextualParser2.cmx disambiguateChoices.cmx +cicTextualParser2.cmo: disambiguateTypes.cmi disambiguateChoices.cmi \ + cicTextualLexer2.cmi cicTextualParser2.cmi +cicTextualParser2.cmx: disambiguateTypes.cmx disambiguateChoices.cmx \ + cicTextualLexer2.cmx cicTextualParser2.cmi +disambiguate.cmo: disambiguateTypes.cmi disambiguateChoices.cmi \ + cicTextualParser2.cmi disambiguate.cmi +disambiguate.cmx: disambiguateTypes.cmx disambiguateChoices.cmx \ + cicTextualParser2.cmx disambiguate.cmi +logic_notation.cmo: disambiguateChoices.cmi cicTextualParser2.cmi +logic_notation.cmx: disambiguateChoices.cmx cicTextualParser2.cmx +arit_notation.cmo: disambiguateChoices.cmi cicTextualParser2.cmi +arit_notation.cmx: disambiguateChoices.cmx cicTextualParser2.cmx tex_notation.cmo: cicTextualParser2.cmi tex_notation.cmx: cicTextualParser2.cmx diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 34b3d01e0..e7506a15d 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -482,6 +482,7 @@ EXTEND TacticAst.Check (loc, t) | [ IDENT "hint" ] -> TacticAst.Hint loc | [ IDENT "pmatch" ] ; t = term -> TacticAst.Match (loc,t) + | [ IDENT "instance" ] ; t = term -> TacticAst.Instance (loc,t) | [ IDENT "print" ]; name = QSTRING -> TacticAst.Print (loc, name) ]]; -- 2.39.2