src/HOL/Tools/Predicate_Compile/code_prolog.ML
changeset 51314 eac4bb5adbf9
parent 51126 df86080de4cb
child 51704 0b0fc7dc4ce4
equal deleted inserted replaced
51313:102a0a0718c5 51314:eac4bb5adbf9
   301 fun imp_prems_conv cv ct =
   301 fun imp_prems_conv cv ct =
   302   case Thm.term_of ct of
   302   case Thm.term_of ct of
   303     Const ("==>", _) $ _ $ _ => Conv.combination_conv (Conv.arg_conv cv) (imp_prems_conv cv) ct
   303     Const ("==>", _) $ _ $ _ => Conv.combination_conv (Conv.arg_conv cv) (imp_prems_conv cv) ct
   304   | _ => Conv.all_conv ct
   304   | _ => Conv.all_conv ct
   305 
   305 
   306 fun Trueprop_conv cv ct =
       
   307   case Thm.term_of ct of
       
   308     Const (@{const_name Trueprop}, _) $ _ => Conv.arg_conv cv ct  
       
   309   | _ => raise Fail "Trueprop_conv"
       
   310 
       
   311 fun preprocess_intro thy rule =
   306 fun preprocess_intro thy rule =
   312   Conv.fconv_rule
   307   Conv.fconv_rule
   313     (imp_prems_conv
   308     (imp_prems_conv
   314       (Trueprop_conv (Conv.try_conv (Conv.rewr_conv @{thm Predicate.eq_is_eq}))))
   309       (HOLogic.Trueprop_conv (Conv.try_conv (Conv.rewr_conv @{thm Predicate.eq_is_eq}))))
   315     (Thm.transfer thy rule)
   310     (Thm.transfer thy rule)
   316 
   311 
   317 fun translate_intros ensure_groundness ctxt gr const constant_table =
   312 fun translate_intros ensure_groundness ctxt gr const constant_table =
   318   let
   313   let
   319     val intros = map (preprocess_intro (Proof_Context.theory_of ctxt)) (Graph.get_node gr const)
   314     val intros = map (preprocess_intro (Proof_Context.theory_of ctxt)) (Graph.get_node gr const)