src/HOL/Tools/Sledgehammer/sledgehammer_proof.ML
changeset 51128 0021ea861129
parent 50672 ab5b8b5c9cbe
child 51132 f8dc1c94ef8b
equal deleted inserted replaced
51127:5cf1604b9ef5 51128:0021ea861129
    20     Obtain of
    20     Obtain of
    21       isar_qualifier list * (string * typ) list * label * term * byline |
    21       isar_qualifier list * (string * typ) list * label * term * byline |
    22     Prove of isar_qualifier list * label * term * byline
    22     Prove of isar_qualifier list * label * term * byline
    23   and byline =
    23   and byline =
    24     By_Metis of facts |
    24     By_Metis of facts |
    25     Case_Split of isar_step list list * facts
    25     Case_Split of isar_step list list * facts |
       
    26     Subblock of isar_step list
    26 
    27 
    27   val string_for_label : label -> string
    28   val string_for_label : label -> string
    28   val metis_steps_top_level : isar_step list -> int
    29   val metis_steps_top_level : isar_step list -> int
    29   val metis_steps_total : isar_step list -> int
    30   val metis_steps_total : isar_step list -> int
    30 end
    31 end
    43   Assume of label * term |
    44   Assume of label * term |
    44   Obtain of isar_qualifier list * (string * typ) list * label * term * byline |
    45   Obtain of isar_qualifier list * (string * typ) list * label * term * byline |
    45   Prove of isar_qualifier list * label * term * byline
    46   Prove of isar_qualifier list * label * term * byline
    46 and byline =
    47 and byline =
    47   By_Metis of facts |
    48   By_Metis of facts |
    48   Case_Split of isar_step list list * facts
    49   Case_Split of isar_step list list * facts |
       
    50   Subblock of isar_step list
    49 
    51 
    50 fun string_for_label (s, num) = s ^ string_of_int num
    52 fun string_for_label (s, num) = s ^ string_of_int num
    51 
    53 
    52 fun metis_steps_top_level proof =
    54 fun metis_steps_top_level proof =
    53   fold (fn Obtain _ => Integer.add 1 | Prove _ => Integer.add 1 | _ => I)
    55   fold (fn Obtain _ => Integer.add 1 | Prove _ => Integer.add 1 | _ => I)
    55 fun metis_steps_total proof =
    57 fun metis_steps_total proof =
    56   fold (fn Obtain _ => Integer.add 1
    58   fold (fn Obtain _ => Integer.add 1
    57          | Prove (_, _, _, By_Metis _) => Integer.add 1
    59          | Prove (_, _, _, By_Metis _) => Integer.add 1
    58          | Prove (_, _, _, Case_Split (cases, _)) =>
    60          | Prove (_, _, _, Case_Split (cases, _)) =>
    59            Integer.add (fold (Integer.add o metis_steps_total) cases 1)
    61            Integer.add (fold (Integer.add o metis_steps_total) cases 1)
       
    62          | Prove (_, _, _, Subblock subproof) =>
       
    63            Integer.add (metis_steps_total subproof)
    60          | _ => I) proof 0
    64          | _ => I) proof 0
    61 
    65 
    62 end
    66 end