anchor.diff:      (* ------------------------------------------------------------------------- *)
       (* Syntax operations for equations.                                          *)
       (* ------------------------------------------------------------------------- *)
  +
       let safe_mk_eq l r = 
           let ty = type_of l
           Comb(Comb(Const("=", Tyapp("fun", [ty
  
positive.code:     (* ------------------------------------------------------------------------- *)
      (* Basic type destructors.                                                   *)
      (* ------------------------------------------------------------------------- *)
      let dest_type = 
          function 
          | (Tyapp(s, ty)) -> s, ty
  
negative.code:     (* ------------------------------------------------------------------------- *)
      (* Whether a variable (or constant in fact) is free in a term.               *)
      (* ------------------------------------------------------------------------- *)
  
      let rec vfree_in v tm = 
          match tm with
          | Abs(bv, bod) -> v <> bv && vfree_in v bod
          | Comb(s, t) -> vfree_in v s || vfree_in v t
          | _ -> compare tm v = 0
  
      (* ------------------------------------------------------------------------- *)
      (* Finds the type variables (free) in a term.                                *)
      (* ------------------------------------------------------------------------- *)
  
      let rec type_vars_in_term tm = 
          match tm with
          | Var(_, ty) -> tyvars ty
  