anchor.diff:      | [] -> fail "No more goals (1)"
       | hd::tl -> ret hd)
   
  -let add_irrelevant_goal (env:env) (phi:typ) opts : tac<unit> =
  +let mk_irrelevant_goal (env:env) (phi:typ) opts : tac<goal> =
       let typ = U.mk_squash phi in
       bind (new_uvar env typ) (fun u ->
       let goal = { context = env; witness = u; goal_ty = typ; opts = opts } in
  +    ret goal)
  +
  +let add_irrelevant_goal env phi opts : tac<unit> =
  +    bind (mk_irrelevant_goal env phi opts) (fun goal ->
       add_goals [goal])
  +
  +let push_irrelevant_goal env phi opts : tac<unit> =
  +    bind (mk_irrelevant_goal env phi opts) (fun goal ->
  +    push_goals [goal])
  +
  +let istrivial (e:env) (t:term) : bool =
  +    let steps = [N.Reify; N.UnfoldUntil Delta_constant; N.Primops; N.Simplify; N.UnfoldTac] in
  +    let t = normalize steps e t in
  +    is_true t
  +
  +let trivial : tac<unit> =
  +    bind cur_goal (fun goal ->
  +    if istrivial goal.context goal.goal_ty
  +    then (solve goal U.exp_unit; dismiss)
  +    else fail1 "Not a trivial goal: %s" (Print.term_to_string goal.goal_ty)
  +    )
  +
  +let add_goal_from_guard (e:env) (g : guard_t) opts : tac<unit> =
  +    match (Rel.simplify_guard e g).guard_f with
  +    | TcComm.Trivial -> ret ()
  +    | TcComm.NonTrivial f ->
  +        push_irrelevant_goal e f opts
   
   let smt : tac<unit> =
       bind cur_goal (fun g ->
  
positive.code: // solving any of these two goals. In any case, if ?u is not solved, we fail afterwards.
  let rec __apply (uopt:bool) (tm:term) (typ:typ) : tac<unit> =
      bind cur_goal (fun goal ->
      bind (trytac (exact tm)) (fun r ->
      match r with
      | Some r -> ret r // if tm is a solution, we're done
      | None ->
  
negative.code:                                  (Print.term_to_string (U.mk_squash post))
                                   (Print.term_to_string goal.goal_ty)
      | Some g ->
          let solution = S.mk_Tm_app tm uvs None goal.context.range in
          let implicits = implicits.implicits |> List.filter (fun (_, _, _, tm, _, _) ->
               let hd, _ = U.head_and_args tm in
  