src/HOL/Tools/Predicate_Compile/predicate_compile_aux.ML
changeset 52230 1105b3b5aa77
parent 51717 9e7d1c139569
child 53887 ee91bd2a506a
equal deleted inserted replaced
52228:ee8e3eaad24c 52230:1105b3b5aa77
  1023 (* some peephole optimisations *)
  1023 (* some peephole optimisations *)
  1024 
  1024 
  1025 fun peephole_optimisation thy intro =
  1025 fun peephole_optimisation thy intro =
  1026   let
  1026   let
  1027     val process =
  1027     val process =
  1028       Raw_Simplifier.rewrite_rule (Predicate_Compile_Simps.get (Proof_Context.init_global thy))
  1028       rewrite_rule (Predicate_Compile_Simps.get (Proof_Context.init_global thy))
  1029     fun process_False intro_t =
  1029     fun process_False intro_t =
  1030       if member (op =) (Logic.strip_imp_prems intro_t) @{prop "False"} then NONE else SOME intro_t
  1030       if member (op =) (Logic.strip_imp_prems intro_t) @{prop "False"} then NONE else SOME intro_t
  1031     fun process_True intro_t =
  1031     fun process_True intro_t =
  1032       map_filter_premises (fn p => if p = @{prop True} then NONE else SOME p) intro_t
  1032       map_filter_premises (fn p => if p = @{prop True} then NONE else SOME p) intro_t
  1033   in
  1033   in