src/Pure/meta_simplifier.ML
changeset 16378 8af448f67cef
parent 16305 5e7b6731b004
child 16380 019ec70774ff
equal deleted inserted replaced
16377:9da1cf997e79 16378:8af448f67cef
   103 
   103 
   104 exception SIMPLIFIER of string * thm;
   104 exception SIMPLIFIER of string * thm;
   105 
   105 
   106 val debug_simp = ref false;
   106 val debug_simp = ref false;
   107 val trace_simp = ref false;
   107 val trace_simp = ref false;
   108 val simp_depth = ref 0;
   108 val simp_depth = ref (~1);
   109 val simp_depth_limit = ref 1000;
   109 val simp_depth_limit = ref 1000;
   110 val trace_simp_depth_limit = ref 1000;
   110 val trace_simp_depth_limit = ref 1000;
   111 
   111 
   112 local
   112 local
   113 
   113 
  1100        val res = bottomc (mode, prover, sign, maxidx) ss ct
  1100        val res = bottomc (mode, prover, sign, maxidx) ss ct
  1101          handle THM (s, _, thms) =>
  1101          handle THM (s, _, thms) =>
  1102          error ("Exception THM was raised in simplifier:\n" ^ s ^ "\n" ^
  1102          error ("Exception THM was raised in simplifier:\n" ^ s ^ "\n" ^
  1103            Pretty.string_of (Display.pretty_thms thms))
  1103            Pretty.string_of (Display.pretty_thms thms))
  1104    in simp_depth := !simp_depth - 1; res end
  1104    in simp_depth := !simp_depth - 1; res end
  1105   ) handle exn => (simp_depth := 0; raise exn);
  1105   ) handle exn => (simp_depth := !simp_depth - 1; raise exn);
  1106 
  1106 
  1107 (*Rewrite a cterm*)
  1107 (*Rewrite a cterm*)
  1108 fun rewrite_aux _ _ [] = (fn ct => Thm.reflexive ct)
  1108 fun rewrite_aux _ _ [] = (fn ct => Thm.reflexive ct)
  1109   | rewrite_aux prover full thms =
  1109   | rewrite_aux prover full thms =
  1110       rewrite_cterm (full, false, false) prover (empty_ss addsimps thms);
  1110       rewrite_cterm (full, false, false) prover (empty_ss addsimps thms);