delete_const : string -> unit
The implementation ensures that a deleted constant is never equal to a subsequently declared constant, even if it has the same name and type. Furthermore, although garbage types, terms, and theorems may exist in a session, and may even have been stored in the current segment for export, no theorem, definition, or axiom that is garbage is exported when export_theory is invoked.
The prettyprinter highlights deleted constants.
- Define `foo x = if x=0 then 1 else x * foo (x-1)`; Equations stored under "foo_def". Induction stored under "foo_ind". > val it = |- foo x = (if x = 0 then 1 else x * foo (x - 1)) : thm - val th = EVAL (Term `foo 4`); > val th = |- foo 4 = 24 : thm - delete_const "foo"; > val it = () : unit - th; > val it = |- scratch$old->foo<-old 4 = 24 : thm
It may happen that a theorem th is proved with the use of another theorem th1 that subsequently becomes garbage because a constant c was deleted. If c does not occur in th, then th does not become garbage, which may be contrary to expectation. The conservative extension property of HOL says that th is still provable, even in the absence of c.