src/Pure/library.ML
changeset 19973 07cf246f76a3
parent 19799 666de5708ae8
child 20006 0f507e799938
equal deleted inserted replaced
19972:89c5afe4139a 19973:07cf246f76a3
  1226 
  1226 
  1227 
  1227 
  1228 
  1228 
  1229 (** misc **)
  1229 (** misc **)
  1230 
  1230 
       
  1231 (* decompose the "problem" x into a list of subproblems ys and a recombination *)
       
  1232 (* function recomb, solve the subproblems recursively, use recomb to combine   *)
       
  1233 (* the recursive solutions for ys into an overall "solution" for x             *)
  1231 fun divide_and_conquer decomp x =
  1234 fun divide_and_conquer decomp x =
  1232   let val (ys, recomb) = decomp x
  1235   let val (ys, recomb) = decomp x
  1233   in recomb (map (divide_and_conquer decomp) ys) end;
  1236   in recomb (map (divide_and_conquer decomp) ys) end;
  1234 
  1237 
  1235 
  1238