delete_type : string -> unit
In particular, the implementation ensures that a deleted type operator is never equal to a subsequently declared type operator with the same name (and arity). Furthermore, although garbage types, terms, and theorems may exist in a session, no theorem, definition, or axiom that is garbage is exported when export_theory is invoked.
The notion of garbage is hereditary. Any type, term, definition, or theorem is garbage if any of its constituents are. Furthermore, if a type operator or term constant had been defined, and its witness theorem later becomes garbage, then that type or term is garbage, as is anything built from it.
new_type ("foo", 2); > val it = () : unit - val thm = REFL (Term `f:('a,'b)foo`); > val thm = |- f = f : thm - delete_type "foo"; > val it = () : unit - thm; > val it = |- f = f : thm - show_types := true; > val it = () : unit - thm; > val it = |- (x :(('a, 'b) scratch$old->f<-old)) = x : thm
It is not possible to delete constants from ancestor theories.