]> matita.cs.unibo.it Git - helm.git/commitdiff
The discriminate tactic accepts a term, not only an identifier!
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 23 Jun 2005 12:25:56 +0000 (12:25 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 23 Jun 2005 12:25:56 +0000 (12:25 +0000)
helm/ocaml/cic_disambiguation/cicTextualParser2.ml
helm/ocaml/cic_transformations/tacticAst.ml
helm/ocaml/cic_transformations/tacticAst2Box.ml
helm/ocaml/cic_transformations/tacticAstPp.ml

index 086c307873bd1fc87aaa8c09d6910ac640d5d5bb..737673e143f45949ebec70a2cbb23ac434662ce9 100644 (file)
@@ -368,8 +368,8 @@ EXTEND
       principles = ident_list1; where = IDENT ->
         TacticAst.Decompose (loc, where, principles)
     | [ IDENT "discriminate" ];
-      hyp = IDENT ->
-        TacticAst.Discriminate (loc, hyp)
+      t = tactic_term ->
+        TacticAst.Discriminate (loc, t)
     | [ IDENT "elimType" ]; t = tactic_term ->
         TacticAst.ElimType (loc, t)
     | [ IDENT "elim" ];
index c130cc933081bdbf03f766a73feabe7fb2d42e42..12b7774cd32938f9141e9e332f6e315d155d2f13 100644 (file)
@@ -40,7 +40,7 @@ type ('term, 'ident) tactic =
   | Contradiction of loc
   | Cut of loc * 'term
   | Decompose of loc * 'ident * 'ident list (* where, which principles *)
-  | Discriminate of loc * 'ident
+  | Discriminate of loc * 'term
   | Elim of loc * 'term * 'term option (* what to elim, which principle to use *)
   | ElimType of loc * 'term
   | Exact of loc * 'term
index 35a27ff24785fa17640b023ebc5d374efd95a076..f43091c755a012cd059cfd64d52c289151013e06 100644 (file)
@@ -56,7 +56,7 @@ let rec count_tactic current_size tac =
        List.fold_left
          (fun size s -> size + (String.length s))
          (current_size + 11 + String.length ident) principles
-    | Discriminate (_, ident) -> current_size + 12 + (String.length ident)
+    | Discriminate (_, term) -> countterm (current_size + 12) term
     | Elim (_, term, using) ->
        let size1 = countterm (current_size + 5) term in
          (match using with 
@@ -164,9 +164,8 @@ and big_tactic2box = function
                          Box.V([],principles);
                          Box.Text([],"]")]);
                Box.Text([],ident)])
-  | Discriminate (_, ident) -> 
-      Box.V([],[Box.Text([],"discriminate");
-               Box.Text([],ident)])
+  | Discriminate (_, term) -> 
+      Box.V([],pretty_append [Box.Text([],"discriminate")] term)
   | Elim (_, term, using) ->
       let using =
        (match using with 
index 86d10c87730294bf0db4e097c4ec442dec47f3e4..52f7b1ab20099709575e37bcbd18eb61f2b96116 100644 (file)
@@ -71,7 +71,7 @@ let rec pp_tactic = function
   | Cut (_, term) -> "cut " ^ pp_term_ast term
   | Decompose (_, ident, principles) ->
       sprintf "decompose %s %s" (pp_idents principles) ident
-  | Discriminate (_, ident) -> "discriminate " ^ ident
+  | Discriminate (_, term) -> "discriminate " ^ pp_term_ast term
   | Elim (_, term, using) ->
       sprintf "elim " ^ pp_term_ast term ^
       (match using with None -> "" | Some term -> " using " ^ pp_term_ast term)