From 6e8c7b9234ff7092008384b5e41782eac173aa05 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Mon, 27 Jun 2005 12:24:31 +0000 Subject: [PATCH] More tactics or tactic arguments made available to matita and a bit of code cleanup. --- .../cic_disambiguation/cicTextualParser2.ml | 37 +++++++++++-------- helm/ocaml/cic_transformations/tacticAst.ml | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 19d5c5b14..9443a35d1 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -346,9 +346,11 @@ EXTEND TacticAst.Apply (loc, t) | IDENT "assumption" -> TacticAst.Assumption loc - | IDENT "auto"; num = OPT [ i = NUM -> int_of_string i ] -> - TacticAst.Auto (loc,num) - | IDENT "change"; t1 = tactic_term; "with"; t2 = tactic_term; + | IDENT "auto"; + depth = OPT [ IDENT "depth"; SYMBOL "="; i = NUM -> int_of_string i ]; + width = OPT [ IDENT "depth"; SYMBOL "="; i = NUM -> int_of_string i ] -> + TacticAst.Auto (loc,depth,width) + | IDENT "change"; t1 = tactic_term; "with"; t2 = tactic_term; "in"; where = pattern_spec -> TacticAst.Change (loc, t1, t2, where) | IDENT "compare"; t = tactic_term -> @@ -365,11 +367,11 @@ EXTEND TacticAst.Decompose (loc, where) | IDENT "discriminate"; t = tactic_term -> TacticAst.Discriminate (loc, t) - | IDENT "elimType"; t = tactic_term -> - TacticAst.ElimType (loc, t) | IDENT "elim"; t1 = tactic_term; using = OPT [ "using"; using = tactic_term -> using ] -> TacticAst.Elim (loc, t1, using) + | IDENT "elimType"; t = tactic_term -> + TacticAst.ElimType (loc, t) | IDENT "exact"; t = tactic_term -> TacticAst.Exact (loc, t) | IDENT "exists" -> @@ -378,6 +380,11 @@ EXTEND TacticAst.Fold (loc, kind, t) | IDENT "fourier" -> TacticAst.Fourier loc + | IDENT "fwd"; t = term -> + TacticAst.FwdSimpl (loc, t) + | IDENT "generalize"; t = tactic_term; p = OPT [ pattern_spec ] -> + let p = match p with None -> [], None | Some p -> p in + TacticAst.Generalize (loc,t,p) | IDENT "goal"; n = NUM -> TacticAst.Goal (loc, int_of_string n) | IDENT "injection"; t = term -> @@ -388,15 +395,15 @@ EXTEND | IDENT "intro"; ident = OPT IDENT -> let idents = match ident with None -> [] | Some id -> [id] in TacticAst.Intros (loc, Some 1, idents) + | IDENT "lapply"; what = tactic_term; + to_what = OPT [ "to" ; t = tactic_term -> t ] -> + TacticAst.LApply (loc, to_what, what) | IDENT "left" -> TacticAst.Left loc | IDENT "letin"; where = IDENT ; SYMBOL <:unicode> ; t = tactic_term -> TacticAst.LetIn (loc, t, where) | kind = reduction_kind; p = OPT [ pattern_spec ] -> let p = match p with None -> [], None | Some p -> p in TacticAst.Reduce (loc, kind, p) - | IDENT "generalize"; t = tactic_term; p = OPT [ pattern_spec ] -> - let p = match p with None -> [], None | Some p -> p in - TacticAst.Generalize (loc,t,p) | IDENT "reflexivity" -> TacticAst.Reflexivity loc | IDENT "replace"; t1 = tactic_term; "with"; t2 = tactic_term -> @@ -404,18 +411,16 @@ EXTEND | IDENT "rewrite" ; d = direction; t = term ; p = OPT [ pattern_spec ] -> let p = match p with None -> [], None | Some p -> p in TacticAst.Rewrite (loc, d, t, p) - | IDENT "right" -> TacticAst.Right loc - | IDENT "ring" -> TacticAst.Ring loc - | IDENT "split" -> TacticAst.Split loc + | IDENT "right" -> + TacticAst.Right loc + | IDENT "ring" -> + TacticAst.Ring loc + | IDENT "split" -> + TacticAst.Split loc | IDENT "symmetry" -> TacticAst.Symmetry loc | IDENT "transitivity"; t = tactic_term -> TacticAst.Transitivity (loc, t) - | IDENT "fwd"; t = term -> - TacticAst.FwdSimpl (loc, t) - | IDENT "lapply"; what = tactic_term; - to_what = OPT [ "to" ; t = tactic_term -> t ] -> - TacticAst.LApply (loc, to_what, what) ] ]; tactical: diff --git a/helm/ocaml/cic_transformations/tacticAst.ml b/helm/ocaml/cic_transformations/tacticAst.ml index 63314d96f..8983490ea 100644 --- a/helm/ocaml/cic_transformations/tacticAst.ml +++ b/helm/ocaml/cic_transformations/tacticAst.ml @@ -34,8 +34,8 @@ type ('term, 'ident) pattern = type ('term, 'ident) tactic = | Absurd of loc * 'term | Apply of loc * 'term - | Auto of loc * int option | Assumption of loc + | Auto of loc * int option * int option (* depth, width *) | Change of loc * 'term * 'term * ('term,'ident) pattern (* what, with what, where *) | Compare of loc * 'term | Constructor of loc * int -- 2.39.2