From 0cc6076e7d4d92c1d899d450b2336dadbeb5f1b1 Mon Sep 17 00:00:00 2001 From: herbelin Date: Fri, 25 Apr 2008 18:07:44 +0000 Subject: Ajout de "Theorem id1 : t1 ... with idn : tn" pour partager la preuve des théorèmes prouvés par récursion ou corécursion mutuelle. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction au passage du parsing et du printing des tactiques fix/cofix et documentation de ces tactiques. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10850 85f007b7-540e-0410-9357-904b9bb8a0f7 --- parsing/g_tactic.ml4 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'parsing/g_tactic.ml4') diff --git a/parsing/g_tactic.ml4 b/parsing/g_tactic.ml4 index b6a3c985a..035bdced7 100644 --- a/parsing/g_tactic.ml4 +++ b/parsing/g_tactic.ml4 @@ -297,14 +297,23 @@ GEXTEND Gram | "-" -> false | -> true ]] ; + simple_fix_binder: + [ [ id=name -> ([id],Default Explicit,CHole (loc, None)) + | "("; idl=LIST1 name; ":"; c=lconstr; ")" -> (idl,Default Explicit,c) + ] ] + ; fixdecl: - [ [ "("; id = ident; bl=LIST0 Constr.binder; ann=fixannot; + [ [ "("; id = ident; bl=LIST0 simple_fix_binder; ann=fixannot; ":"; ty=lconstr; ")" -> (loc,id,bl,ann,ty) ] ] ; fixannot: [ [ "{"; IDENT "struct"; id=name; "}" -> Some id | -> None ] ] ; + cofixdecl: + [ [ "("; id = ident; bl=LIST0 simple_fix_binder; ":"; ty=lconstr; ")" -> + (loc,id,bl,None,ty) ] ] + ; hintbases: [ [ "with"; "*" -> None | "with"; l = LIST1 IDENT -> Some l @@ -387,11 +396,11 @@ GEXTEND Gram | "fix"; n = natural -> TacFix (None,n) | "fix"; id = ident; n = natural -> TacFix (Some id,n) | "fix"; id = ident; n = natural; "with"; fd = LIST1 fixdecl -> - TacMutualFix (id,n,List.map mk_fix_tac fd) + TacMutualFix (false,id,n,List.map mk_fix_tac fd) | "cofix" -> TacCofix None | "cofix"; id = ident -> TacCofix (Some id) - | "cofix"; id = ident; "with"; fd = LIST1 fixdecl -> - TacMutualCofix (id,List.map mk_cofix_tac fd) + | "cofix"; id = ident; "with"; fd = LIST1 cofixdecl -> + TacMutualCofix (false,id,List.map mk_cofix_tac fd) | IDENT "pose"; id = lpar_id_coloneq; b = lconstr; ")" -> TacLetTac (Names.Name id,b,nowhere) -- cgit v1.2.3