src/HOL/HOL.thy
changeset 46190 a42c5f23109f
parent 46161 4ed94d92ae19
child 46497 89ccf66aa73d
equal deleted inserted replaced
46189:7f6668317e24 46190:a42c5f23109f
  1904   (Scala "!error(\"undefined\")")
  1904   (Scala "!error(\"undefined\")")
  1905 
  1905 
  1906 subsubsection {* Evaluation and normalization by evaluation *}
  1906 subsubsection {* Evaluation and normalization by evaluation *}
  1907 
  1907 
  1908 ML {*
  1908 ML {*
  1909 fun gen_eval_method conv ctxt = SIMPLE_METHOD'
  1909 fun eval_tac ctxt =
  1910   (CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 (conv ctxt))) ctxt)
  1910   let val conv = Code_Runtime.dynamic_holds_conv (Proof_Context.theory_of ctxt)
  1911     THEN' rtac TrueI)
  1911   in CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 conv)) ctxt) THEN' rtac TrueI end
  1912 *}
  1912 *}
  1913 
  1913 
  1914 method_setup eval = {*
  1914 method_setup eval = {* Scan.succeed (SIMPLE_METHOD' o eval_tac) *}
  1915   Scan.succeed (gen_eval_method (Code_Runtime.dynamic_holds_conv o Proof_Context.theory_of))
  1915   "solve goal by evaluation"
  1916 *} "solve goal by evaluation"
       
  1917 
  1916 
  1918 method_setup normalization = {*
  1917 method_setup normalization = {*
  1919   Scan.succeed (fn ctxt => SIMPLE_METHOD'
  1918   Scan.succeed (fn ctxt =>
  1920     (CHANGED_PROP o (CONVERSION (Nbe.dynamic_conv (Proof_Context.theory_of ctxt))
  1919     SIMPLE_METHOD'
  1921       THEN' (fn k => TRY (rtac TrueI k)))))
  1920       (CHANGED_PROP o
       
  1921         (CONVERSION (Nbe.dynamic_conv (Proof_Context.theory_of ctxt))
       
  1922           THEN_ALL_NEW (TRY o rtac TrueI))))
  1922 *} "solve goal by normalization"
  1923 *} "solve goal by normalization"
  1923 
  1924 
  1924 
  1925 
  1925 subsection {* Counterexample Search Units *}
  1926 subsection {* Counterexample Search Units *}
  1926 
  1927