src/Pure/zterm.ML
changeset 80583 9a40ec7a2027
parent 80582 1bc7eef961ff
child 80584 b1b53f6a08fa
equal deleted inserted replaced
80582:1bc7eef961ff 80583:9a40ec7a2027
   252   val map_class_proof: (ztyp * class, zproof) Same.function -> zproof -> zproof
   252   val map_class_proof: (ztyp * class, zproof) Same.function -> zproof -> zproof
   253   val ztyp_of: typ -> ztyp
   253   val ztyp_of: typ -> ztyp
   254   val typ_of_tvar: indexname * sort -> typ
   254   val typ_of_tvar: indexname * sort -> typ
   255   val typ_of: ztyp -> typ
   255   val typ_of: ztyp -> typ
   256   val reset_cache: theory -> theory
   256   val reset_cache: theory -> theory
       
   257   val check_cache: theory -> {ztyp: int, typ: int} option
   257   val ztyp_cache: theory -> typ -> ztyp
   258   val ztyp_cache: theory -> typ -> ztyp
   258   val typ_cache: theory -> ztyp -> typ
   259   val typ_cache: theory -> ztyp -> typ
   259   val zterm_cache: theory -> {zterm: term -> zterm, ztyp: typ -> ztyp}
   260   val zterm_cache: theory -> {zterm: term -> zterm, ztyp: typ -> ztyp}
   260   val zterm_of: theory -> term -> zterm
   261   val zterm_of: theory -> term -> zterm
   261   val term_of: theory -> zterm -> term
   262   val term_of: theory -> zterm -> term
   631 fun reset_cache thy =
   632 fun reset_cache thy =
   632   (case Data.get thy of
   633   (case Data.get thy of
   633     SOME (cache1, cache2) => (#reset cache1 (); #reset cache2 (); thy)
   634     SOME (cache1, cache2) => (#reset cache1 (); #reset cache2 (); thy)
   634   | NONE => thy);
   635   | NONE => thy);
   635 
   636 
       
   637 fun check_cache thy =
       
   638   Data.get thy
       
   639   |> Option.map (fn (cache1, cache2) => {ztyp = #size cache1 (), typ = #size cache2 ()});
       
   640 
   636 fun ztyp_cache thy =
   641 fun ztyp_cache thy =
   637   (case Data.get thy of
   642   (case Data.get thy of
   638     SOME (cache, _) => cache
   643     SOME (cache, _) => cache
   639   | NONE => make_ztyp_cache ()) |> #apply;
   644   | NONE => make_ztyp_cache ()) |> #apply;
   640 
   645