anchor.diff:                                                   | Cut as e -> nestedFailwith e "expand_goal"
                                                    | Failure _ as e -> 
                                                        nestedFailwith e "expand_goal")))
  +
           and expand_goals depth (gl, (insts, offset, size as tup)) cont = 
               match gl with
               | [] -> cont([], tup)
  
positive.code:                     Disj(fl, fr)
                  with
                  | Failure _ -> Atom(fol_of_literal env consts tm)
      (* ----------------------------------------------------------------------- *)
      (* Further translation functions for HOL formulas.                         *)
      (* ----------------------------------------------------------------------- *)
      let rec hol_of_term tm = 
          match tm with
          | Fvar v -> hol_of_var v
          | Fnapp(f, args) -> list_mk_comb(hol_of_const f, map hol_of_term args)
      let hol_of_atom(p, args) = 
          list_mk_comb(hol_of_const p, map hol_of_term args)
      let hol_of_literal(p, args) = 
          if p < 0
          then Choice.get <| mk_neg(hol_of_atom(-p, args))
          else hol_of_atom(p, args)
      (* ----------------------------------------------------------------------- *)
      (* Versions of shadow syntax operations with variable bumping.             *)
      (* ----------------------------------------------------------------------- *)
      let rec fol_free_in v tm = 
          match tm with
          | Fvar x -> x = v
          | Fnapp(_, lis) -> exists (fol_free_in v) lis
      let rec fol_subst theta tm = 
          match tm with
          | Fvar v -> rev_assocd v theta tm
          | Fnapp(f, args) -> 
              let args' = qmap (fol_subst theta) args
              if args' == args
              then tm
              else Fnapp(f, args')
      let fol_inst theta ((p, args) as at : fol_atom) = 
          let args' = qmap (fol_subst theta) args
          if args' == args
          then at
          else p, args'
      let rec fol_subst_bump offset theta tm = 
          match tm with
          | Fvar v -> 
              if v < offinc
              then 
                  let v' = v + offset
                  rev_assocd v' theta (Fvar(v'))
              else rev_assocd v theta tm
          | Fnapp(f, args) -> 
              let args' = qmap (fol_subst_bump offset theta) args
              if args' == args
              then tm
              else Fnapp(f, args')
      let fol_inst_bump offset theta ((p, args) as at : fol_atom) = 
          let args' = qmap (fol_subst_bump offset theta) args
          if args' == args
          then at
          else p, args'
      (* ----------------------------------------------------------------------- *)
      (* Main unification function, maintaining a "graph" instantiation.         *)
      (* We implicitly apply an offset to Choice.get <| variables in the second term, so this  *)
      (* is not symmetric between the arguments.                                 *)
      (* ----------------------------------------------------------------------- *)
      let rec istriv env x t = 
          match t with
          | Fvar y -> 
  
negative.code:         let newhyps = map mk_ihyp hyps
          inferences := !inferences + 1
          newhyps, (globin, offset + offinc, size - length hyps)
  
      (* ----------------------------------------------------------------------- *)
      (* Perform first basic expansion which allows continuation call.           *)
      (* ----------------------------------------------------------------------- *)
  
      let meson_expand_cont loffset rules state cont = 
          // NOTE: wrong use of Some, need to change this
          tryfind (fun r -> Some <| cont (snd r) (meson_single_expand loffset r state)) rules
  