src/HOL/Tools/Function/scnp_reconstruct.ML
changeset 33063 4d462963a7db
parent 33040 cffdb7b28498
child 33099 b8cdd3d73022
equal deleted inserted replaced
33062:542b34b178ec 33063:4d462963a7db
   117           fold_product add_edge (0 upto arity p - 1) (0 upto arity q - 1) []
   117           fold_product add_edge (0 upto arity p - 1) (0 upto arity q - 1) []
   118       in
   118       in
   119         G (p, q, edges)
   119         G (p, q, edges)
   120       end
   120       end
   121   in
   121   in
   122     GP (map arity (0 upto n - 1), map mk_graph cs)
   122     GP (map_range arity n, map mk_graph cs)
   123   end
   123   end
   124 
   124 
   125 (* General reduction pair application *)
   125 (* General reduction pair application *)
   126 fun rem_inv_img ctxt =
   126 fun rem_inv_img ctxt =
   127   let
   127   let
   310   | print_cell (NONE) = "?"
   310   | print_cell (NONE) = "?"
   311 
   311 
   312 fun print_error ctxt D = CALLS (fn (cs, i) =>
   312 fun print_error ctxt D = CALLS (fn (cs, i) =>
   313   let
   313   let
   314     val np = get_num_points D
   314     val np = get_num_points D
   315     val ms = map (get_measures D) (0 upto np - 1)
   315     val ms = map_range (get_measures D) np
   316     val tys = map (get_types D) (0 upto np - 1)
   316     val tys = map_range (get_types D) np
   317     fun index xs = (1 upto length xs) ~~ xs
   317     fun index xs = (1 upto length xs) ~~ xs
   318     fun outp s t f xs = map (fn (x, y) => s ^ Int.toString x ^ t ^ f y ^ "\n") xs
   318     fun outp s t f xs = map (fn (x, y) => s ^ Int.toString x ^ t ^ f y ^ "\n") xs
   319     val ims = index (map index ms)
   319     val ims = index (map index ms)
   320     val _ = tracing (implode (outp "fn #" ":\n" (implode o outp "\tmeasure #" ": " (Syntax.string_of_term ctxt)) ims))
   320     val _ = tracing (implode (outp "fn #" ":\n" (implode o outp "\tmeasure #" ": " (Syntax.string_of_term ctxt)) ims))
   321     fun print_call (k, c) =
   321     fun print_call (k, c) =