aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
Diffstat (limited to 'tactics')
-rw-r--r--tactics/hipattern.ml15
-rw-r--r--tactics/hipattern.mli5
2 files changed, 17 insertions, 3 deletions
diff --git a/tactics/hipattern.ml b/tactics/hipattern.ml
index c11fd1699b..ff735c9cd5 100644
--- a/tactics/hipattern.ml
+++ b/tactics/hipattern.ml
@@ -176,10 +176,19 @@ let match_with_nottype t =
let is_nottype t = op2bool (match_with_nottype t)
-let is_imp_term c =
+let match_with_forall_term c=
match kind_of_term c with
- | Prod (_,_,b) -> not (dependent (mkRel 1) b)
- | _ -> false
+ | Prod (nam,a,b) -> Some (nam,a,b)
+ | _ -> None
+
+let is_forall_term c = op2bool (match_with_forall_term c)
+
+let match_with_imp_term c=
+ match kind_of_term c with
+ | Prod (_,a,b) when not (dependent (mkRel 1) b) ->Some (a,b)
+ | _ -> None
+
+let is_imp_term c = op2bool (match_with_imp_term c)
let rec has_nodep_prod_after n c =
match kind_of_term c with
diff --git a/tactics/hipattern.mli b/tactics/hipattern.mli
index 053175269c..8beaaf65e9 100644
--- a/tactics/hipattern.mli
+++ b/tactics/hipattern.mli
@@ -74,6 +74,11 @@ val is_equation : testing_function
val match_with_nottype : (constr * constr) matching_function
val is_nottype : testing_function
+val match_with_forall_term : (name * constr * constr) matching_function
+val is_forall_term : testing_function
+
+val match_with_imp_term : (constr * constr) matching_function
+val is_imp_term : testing_function
(* I added these functions to test whether a type contains dependent
products or not, and if an inductive has constructors with dependent types