anchor.diff:      (* ------------------------------------------------------------------------- *)
       (* Return all the defined types.                                             *)
       (* ------------------------------------------------------------------------- *)
  +
       let types() = !the_type_constants
   
       (* ------------------------------------------------------------------------- *)
       (* Lookup function for type constants. Returns arity if it succeeds.         *)
       (* ------------------------------------------------------------------------- *)
  +
       let get_type_arity s = assoc s (!the_type_constants)
   
       (* ------------------------------------------------------------------------- *)
       (* Declare a new type.                                                       *)
       (* ------------------------------------------------------------------------- *)
  +
       let new_type(name, arity) = 
           if can get_type_arity name
           then failwith("new_type: type " ^ name ^ " has already been declared")
  
positive.code: (* ------------------------------------------------------------------------- *)
  (* Tests for alpha-convertibility (equality ignoring names in abstractions). *)
  (* ------------------------------------------------------------------------- *)
  let aconv s t = alphaorder s t = 0
  
  (* ------------------------------------------------------------------------- *)
  (* Comparison function on theorems. Currently the same as equality, but      *)
  (* it's useful to separate because in the proof-recording version it isn't.  *)
  (* ------------------------------------------------------------------------- *)
  let equals_thm th th' = dest_thm th = dest_thm th'
  
  
negative.code:     (* ------------------------------------------------------------------------- *)
      (* Finds the variables free in a term (list of terms).                       *)
      (* ------------------------------------------------------------------------- *)
  
      let rec frees tm = 
          match tm with
          | Var(_, _) -> [tm]
  