new_theory : (string -> void)
Calling new_theory `thy` creates a new theory segment and associated theory having name thy. The theory segment which was current before the call becomes a parent of the new theory segment. The new theory therefore consists of the current theory extended with the new theory segment. The new theory segment replaces its parent as the current theory segment. The call switches the system into draft mode. This allows new axioms, constants, types, constant specifications, infix constants, binders and parents to be added to the theory segment. Inconsistencies will be introduced into the theory if inconsistent axioms are asserted. New theorems can also be added as when in proof mode. The theory file in which the data of the new theory segment is ultimately stored will have name thy.th in the directory from which HOL was called. The theory segment might not be written to this file until the session is finished with a call to close_theory. If HOL is quitted without closing the session with close_theory, parts of the theory segment created during the session may be lost. If the system is in draft mode when a call to new_theory is made, the previous session is closed; all changes made in it will be written to the associated theory file.