Compat.new_infix_prim_rec_definition : (string * term) -> thm

SYNOPSIS
Defines an infix primitive recursive function over the type num.

LIBRARY
hol88

DESCRIBE
The function new_infix_prim_rec_definition provides the facility for defining primitive recursive functions with infix status on the type num. It takes a pair argument, consisting of the name under which the resulting definition will be saved in the current theory segment, and a term giving the desired definition. The value returned by new_infix_prim_rec_definition is a theorem which states the definition requested by the user. This theorem is derived by formal proof from an instance of the theorem num_Axiom:
   |- !e f. ?! fn. (fn 0 = e) /\ (!n. fn(SUC n) = f(fn n)n)
Evaluating
   new_infix_prim_rec_definition
    ("fun_DEF",
      Term `(fun 0 x = f_1[x]) /\
            (fun (SUC n) x = f_2[fun n x', n, x])`);
where all the free variables in the term x' are contained in {n,x}, automatically proves the theorem:
   |-  ?fun. !x. fun 0 x = f_1[x] /\
             !x. fun (SUC n) x = f_2[fun n x', n, x]
and then declares a new constant fun with this property and infix status as its specification. This constant specification is returned as a theorem and is saved with name fun_DEF in the current theory segment.

The ML function new_infix_prim_rec_definition is, in fact, slightly more general than is indicated above. In particular, a curried primitive recursive function can be defined by primitive recursion on either one of its arguments using this ML function. The ML function new_infix_prim_rec_definition also allows the user to partially specify the value of a function defined (possibly recursively) on the natural numbers by giving its value for only one of 0 or SUC n.

FAILURE
Failure occurs if HOL cannot prove there is a function satisfying the specification (ie. if the term supplied to new_prim_rec_definition is not a well-formed primitive recursive definition); if the type of fun is not of the form ty_1->ty_2->ty_3, or if any other condition for making a constant specification is violated (see the failure conditions for new_specification). The function will not be accessible unless the hol88 library has been loaded.

EXAMPLE
Here is the recursive definition of the constant + used by the system:
   new_infix_prim_rec_definition
    ("ADD",
     (--`($+ 0 n = n) /\
         ($+ (SUC m) n = SUC($+ m n))`--))
The $'s are there (as documentation) to indicate that the constant + is being declared to be an infix. Evaluating this ML expression will create the following constant specification in the current theory segment:
   ADD = |- (!n. 0 + n = n) /\ (!m n. (SUC m) + n = SUC(m + n))

COMMENTS
new_infix_prim_rec_definition has been superceded by new_recursive_definition and Define.

SEEALSO  new_definition,   new_infixl_definition,   new_infixr_definition,   new_recursive_definition,   new_type_definition,   new_specification,   num_Axiom,   Define

HOL  Kananaskis 0