src/HOL/Tools/lambda_lifting.ML
changeset 75274 e89709b80b6e
parent 69593 3dda49e08b9d
equal deleted inserted replaced
75273:f1c6e778e412 75274:e89709b80b6e
    14   val lift_lambdas1: (term -> bool) -> string option -> term -> context ->
    14   val lift_lambdas1: (term -> bool) -> string option -> term -> context ->
    15     term * context
    15     term * context
    16   val finish: context -> term list * Proof.context
    16   val finish: context -> term list * Proof.context
    17   val lift_lambdas: string option -> (term -> bool) -> term list ->
    17   val lift_lambdas: string option -> (term -> bool) -> term list ->
    18     Proof.context -> (term list * term list) * Proof.context
    18     Proof.context -> (term list * term list) * Proof.context
       
    19   val lift_lambdas': string option -> (term -> bool) -> ('a * term) list ->
       
    20     Proof.context -> (('a * term) list * term list) * Proof.context
    19 end
    21 end
    20 
    22 
    21 structure Lambda_Lifting: LAMBDA_LIFTING =
    23 structure Lambda_Lifting: LAMBDA_LIFTING =
    22 struct
    24 struct
    23 
    25 
    85 fun lift_lambdas basename is_binder ts ctxt =
    87 fun lift_lambdas basename is_binder ts ctxt =
    86   init ctxt
    88   init ctxt
    87   |> fold_map (lift_lambdas1 is_binder basename) ts
    89   |> fold_map (lift_lambdas1 is_binder basename) ts
    88   |-> (fn ts' => finish #>> pair ts')
    90   |-> (fn ts' => finish #>> pair ts')
    89 
    91 
       
    92 fun lift_lambdas' basename is_binder ts ctxt =
       
    93   init ctxt
       
    94   |> fold_map (fn (x, t) => apfst (pair x) o lift_lambdas1 is_binder basename t) ts
       
    95   |-> (fn ts' => finish #>> pair ts')
       
    96 
    90 end
    97 end