equal
deleted
inserted
replaced
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 |