src/Pure/proofterm.ML
changeset 12868 cdf338ef5fad
parent 12497 ec6ba9e6eef3
child 12871 21486a0557d1
equal deleted inserted replaced
12867:5c900a821a7c 12868:cdf338ef5fad
    44   val map_proof_terms : (term -> term) -> (typ -> typ) -> proof -> proof
    44   val map_proof_terms : (term -> term) -> (typ -> typ) -> proof -> proof
    45   val fold_proof_terms : (term * 'a -> 'a) -> (typ * 'a -> 'a) -> 'a * proof -> 'a
    45   val fold_proof_terms : (term * 'a -> 'a) -> (typ * 'a -> 'a) -> 'a * proof -> 'a
    46   val add_prf_names : string list * proof -> string list
    46   val add_prf_names : string list * proof -> string list
    47   val add_prf_tfree_names : string list * proof -> string list
    47   val add_prf_tfree_names : string list * proof -> string list
    48   val add_prf_tvar_ixns : indexname list * proof -> indexname list
    48   val add_prf_tvar_ixns : indexname list * proof -> indexname list
       
    49   val maxidx_of_proof : proof -> int
    49   val prf_abstract_over : term -> proof -> proof
    50   val prf_abstract_over : term -> proof -> proof
    50   val prf_incr_bv : int -> int -> int -> int -> proof -> proof
    51   val prf_incr_bv : int -> int -> int -> int -> proof -> proof
    51   val incr_pboundvars : int -> int -> proof -> proof
    52   val incr_pboundvars : int -> int -> proof -> proof
    52   val prf_loose_bvar1 : proof -> int -> bool
    53   val prf_loose_bvar1 : proof -> int -> bool
    53   val prf_loose_Pbvar1 : proof -> int -> bool
    54   val prf_loose_Pbvar1 : proof -> int -> bool
   261   | fold_proof_terms _ _ (a, _) = a;
   262   | fold_proof_terms _ _ (a, _) = a;
   262 
   263 
   263 val add_prf_names = fold_proof_terms add_term_names ((uncurry K) o swap);
   264 val add_prf_names = fold_proof_terms add_term_names ((uncurry K) o swap);
   264 val add_prf_tfree_names = fold_proof_terms add_term_tfree_names add_typ_tfree_names;
   265 val add_prf_tfree_names = fold_proof_terms add_term_tfree_names add_typ_tfree_names;
   265 val add_prf_tvar_ixns = fold_proof_terms add_term_tvar_ixns (add_typ_ixns o swap);
   266 val add_prf_tvar_ixns = fold_proof_terms add_term_tvar_ixns (add_typ_ixns o swap);
       
   267 
       
   268 fun maxidx_of_proof prf = fold_proof_terms
       
   269   (Int.max o apfst maxidx_of_term) (Int.max o apfst maxidx_of_typ) (~1, prf); 
   266 
   270 
   267 
   271 
   268 (***** utilities *****)
   272 (***** utilities *****)
   269 
   273 
   270 fun strip_abs (_::Ts) (Abs (_, _, t)) = strip_abs Ts t
   274 fun strip_abs (_::Ts) (Abs (_, _, t)) = strip_abs Ts t