src/Pure/codegen.ML
changeset 33172 61ee96bc9895
parent 33092 c859019d3ac5
child 33173 b8ca12f6681a
equal deleted inserted replaced
33171:292970b42770 33172:61ee96bc9895
   444 fun add_edge_acyclic e (gr, x) = (Graph.add_edge_acyclic e gr, x);
   444 fun add_edge_acyclic e (gr, x) = (Graph.add_edge_acyclic e gr, x);
   445 fun del_nodes ks (gr, x) = (Graph.del_nodes ks gr, x);
   445 fun del_nodes ks (gr, x) = (Graph.del_nodes ks gr, x);
   446 fun map_node k f (gr, x) = (Graph.map_node k f gr, x);
   446 fun map_node k f (gr, x) = (Graph.map_node k f gr, x);
   447 fun new_node p (gr, x) = (Graph.new_node p gr, x);
   447 fun new_node p (gr, x) = (Graph.new_node p gr, x);
   448 
   448 
   449 fun thyname_of thy f x = the (AList.lookup (op =) (f x) Markup.theory_nameN);
   449 fun thyname_of_type thy = #theory_name o Name_Space.the_entry (Sign.type_space thy);
   450 
   450 fun thyname_of_const thy = #theory_name o Name_Space.the_entry (Sign.const_space thy);
   451 fun thyname_of_type thy =
       
   452   thyname_of thy (Type.the_tags (Sign.tsig_of thy));
       
   453 
       
   454 fun thyname_of_const thy =
       
   455   thyname_of thy (Consts.the_tags (Sign.consts_of thy));
       
   456 
   451 
   457 fun rename_terms ts =
   452 fun rename_terms ts =
   458   let
   453   let
   459     val names = List.foldr OldTerm.add_term_names
   454     val names = List.foldr OldTerm.add_term_names
   460       (map (fst o fst) (rev (fold Term.add_vars ts []))) ts;
   455       (map (fst o fst) (rev (fold Term.add_vars ts []))) ts;