diff options
| -rw-r--r-- | doc/refman/RefMan-tac.tex | 9 | ||||
| -rw-r--r-- | tactics/extratactics.ml4 | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/doc/refman/RefMan-tac.tex b/doc/refman/RefMan-tac.tex index e027794f81..24ff5793c0 100644 --- a/doc/refman/RefMan-tac.tex +++ b/doc/refman/RefMan-tac.tex @@ -1025,6 +1025,15 @@ including those under binders. \ErrMsg \errindex{No evars} +\subsection{\tt is\_var \term +\tacindex{is\_var} +\label{isvar}} + +This tactic applies to any goal. It checks whether its argument is a +variable or hypothesis in the current goal context or in the opened sections. + +\ErrMsg \errindex{Not a variable or hypothesis} + \subsection{Bindings list \index{Binding list} \label{Binding-list}} diff --git a/tactics/extratactics.ml4 b/tactics/extratactics.ml4 index e25e551353..4af1bce7de 100644 --- a/tactics/extratactics.ml4 +++ b/tactics/extratactics.ml4 @@ -754,3 +754,10 @@ TACTIC EXTEND has_evar | [ "has_evar" constr(x) ] -> [ if has_evar x then tclIDTAC else tclFAIL 0 (str "No evars") ] END + +TACTIC EXTEND is_hyp +| [ "is_var" constr(x) ] -> + [ match kind_of_term x with + | Var _ -> tclIDTAC + | _ -> tclFAIL 0 (str "Not a variable or hypothesis") ] +END |
