Skip to content

Extensionality Tactic does not seem to be running the Obligation Tactic as implied by error message #708

@Durbatuluk1701

Description

@Durbatuluk1701

This is not quite a self-contained example but hopefully is enough to justify the issue. Essentially, when trying Unset Equation With Funext and defining a Local Obligation Tactic that is sufficient to solve the extensionality proof automatically, Equations will still throw a warning with "Solve Obligations tactic return error: Tactic failure: Could not prove extensionality automatically".

Here is an example:

  (* Local Obligation Tactic := ... *)
  Equations? dfs_aux (g : t) (stack : list K.t) (visited : KSet.t)
      : KSet.t
      by wf (KSet.cardinal (KSet.diff (vertices g) visited), length stack)
          (lexprod _ _ lt lt) :=

    dfs_aux g []        visited := visited;

    dfs_aux g (v :: vs) visited :=
      match KSet.mem visited v as Hvis return KSet.mem visited v = Hvis -> _ with
      | true => fun _ =>
        dfs_aux g vs visited
      | false =>
        fun Hviseq =>
        match has_vertex g v as HV return has_vertex g v = HV -> _ with
        | true => fun _ =>
          let visited' := KSet.add visited v in
          let neighbors := KSet.to_list (nodes_out g v) in
          dfs_aux g (neighbors ++ vs) visited'
        | false =>
          fun _ =>
          dfs_aux g vs (KSet.add visited v)
        end eq_refl
      end eq_refl.
  + left.
    apply KSet.cardinal_diff_add_lt.
    - rewrite <- has_vertex_vertices. assumption.
    - assumption.
  + assert (Hnotin: KSet.mem (vertices g) v = false).
    { rewrite <- has_vertex_vertices. assumption. }
    rewrite (KSet.cardinal_diff_add_notin _ _ _ Hnotin).
    right. simpl. lia.
  Qed.
  (*
  Solve Obligations tactic returned error: Tactic failure: Could not prove extensionality automatically.
    This will become an error in the future
    [solve_obligation_error,tactics,default]
    1 obligation remaining
    Obligation 1 of dfs_aux_unfold_eq:
    (forall (g : t) (stack : list K.t) (visited : KSet.t),
    dfs_aux g stack visited = dfs_aux_unfold g stack visited).
  *)
  Obligations.
  (*
  1 obligation(s) remaining: 
  Obligation 1 of dfs_aux_unfold_eq:
  (forall (g : t) (stack : list K.t) (visited : KSet.t),
  dfs_aux g stack visited = dfs_aux_unfold g stack visited).
  *)
  (* You could just use "Solve All Obligations." now or *)
  Next Obligation.
  (*
    dfs_aux_unfold_eq (remaining: 1/1)
      dfs_aux_unfold_eq_obligation: (solved: pending) (loc : )
  *)
  Defined.

Note how Solve All Obligations (or just opening and immediately closing the Obligation) is sufficient to solve it (thus my belief that the Solve Obligations tactic can in fact solve the extensionality proof), but it still throws this warning.

It is not necessarily critical because ultimately it still works, but it is sort of an ugly warning during compilation I would like to try to avoid.


Another interesting thing: if a From Equations.Prop Require Import Tactics. is removed from the file, then the warning changes to Solve Obligations tactic returned error: Tactic failure: Equations.Init.unfold_recursor has not been bound yet., but basically nothing else changes AFAICT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions