Parse.new_gen_definition : (string * term * fixity) -> thm

SYNOPSIS
Defines a new constant and associates it with a parsing fixity.

DESCRIBE

The function new_gen_definition provides a facility for definitional extensions to the current theory. It takes a tuple of three arguments. The first component of this tuple is the name under which the resulting definition will be saved in the current theory segment. The second component is a term giving the desired definition. The third component is a fixity (typically one of Binder, Infixl n, Infixr n, Suffix n, TruePrefix n or Closefix). The value returned by new_gen_definition is a theorem which states the definition requested by the user.

Let v_1,...,v_n be tuples of distinct variables, containing the variables x_1,...,x_m. Evaluating new_gen_definition flag (`name`, "c v_1 ... v_n = t"), where c is not already a constant, declares the sequent ({},"\v_1 ... v_n. t") to be a definition in the current theory, and declares c to be a new constant in the current theory with this definition as its specification. This constant specification is returned as a theorem, generally of the form |- !x_1 ... x_m. c v_1 ... v_n = t , and is saved in the current theory under (the name) name. If flag is `infix` or `binder`, the constant is given infix or binder status accordingly. Optionally, the definitional term argument may have any of its variables universally quantified.

FAILURE

new_gen_definition fails if there is already an axiom, definition or specification of the given name in an ancestral theory segment; if c is not an allowed name for a constant; if t contains free variables that are not in any of the variable structures v_1, ..., v_n (this is equivalent to requiring \v_1 ... v_n. t to be a closed term); or if any variable occurs more than once in v_1, ..., v_n. Finally, failure occurs if there is a type variable in v_1, ..., v_n or t that does not occur in the type of c.

SEEALSO  DEF_EXISTS_RULE,   new_binder_definition,   new_definition,   new_infix_definition,   new_specification

HOL  Kananaskis 0