From: Claudio Sacerdoti Coen Date: Thu, 23 Jun 2005 12:14:53 +0000 (+0000) Subject: 1 .Tactic generalize ported to patterns and activated in matita. X-Git-Tag: INDEXING_NO_PROOFS~97 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=6a9b5c500ba77d823730202fb9b0c5fcb5b269de;p=helm.git 1 .Tactic generalize ported to patterns and activated in matita. 2. new syntax for patterns: "in H0 [: ty] ; ... ; Hn [: ty] [\vdash ty]" where the list of hypotheses may be empty --- diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index a1fcc9205..086c30787 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -329,14 +329,14 @@ EXTEND | [ IDENT "normalize" ] -> `Normalize ] ]; pattern_spec: [ - [ hyp_paths = - OPT [ - paths = LIST1 [ id = IDENT ; SYMBOL ":" ; path = term -> (id,path) ] - SEP SYMBOL ";"; - SYMBOL <:unicode> -> - paths ]; - goal_path = OPT term -> - let hyp_paths = match hyp_paths with None -> [] | Some l -> l in + [ "in"; + hyp_paths = + LIST0 + [ id = IDENT ; + path = OPT [SYMBOL ":" ; path = term -> path ] -> + (id,match path with Some p -> p | None -> CicAst.UserInput) ] + SEP SYMBOL ";"; + goal_path = OPT [ SYMBOL <:unicode>; term = term -> term ] -> (hyp_paths, goal_path) ] ]; direction: [ @@ -400,16 +400,19 @@ EXTEND where = IDENT ; SYMBOL <:unicode> ; t = tactic_term -> TacticAst.LetIn (loc, t, where) | kind = reduction_kind; - p = OPT [ "in" ; p = pattern_spec -> p ] -> + 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 -> TacticAst.Replace (loc, t1, t2) | IDENT "rewrite" ; d = direction; t = term ; - p = OPT [ "in"; p = pattern_spec -> p ] -> + 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