diff options
| author | herbelin | 2001-08-08 15:15:45 +0000 |
|---|---|---|
| committer | herbelin | 2001-08-08 15:15:45 +0000 |
| commit | f04c411b14b8910ed4c68ec27e38ca0e5e24c02d (patch) | |
| tree | 2d6298d55f326e8d0b15d4fc634c3cb8853c53e5 | |
| parent | 3aa6b093a6494cc1ee3cf741a6aa4427e79761e2 (diff) | |
Renommage TrueCut -> Assert
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1887 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | parsing/g_tactic.ml4 | 2 | ||||
| -rw-r--r-- | tactics/tactics.ml | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/parsing/g_tactic.ml4 b/parsing/g_tactic.ml4 index 08deeb8d10..c93f807025 100644 --- a/parsing/g_tactic.ml4 +++ b/parsing/g_tactic.ml4 @@ -318,7 +318,7 @@ GEXTEND Gram | IDENT "Decompose"; "["; l = ne_qualidarg_list; "]"; c = constrarg -> <:ast< (DecomposeThese $c ($LIST $l)) >> | IDENT "Cut"; c = constrarg -> <:ast< (Cut $c) >> - | IDENT "TrueCut"; c = constrarg -> <:ast< (TrueCut $c) >> + | IDENT "Assert"; c = constrarg -> <:ast< (TrueCut $c) >> | IDENT "Specialize"; n = pure_numarg; lcb = constrarg_binding_list -> <:ast< (Specialize $n ($LIST $lcb))>> | IDENT "Specialize"; lcb = constrarg_binding_list -> diff --git a/tactics/tactics.ml b/tactics/tactics.ml index bfe2788d22..bffbfea4ce 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -588,16 +588,26 @@ let dyn_cut_and_apply = function (* Cut tactics *) (**************************) -let true_cut c gl = +let true_cut id c gl = match kind_of_term (hnf_type_of gl c) with - | IsSort _ -> - let id=next_name_away_with_default "H" Anonymous (pf_ids_of_hyps gl) in + | IsSort _ -> internal_cut id c gl + | _ -> error "Not a proposition or a type" + +let true_cut_anon c gl = + match kind_of_term (hnf_type_of gl c) with + | IsSort s -> + let d = match s with Prop _ -> "H" | Type _ -> "X" in + let id = next_name_away_with_default d Anonymous (pf_ids_of_hyps gl) in internal_cut id c gl | _ -> error "Not a proposition or a type" let dyn_true_cut = function - | [Command com] -> tactic_com_sort true_cut com - | [Constr c] -> true_cut c + | [Command com] -> tactic_com_sort true_cut_anon com + | [Constr c] -> true_cut_anon c +(* Pas trouvé de syntaxe pour cela + | [Command com; Identifier id] -> tactic_com_sort (true_cut id) com + | [Constr c; Identifier id] -> true_cut id c +*) | l -> bad_tactic_args "true_cut" l let cut c gl = |
