aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/locusops.ml
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2014-08-29 14:41:47 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2014-10-13 19:12:34 +0200
commit56cb514b425360ca428be116e9ea1d5205edd06f (patch)
tree2edec11d80f78c0caeae35913fa156768b9d3536 /pretyping/locusops.ml
parentc72eb85062edea223f5868c67ded99da7954d49a (diff)
Moving function about locs in locusops.
Diffstat (limited to 'pretyping/locusops.ml')
-rw-r--r--pretyping/locusops.ml21
1 files changed, 21 insertions, 0 deletions
diff --git a/pretyping/locusops.ml b/pretyping/locusops.ml
index 3bbd8af44..5484c8095 100644
--- a/pretyping/locusops.ml
+++ b/pretyping/locusops.ml
@@ -80,3 +80,24 @@ let concrete_clause_of enum_hyps cl =
if cl.concl_occs = NoOccurrences then hyps
else
OnConcl cl.concl_occs :: hyps
+
+(** Miscellaneous functions *)
+
+let out_arg = function
+ | Misctypes.ArgVar _ -> Errors.anomaly (Pp.str "Unevaluated or_var variable")
+ | Misctypes.ArgArg x -> x
+
+let occurrences_of_hyp id cls =
+ let rec hyp_occ = function
+ [] -> NoOccurrences, InHyp
+ | ((occs,id'),hl)::_ when Names.Id.equal id id' ->
+ occurrences_map (List.map out_arg) occs, hl
+ | _::l -> hyp_occ l in
+ match cls.onhyps with
+ None -> AllOccurrences,InHyp
+ | Some l -> hyp_occ l
+
+let occurrences_of_goal cls =
+ occurrences_map (List.map out_arg) cls.concl_occs
+
+let in_every_hyp cls = Option.is_empty cls.onhyps