src/Pure/sign.ML
changeset 4951 8637b29e6c38
parent 4908 7a155899ef9c
child 4961 27f559b54c57
equal deleted inserted replaced
4950:226f2cde9f4d 4951:8637b29e6c38
    35   val self_ref: sg -> sg_ref
    35   val self_ref: sg -> sg_ref
    36   val subsig: sg * sg -> bool
    36   val subsig: sg * sg -> bool
    37   val eq_sg: sg * sg -> bool
    37   val eq_sg: sg * sg -> bool
    38   val same_sg: sg * sg -> bool
    38   val same_sg: sg * sg -> bool
    39   val is_draft: sg -> bool
    39   val is_draft: sg -> bool
       
    40   val is_stale: sg -> bool
    40   val const_type: sg -> string -> typ option
    41   val const_type: sg -> string -> typ option
    41   val classes: sg -> class list
    42   val classes: sg -> class list
    42   val defaultS: sg -> sort
    43   val defaultS: sg -> sort
    43   val subsort: sg -> sort * sort -> bool
    44   val subsort: sg -> sort * sort -> bool
    44   val nodup_Vars: term -> unit
    45   val nodup_Vars: term -> unit
   191         {self = SgRef (Some (ref (Sg ({id = id', ...}, _)))), ...})) =
   192         {self = SgRef (Some (ref (Sg ({id = id', ...}, _)))), ...})) =
   192       if id = id' then sg
   193       if id = id' then sg
   193       else raise TERM ("Stale signature: " ^ str_of_sg sg, [])
   194       else raise TERM ("Stale signature: " ^ str_of_sg sg, [])
   194   | check_stale _ = sys_error "Sign.check_stale";
   195   | check_stale _ = sys_error "Sign.check_stale";
   195 
   196 
       
   197 fun is_stale sg = (check_stale sg; false) handle TERM _ => true;
       
   198 
   196 fun self_ref (sg as Sg (_, {self, ...})) = (check_stale sg; self);
   199 fun self_ref (sg as Sg (_, {self, ...})) = (check_stale sg; self);
   197 
   200 
   198 fun deref (SgRef (Some (ref sg))) = sg
   201 fun deref (SgRef (Some (ref sg))) = sg
   199   | deref (SgRef None) = sys_error "Sign.deref";
   202   | deref (SgRef None) = sys_error "Sign.deref";
   200 
   203