~ubuntu-branches/ubuntu/trusty/coccinelle/trusty-proposed

« back to all changes in this revision

Viewing changes to engine/postprocess_transinfo.ml

  • Committer: Package Import Robot
  • Author(s): Євгеній Мещеряков
  • Date: 2011-12-06 23:17:50 UTC
  • mfrom: (7.2.4 experimental) (7.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20111206231750-m6n4b9jh0d48dlxo
Tags: 1.0.0~rc7.deb-5
Merge Build-Depends-Indep into Build-Depends, the package does not build
on autobuilders otherwise

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
                               str
99
99
                           | _ -> failwith "bad id value")
100
100
                         with
101
 
                           Not_found -> failwith "fresh: no binding for meta")
 
101
                           Not_found ->
 
102
                             failwith
 
103
                               ("fresh: no binding for meta "^(Dumper.dump id)))
102
104
                   seed in
103
105
            string2val(String.concat "" strings)))
104
106
      all_fresh in
142
144
 
143
145
(* ----------------------------------------------------------------------- *)
144
146
(* distinguish between distinct witness trees, each gets an index n *)
 
147
(* index should be global, so that it can extend over environments *)
 
148
 
 
149
let index = ref (-1)
 
150
 
 
151
let fold_left_with_index f acc =
 
152
  let rec fold_lwi_aux acc = function
 
153
    | [] -> acc
 
154
    | x::xs ->
 
155
        let n = !index in
 
156
        index := !index + 1;
 
157
        fold_lwi_aux (f acc x n) xs
 
158
  in fold_lwi_aux acc
145
159
 
146
160
let numberify trees =
147
161
  let trees =
148
 
    Common.fold_left_with_index
 
162
    fold_left_with_index
149
163
      (function acc -> function xs -> function n ->
150
164
        (List.map (function x -> (n,x)) xs) @ acc)
151
165
      [] trees in
152
 
  List.fold_left
 
166
    List.fold_left
153
167
    (function res ->
154
168
      function (n,x) ->
155
169
        let (same,diff) = List.partition (function (ns,xs) -> x = xs) res in