diff options
| author | letouzey | 2013-10-24 21:25:12 +0000 |
|---|---|---|
| committer | letouzey | 2013-10-24 21:25:12 +0000 |
| commit | 43050b0d802f74fe59347f61830467a9804fd0d3 (patch) | |
| tree | 563601b09463b12a4c478a4430f1e05dcccc6db1 /checker/indtypes.ml | |
| parent | 9e37e3b9695a214040c52082b1e7288df9362b33 (diff) | |
Rtree : cleanup of the comparing code
* Using generic fold functions was unecessarily obscure
* No more List.mem and hence indirect use of ocaml generic comparison
* Rtree.equiv (former Rtree.compare_rtree) has now a less cryptic
semantic...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16934 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'checker/indtypes.ml')
| -rw-r--r-- | checker/indtypes.ml | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/checker/indtypes.ml b/checker/indtypes.ml index c26349207c..539a36331f 100644 --- a/checker/indtypes.ml +++ b/checker/indtypes.ml @@ -498,13 +498,10 @@ let check_positivity_one (env, _,ntypes,_ as ienv) hyps nrecp (_,i as ind) indlc indlc in mk_paths (Mrec ind) irecargs -let check_subtree (t1:'a) (t2:'a) = - if not (Rtree.compare_rtree (fun t1 t2 -> - let l1 = fst(Rtree.dest_node t1) in - let l2 = fst(Rtree.dest_node t2) in - if l1 = Norec || l1 = l2 then 0 else -1) - t1 t2) then - failwith "bad recursive trees" +let check_subtree t1 t2 = + let cmp_labels l1 l2 = l1 == Norec || eq_recarg l1 l2 in + if not (Rtree.equiv eq_recarg cmp_labels t1 t2) + then failwith "bad recursive trees" (* if t1=t2 then () else msg_warning (str"TODO: check recursive positions")*) let check_positivity env_ar mind params nrecp inds = |
