anchor.diff:      (* Type and term instantiation.                                              *)
       (* ------------------------------------------------------------------------- *)
   
  +    /// Instantiates types in a theorem.
       let INST_TYPE theta (Sequent(asl, c)) = 
           let inst_fn = inst theta
           Sequent(term_image inst_fn asl, inst_fn c)
       
  +    /// Instantiates free variables in a theorem.
       let INST theta (Sequent(asl, c)) = 
           let inst_fun = vsubst theta
           Sequent(term_image inst_fun asl, inst_fun c)
  
positive.code:     (* 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")
          else the_type_constants := (name, arity) :: (!the_type_constants)
  
negative.code:     (* ------------------------------------------------------------------------- *)
  
      let the_axioms = ref([] : thm list)
      /// Returns the current set of axioms.
      let axioms() = !the_axioms
      
      /// Sets up a new axiom.
      let new_axiom tm = 
          if compare (type_of tm) bool_ty = 0 then 
              let th = Sequent([], tm)
  