src/HOL/Import/shuffler.ML
changeset 17463 e9c1574d0caf
parent 17440 df77edc4f5d0
child 17892 62c397c17d18
equal deleted inserted replaced
17462:47f7bddc3239 17463:e9c1574d0caf
   484 (* Transforms a term t to some normal form t', returning the theorem t
   484 (* Transforms a term t to some normal form t', returning the theorem t
   485 == t'.  This is originally a help function for make_equal, but might
   485 == t'.  This is originally a help function for make_equal, but might
   486 be handy in its own right, for example for indexing terms. *)
   486 be handy in its own right, for example for indexing terms. *)
   487 
   487 
   488 fun norm_term thy t =
   488 fun norm_term thy t =
   489     PolyML.exception_trace (fn () =>
       
   490     let
   489     let
   491 	val sg = sign_of thy
   490 	val sg = sign_of thy
   492 
   491 
   493 	val norms = ShuffleData.get thy
   492 	val norms = ShuffleData.get thy
   494 	val ss = empty_ss setmksimps single
   493 	val ss = empty_ss setmksimps single
   507 	      |> chain eta_conversion
   506 	      |> chain eta_conversion
   508 	      |> strip_shyps
   507 	      |> strip_shyps
   509 	val _ = message ("norm_term: " ^ (string_of_thm th))
   508 	val _ = message ("norm_term: " ^ (string_of_thm th))
   510     in
   509     in
   511 	th
   510 	th
   512     end)
   511     end
   513     handle e => (writeln "norm_term internal error"; print_sign_exn (sign_of thy) e)
   512     handle e => (writeln "norm_term internal error"; print_sign_exn (sign_of thy) e)
   514 
   513 
   515 
   514 
   516 (* Closes a theorem with respect to free and schematic variables (does
   515 (* Closes a theorem with respect to free and schematic variables (does
   517 not touch type variables, though). *)
   516 not touch type variables, though). *)