Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search gives Error: Anomaly "Uncaught exception Not_found." #17963

Closed
JasonGross opened this issue Aug 17, 2023 · 11 comments · Fixed by #17987
Closed

Search gives Error: Anomaly "Uncaught exception Not_found." #17963

JasonGross opened this issue Aug 17, 2023 · 11 comments · Fixed by #17987
Labels
kind: anomaly An uncaught exception has been raised.
Milestone

Comments

@JasonGross
Copy link
Member

Description of the problem

File "./theories/bug_search_anom_not_found_03.v", line 176, characters 4-52:
Error: Anomaly "Uncaught exception Not_found."
Please report at http://coq.inria.fr/bugs/.
Raised at Int.Map.find in file "clib/int.ml", line 39, characters 14-29
Called from Evd.find in file "engine/evd.ml", line 664, characters 29-56
Called from Evd.expand_existential in file "engine/evd.ml", line 725, characters 21-35
Called from Namegen.visible_ids.visible_ids in file "engine/namegen.ml", line 314, characters 16-47
Called from CArray.Fun1.iter in file "clib/cArray.ml", line 664, characters 6-13
Called from CArray.Fun1.iter in file "clib/cArray.ml", line 664, characters 6-13
Called from CArray.Fun1.iter in file "clib/cArray.ml", line 664, characters 6-13
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 542, characters 20-25
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Constr.iter_with_binders in file "kernel/constr.ml", line 545, characters 17-22
Called from Namegen.visible_ids in file "engine/namegen.ml", line 321, characters 11-26
Called from Namegen.next_ident_away_for_default_printing in file "engine/namegen.ml", line 419, characters 16-39
Called from Namegen.compute_displayed_name_in_gen_poly in file "engine/namegen.ml", line 468, characters 19-65
Called from Namegen.compute_displayed_name_in in file "engine/namegen.ml" (inlined), line 471, characters 32-74
Called from Detyping.Avoid.compute_name in file "pretyping/detyping.ml", line 159, characters 9-73
Called from Detyping.detype_binder in file "pretyping/detyping.ml", line 1004, characters 9-77
Called from CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml", line 36, characters 4-11
Called from DAst.get in file "lib/dAst.ml" (inlined), line 27, characters 12-25
Called from Notation_ops.match_ in file "interp/notation_ops.ml", line 1418, characters 8-19
Called from Stdlib__List.fold_left2 in file "list.ml", line 153, characters 37-51
Called from Notation_ops.match_notation_constr in file "interp/notation_ops.ml", line 1671, characters 14-113
Called from Constrextern.extern_notation in file "interp/constrextern.ml", line 1250, characters 10-74
Called from Constrextern.extern in file "interp/constrextern.ml", line 909, characters 6-48
Called from CList.map_loop in file "clib/cList.ml", line 291, characters 21-24
Called from CList.map in file "clib/cList.ml", line 299, characters 4-18
Called from Constrextern.extern_notation in file "interp/constrextern.ml", line 1268, characters 20-271
Called from Constrextern.extern in file "interp/constrextern.ml", line 909, characters 6-48
Called from Printer.pr_letype_env in file "printing/printer.ml", line 93, characters 28-80
Called from Printer.pr_ltype_env in file "printing/printer.ml" (inlined), line 98, characters 2-74
Called from ComSearch.interp_search.pr_search in file "vernac/comSearch.ml", line 134, characters 17-63
Called from Search.iter_priority_queue in file "vernac/search.ml", line 159, characters 4-22
Called from ComSearch.interp_search in file "vernac/comSearch.ml", line 145, characters 6-139
Called from Vernacextend.vtreadproofopt.(fun) in file "vernac/vernacextend.ml", line 159, characters 29-44
Called from Vernacinterp.interp_typed_vernac in file "vernac/vernacinterp.ml", line 21, characters 20-113
Called from Vernacinterp.interp_control.(fun) in file "vernac/vernacinterp.ml", line 186, characters 24-113
Called from Flags.with_modified_ref in file "lib/flags.ml", line 17, characters 14-17
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Vernacinterp.interp_gen in file "vernac/vernacinterp.ml", line 230, characters 16-41
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Vernacinterp.interp in file "vernac/vernacinterp.ml", line 244, characters 15-72
Called from Stm.Reach.known_state.reach.(fun) in file "stm/stm.ml", line 2185, characters 16-43
Called from Stm.State.define in file "stm/stm.ml", line 965, characters 6-10
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Stm.Reach.known_state.reach in file "stm/stm.ml", line 2327, characters 4-105
Called from Stm.observe in file "stm/stm.ml", line 2424, characters 4-60
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Vernac.interp_vernac in file "toplevel/vernac.ml", line 79, characters 29-50
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Flags.with_modified_ref in file "lib/flags.ml", line 17, characters 14-17
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Util.try_finally in file "lib/util.ml", line 133, characters 16-19
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Util.try_finally in file "lib/util.ml", line 137, characters 6-32
Called from Vernac.load_vernac_core.loop in file "toplevel/vernac.ml", line 121, characters 8-352
Called from Vernac.load_vernac_core in file "toplevel/vernac.ml", line 134, characters 6-19
Re-raised at Exninfo.iraise in file "clib/exninfo.ml", line 81, characters 4-38
Called from Vernac.load_vernac in file "toplevel/vernac.ml", line 210, characters 30-83
Called from Ccompile.compile in file "toplevel/ccompile.ml", line 70, characters 18-78
Called from Ccompile.compile in file "toplevel/ccompile.ml" (inlined), line 126, characters 2-59
Called from Ccompile.compile_file in file "toplevel/ccompile.ml", line 135, characters 4-61
Called from Coqc.coqc_main in file "toplevel/coqc.ml", line 48, characters 2-100
Called from Coqc.coqc_run in file "toplevel/coqc.ml", line 67, characters 4-36

Coq Version

8.19+alpha 61ee398

@JasonGross JasonGross added the kind: anomaly An uncaught exception has been raised. label Aug 17, 2023
@JasonGross
Copy link
Member Author

@coqbot minimize coq.dev

git clone https://github.com/JasonGross/neural-net-coq-interp.git --branch=zzz-bug-anomaly-search
cd neural-net-coq-interp
make theories/bug_search_anom_not_found_03.vo -j2

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

@JasonGross, Minimized File /github/workspace/neural-net-coq-interp/theories/bug_search_anom_not_found_03.v (full log on GitHub Actions)

Partially Minimized Coq File (could not inline NeuralNetInterp.TransformerLens.HookedTransformer)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "+implicit-core-hint-db,+implicits-in-term,+non-reversible-notation,+deprecated-intros-until-0,+deprecated-focus,+unused-intro-pattern,+variable-collision,+unexpected-implicit-declaration,+omega-is-deprecated,+deprecated-instantiate-syntax,+non-recursive,+undeclared-scope,+deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,+deprecated-typeclasses-transparency-without-locality,-ltac2-missing-notation-var,unsupported-attributes" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/neural-net-coq-interp/theories" "NeuralNetInterp" "-Q" "/github/workspace/cwd" "Top" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Bignums" "Bignums" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "NeuralNetInterp.bug_search_anom_not_found_03") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 220 lines to 39 lines, then from 52 lines to 522 lines, then from 524 lines to 229 lines, then from 699 lines to 216 lines, then from 228 lines to 118 lines, then from 131 lines to 665 lines, then from 670 lines to 135 lines, then from 148 lines to 1326 lines, then from 1331 lines to 173 lines, then from 186 lines to 788 lines, then from 794 lines to 190 lines, then from 204 lines to 663 lines, then from 668 lines to 216 lines, then from 230 lines to 364 lines, then from 370 lines to 216 lines, then from 230 lines to 992 lines, then from 995 lines to 246 lines, then from 260 lines to 453 lines, then from 455 lines to 265 lines, then from 279 lines to 349 lines, then from 354 lines to 275 lines, then from 289 lines to 326 lines, then from 332 lines to 277 lines, then from 283 lines to 278 lines *)
(* coqc version 8.19+alpha compiled with OCaml 4.13.1
   coqtop version buildkitsandbox:/home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-core.dev/_build/default,master (61ee398ed32f9334dd664ea8ed2697178e6e3844)
   Modules that could not be inlined: NeuralNetInterp.TransformerLens.HookedTransformer
   Expected coqc runtime on this file: 1.021 sec *)
Require NeuralNetInterp.TransformerLens.HookedTransformer.

Module Export Hetero.

Definition relation A B := A -> B -> Prop.

Module Export NeuralNetInterp_DOT_Util_DOT_Program_DOT_Basics_DOT_Dependent_WRAPPED.
Module Export Dependent.
Import Coq.Program.Basics.
Declare Scope type_function_scope.
Delimit Scope type_function_scope with type_function.

Definition type_function := Type -> Type.
Notation "F ∘ G" := (fun A : Type => F%type_function (G%type_function A)) : type_function_scope.

End Dependent.

End NeuralNetInterp_DOT_Util_DOT_Program_DOT_Basics_DOT_Dependent_WRAPPED.
Module Export NeuralNetInterp_DOT_Util_DOT_Relations_DOT_Relation_Definitions_DOT_Dependent_WRAPPED.
Module Export Dependent.
Declare Scope dependent_signature_scope.

Definition relation (F : type_function)
  := forall A B, Hetero.relation A B -> Hetero.relation (F A) (F B).

Module Export RelationsNotations.
  Delimit Scope dependent_signature_scope with dependent_signature.
  Bind Scope dependent_signature_scope with relation.

  Notation "R ∘ R'" := (fun (A B : Type) (RAB : Hetero.relation A B) => R%dependent_signature _ _ (R'%dependent_signature A B RAB)) : dependent_signature_scope.
End RelationsNotations.

End Dependent.

End NeuralNetInterp_DOT_Util_DOT_Relations_DOT_Relation_Definitions_DOT_Dependent_WRAPPED.
Module Export Dependent.

Section Proper.
  Context {F : Type -> Type}.

  Class Proper (R : Dependent.relation F) (m : forall T, F T) : Prop :=
    proper_prf : forall {A B} (R0 : Hetero.relation A B), R A B R0 (m A) (m B).
Definition respectful_hetero {A : Type -> Type} {B : forall x, A x -> Type}
    (R : Dependent.relation A)
    (R' : forall x y, Hetero.relation x y -> forall x' y', Hetero.relation (B x x') (B y y'))
    : Dependent.relation (fun T => forall a : A T, B T a).
exact (fun a0 b0 R0 f g => forall x y, R _ _ R0 x y -> R' _ _ R0 _ _ (f x) (g y)).
Defined.

  Definition respectful {A B : Type -> Type} (R : Dependent.relation A) (R' : Dependent.relation B) : Dependent.relation (fun T => A T -> B T)
    := Eval cbv [respectful_hetero] in
      @respectful_hetero A (fun T _ => B T) R (fun x y R0 _ _ => R' x y R0).
End Proper.

Module Export ProperNotations.

  Notation " R ==> R' " := (@respectful _ _ (R%dependent_signature) (R'%dependent_signature))
    (right associativity, at level 55) : dependent_signature_scope.

End ProperNotations.

Notation idR := (fun (A B : Type) (R : Hetero.relation A B) => R).
Notation const R := (match _ as F return forall A B, Hetero.relation A B -> Hetero.relation F F with
                     | F => fun (A B : Type) (_ : Hetero.relation A B) => R
                     end) (only parsing).

Module Export Option.

Section Relations.
  Definition option_eq {A B} eq (x : option A) (y : option B) :=
    match x with
    | None    => y = None
    | Some ax => match y with
                 | None => False
                 | Some ay => eq ax ay
                 end
    end.
End Relations.
Definition invert_Some {A} (x : option A)
  : (if x then A else unit).
Admitted.

#[export] Instance invert_Some_Proper_dep
  : Dependent.Proper
      (@Dependent.respectful_hetero
         (fun T => option T)
         (fun T (x : option T) => if x then _ else _)
         (@option_eq)
         (fun A B R x y => match x, y with
                           | Some _, Some _ => R
                           | None, None => fun _ _ => True
                           | Some _, None | None, Some _ => fun _ _ => False
                           end))
      (@invert_Some).
Admitted.

Module Export NeuralNetInterp_DOT_Torch_DOT_Tensor_DOT_Instances_WRAPPED.
Module Export Instances.
Import NeuralNetInterp.Torch.Tensor.

Module Export Tensor.
Definition eqfR_rank {r} : Dependent.relation (@tensor_of_rank r).
exact (fun A B R x y => forall i, R (x i) (y i)).
Defined.
Definition eqfR {r s} : Dependent.relation (@tensor r s).
exact (eqfR_rank).
Defined.
  #[global] Arguments eqfR {r s} [A B] R x y.
  Notation eqf := (eqfR eq).

  End Tensor.

End Instances.

End NeuralNetInterp_DOT_Torch_DOT_Tensor_DOT_Instances_WRAPPED.
Module Export Instances.
Import NeuralNetInterp.TransformerLens.HookedTransformer.

Module Export HookedTransformer.
Definition block_params_type_genR n_heads d_model d_head nt : Dependent.relation (block_params_type_gen n_heads d_model d_head nt).
Admitted.

  Module Export HookedTransformer.

    #[export] Instance masked_attn_scores_Proper_dep {d_vocab n_heads d_model d_head n_ctx r batch pos normalization_type}
      : Dependent.Proper
          (Dependent.idR
             ==> (Dependent.const eq ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR)
             ==> Dependent.const (fun _ _ => True)
             ==> Dependent.idR
             ==> Tensor.eqfR
             ==> Tensor.eqfR
             ==> List.Forall2 ∘ @block_params_type_genR n_heads d_model d_head normalization_type
             ==> Dependent.const eq
             ==> Dependent.const Tensor.eqf
             ==> @option_eq ∘ Tensor.eqfR)
          (@HookedTransformer.HookedTransformer.masked_attn_scores d_vocab n_heads d_model d_head n_ctx r batch pos normalization_type).
Admitted.
  End HookedTransformer.
End HookedTransformer.

End Instances.
Module Export Parameters.
Import Coq.Floats.Floats.
Import Coq.NArith.NArith.
Import NeuralNetInterp.TransformerLens.HookedTransformer.Config.Common.
Local Open Scope float_scope.

Module cfg <: CommonConfig.
  Definition d_model := 32%N.
  Definition n_ctx := 2%N.
  Definition d_head := 32%N.
  Definition n_heads := 1%N.
  Definition d_vocab := 64%N.
  Definition eps := 1e-05.
  Definition normalization_type := Some LN.
  Definition d_vocab_out := 64%N.
End cfg.

End Parameters.
Import Coq.Floats.Floats.
Import Coq.QArith.QArith.
Import Coq.Lists.List.
Import NeuralNetInterp.Util.Default.
Import NeuralNetInterp.Util.Pointed.
Import NeuralNetInterp.Util.Arith.Classes.
Import NeuralNetInterp.Util.Arith.Instances.
Import NeuralNetInterp.Torch.Tensor.
Import NeuralNetInterp.TransformerLens.HookedTransformer.
Import Instances.Truncating.

Module Model (cfg : Config).

  Module Export HookedTransformer.
    Section __.
      Context {r} {batch : Shape r} {pos}
        (s := (batch ::' pos)%shape)
        (resid_shape := (s ::' cfg.d_model)%shape)
        {A} {coer_float : has_coer float A} {coerZ : has_coer Z A}
        {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
        {sqrtA : has_sqrt A} {expA : has_exp A}
        {use_checkpoint : with_default "use_checkpoint" bool true}.
Let coerA' (x : float) : A.
Admitted.
      #[local] Coercion coerA' : float >-> A.
Let coer_ln_tensor : cfg.ln_tensor float -> cfg.ln_tensor A.
Admitted.
      Definition coer_blocks_params
        := List.map
             (fun '((W_Q, W_K, W_V, W_O,
                      b_Q, b_K, b_V, b_O,
                      ln1_w, ln1_b) : cfg.block_params_type float)
              => ((W_Q:tensor _ A), (W_K:tensor _ A), (W_V:tensor _ A), (W_O:tensor _ A),
                   (b_Q:tensor _ A), (b_K:tensor _ A), (b_V:tensor _ A), (b_O:tensor _ A),
                   coer_ln_tensor ln1_w, coer_ln_tensor ln1_b)).
Local Definition masked_attn_scores (n : nat) (tokens : tensor s IndexType)
        : option (tensor (batch ::' cfg.n_heads ::' pos ::' pos) A).
exact (HookedTransformer.HookedTransformer.masked_attn_scores
             (A:=A) (n_ctx:=cfg.n_ctx) (normalization_type:=cfg.normalization_type)cfg.eps
             cfg.W_E cfg.W_pos
             (coer_blocks_params cfg.blocks_params)
             n tokens).
Defined.
    End __.
  End HookedTransformer.
End Model.
Import ListNotations.

Module cfg <: Config.
  Include Parameters.cfg.
  Parameter W_E : tensor [d_vocab; d_model] float.
  Parameter W_pos : tensor [n_ctx; d_model] float.
  Parameter W_U : tensor [d_model; d_vocab_out] float.
  Parameter b_U : tensor [d_vocab_out] float.
  Notation ln_tensor A := (ln_tensor_gen d_model normalization_type A).
  Parameter ln_final_w : ln_tensor float.
  Parameter ln_final_b : ln_tensor float.
  Notation block_params_type A := (block_params_type_gen n_heads d_model d_head normalization_type A).
  Parameter block_params : block_params_type float.
  Definition blocks_params := [block_params].
End cfg.
  Include Model cfg.

  Section with_batch.
    Context {r} {batch : Shape r} {pos}
      (s := (batch ::' pos)%shape)
      (resid_shape := (s ::' cfg.d_model)%shape)
      {return_per_token : with_default "return_per_token" bool false}
      {A} {coer_float : has_coer float A} {coerZ : has_coer Z A}
      (defaultA : pointed A := @coer _ _ coerZ point)
      {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
      {ltbA : has_ltb A}
      {oppA : has_opp A} {sqrtA : has_sqrt A} {expA : has_exp A} {lnA : has_ln A}
      {use_checkpoint : with_default "use_checkpoint" bool true}.
Definition masked_attn_scores (tokens : tensor s IndexType)
        : tensor (batch ::' cfg.n_heads ::' pos ::' pos) A.
exact (Option.invert_Some
           (HookedTransformer.masked_attn_scores (A:=A) 0 tokens)).
Defined.
  End with_batch.

  #[export] Instance masked_attn_scores_Proper_dep {r batch pos}
    : Dependent.Proper
        ((Dependent.const eq ==> Dependent.idR)
           ==> (Dependent.const eq ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR)
           ==> Dependent.const (fun _ _ => True)
           ==> Dependent.const Tensor.eqf
           ==> Tensor.eqfR)
        (@masked_attn_scores r batch pos).
  Proof.
    cbv [masked_attn_scores].
    pose proof (@HookedTransformer.HookedTransformer.masked_attn_scores_Proper_dep) as H.
    repeat intro.
    repeat (let v := open_constr:(_) in specialize (H v)).
    move H at bottom.
    revert H.
    lazymatch goal with
    | [ |- ?R _ _ ?R'' ?x ?y -> ?R' (invert_Some ?x' ?i) (invert_Some ?y' ?i) ]
      => unify x x'; unify y y'; unify R'' R'; set (x'':=x); set (y'':=y);
         intro H;
         refine (@invert_Some_Proper_dep _ _ (Tensor.eqfR R') x y H i)
    end.
    Unshelve.
    Search HookedTransformer.block_params_type_genR.
Intermediate Coq File (useful for debugging if minimization did not go as far as you wanted) (truncated to 8.0KiB; full 31KiB file on GitHub Actions Artifacts under tmp.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "+implicit-core-hint-db,+implicits-in-term,+non-reversible-notation,+deprecated-intros-until-0,+deprecated-focus,+unused-intro-pattern,+variable-collision,+unexpected-implicit-declaration,+omega-is-deprecated,+deprecated-instantiate-syntax,+non-recursive,+undeclared-scope,+deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,+deprecated-typeclasses-transparency-without-locality,-ltac2-missing-notation-var,unsupported-attributes" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/neural-net-coq-interp/theories" "NeuralNetInterp" "-Q" "/github/workspace/cwd" "Top" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Bignums" "Bignums" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "NeuralNetInterp.bug_search_anom_not_found_03") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 220 lines to 39 lines, then from 52 lines to 522 lines, then from 524 lines to 229 lines, then from 699 lines to 216 lines, then from 228 lines to 118 lines, then from 131 lines to 665 lines, then from 670 lines to 135 lines, then from 148 lines to 1326 lines, then from 1331 lines to 173 lines, then from 186 lines to 747 lines *)
(* coqc version 8.19+alpha compiled with OCaml 4.13.1
   coqtop version buildkitsandbox:/home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-core.dev/_build/default,master (61ee398ed32f9334dd664ea8ed2697178e6e3844)
   Expected coqc runtime on this file: 0.000 sec *)
Require Coq.Init.Ltac.
Module Export AdmitTactic.
Module Import LocalFalse.
Inductive False : Prop := .
End LocalFalse.
Axiom proof_admitted : False.
Import Coq.Init.Ltac.
Tactic Notation "admit" := abstract case proof_admitted.
End AdmitTactic.
Require NeuralNetInterp.Util.Classes.RelationPairs.Dependent.
Require NeuralNetInterp.Util.Option.
Require NeuralNetInterp.Torch.Tensor.Instances.
Require Coq.Arith.Arith.
Require Coq.Arith.Wf_nat.
Require Coq.Array.PArray.
Require Coq.Bool.Bool.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Floats.Floats.
Require Coq.Lists.List.
Require Coq.NArith.NArith.
Require Coq.Numbers.Cyclic.Int63.Sint63.
Require Coq.Numbers.Cyclic.Int63.Uint63.
Require Coq.PArith.PArith.
Require Coq.QArith.QArith.
Require Coq.QArith.Qabs.
Require Coq.QArith.Qround.
Require Coq.Reals.Reals.
Require Coq.Relations.Relation_Definitions.
Require Coq.Setoids.Setoid.
Require Coq.Strings.String.
Require Coq.Structures.Equalities.
Require Coq.Unicode.Utf8.
Require Coq.Wellfounded.Wellfounded.
Require Coq.ZArith.Wf_Z.
Require Coq.ZArith.ZArith.
Require Coq.micromega.Lia.
Require Coq.micromega.Lqa.
Require Ltac2.Init.
Require NeuralNetInterp.Util.Arrow.
Require NeuralNetInterp.Util.Classes.
Require NeuralNetInterp.Util.Notations.
Require NeuralNetInterp.Util.Tactics.DestructHyps.
Require NeuralNetInterp.Util.Tactics.Head.
Require Ltac2.Bool.
Require Ltac2.Constant.
Require Ltac2.Constr.
Require Ltac2.Constructor.
Require Ltac2.Evar.
Require Ltac2.FSet.
Require Ltac2.Float.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Int.
Require Ltac2.Ltac1.
Require Ltac2.Message.
Require Ltac2.Meta.
Require Ltac2.Proj.
Require Ltac2.Std.
Require Ltac2.String.
Require Ltac2.Uint63.
Require NeuralNetInterp.Util.Arith.Reals.Definitions.
Require NeuralNetInterp.Util.Arith.ZArith.
Require NeuralNetInterp.Util.Bool.
Require NeuralNetInterp.Util.Default.
Require NeuralNetInterp.Util.List.
Require NeuralNetInterp.Util.Tactics.BreakMatch.
Require Ltac2.Char.
Require Ltac2.Control.
Require Ltac2.Env.
Require Ltac2.FMap.
Require Ltac2.Printf.
Require NeuralNetInterp.Util.Arith.Classes.
Require NeuralNetInterp.Util.Monad.
Require NeuralNetInterp.Util.Nat.
Require NeuralNetInterp.Util.Tactics.DestructHead.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require NeuralNetInterp.Util.ErrorT.
Require NeuralNetInterp.Util.List.Proofs.
Require Ltac2.Array.
Require Ltac2.List.
Require Ltac2.Fresh.
Require NeuralNetInterp.TransformerLens.HookedTransformer.Config.Common.
Require Ltac2.Notations.
Require NeuralNetInterp.Util.Pointed.
Require NeuralNetInterp.Util.PolymorphicOption.
Require NeuralNetInterp.Util.Arith.QArith.
Require NeuralNetInterp.Util.Slice.
Require NeuralNetInterp.Util.Arith.FloatArith.Definitions.
Require Ltac2.Ltac2.
Require NeuralNetInterp.Util.Arith.Instances.
Require NeuralNetInterp.Util.Tactics2.Constr.
Require NeuralNetInterp.Util.Tactics2.Constr.Unsafe.MakeAbbreviations.
Require NeuralNetInterp.Util.Tactics2.FixNotationsForPerformance.
Require NeuralNetInterp.Util.Tactics2.Ident.
Require NeuralNetInterp.Util.Tactics2.List.
Require NeuralNetInterp.Util.Wf_Uint63.
Require NeuralNetInterp.Util.PArray.
Require NeuralNetInterp.Util.PArray.Proofs.
Require NeuralNetInterp.Torch.Tensor.
Require NeuralNetInterp.Torch.Slicing.
Require NeuralNetInterp.TransformerLens.HookedTransformer.Config.
Require NeuralNetInterp.Torch.Einsum.

Module NeuralNetInterp_DOT_TransformerLens_DOT_HookedTransformer_WRAPPED.
Module HookedTransformer.
Import Coq.Floats.Floats Coq.Numbers.Cyclic.Int63.Sint63 Coq.Numbers.Cyclic.Int63.Uint63 Coq.QArith.QArith Coq.micromega.Lia Coq.Lists.List Coq.Array.PArray Coq.Classes.Morphisms Coq.Classes.RelationClasses.
Import NeuralNetInterp.Util.Default NeuralNetInterp.Util.Pointed NeuralNetInterp.Util.PArray NeuralNetInterp.Util.List NeuralNetInterp.Util.Notations NeuralNetInterp.Util.Arith.Classes NeuralNetInterp.Util.Arith.Instances NeuralNetInterp.Util.Bool.
Import NeuralNetInterp.Torch.Tensor NeuralNetInterp.Torch.Einsum NeuralNetInterp.Torch.Slicing.
Export NeuralNetInterp.TransformerLens.HookedTransformer.Config.
Import Util.Nat.Notations.
Import Util.Wf_Uint63.LoopNotation.
Import NeuralNetInterp.Util.Wf_Uint63.
Import Util.Wf_Uint63.Reduction.
Import Arith.Instances.Truncating.
Local Open Scope float_scope.
Local Open Scope list_scope.
Set Implicit Arguments.
Import ListNotations.
Local Open Scope raw_tensor_scope.

Notation tensor_of_list ls := (Tensor.PArray.abstract (Tensor.PArray.concretize (Tensor.of_list ls))) (only parsing).

(*#[local] Notation FLOAT := float (only parsing). (* or Q *)*)

Module Embed.
  Section __.
    Context {r} {s : Shape r} {d_vocab d_model A}
      (W_E : tensor [d_vocab; d_model] A).

    Definition forward (tokens : tensor s IndexType) : tensor (s ::' d_model) A
      := (W_E.[tokens, :])%fancy_raw_tensor.
  End __.
End Embed.

Module Unembed.
  Section __.
    Context
      {r} {batch_pos : Shape r}
      {d_model d_vocab_out}
      {A} {addA : has_add A} {mulA : has_mul A} {zeroA : has_zero A}
      (W_U : tensor [d_model; d_vocab_out] A)
      (b_U : tensor [d_vocab_out] A).

    Definition forward (residual : tensor (batch_pos ::' d_model) A)
      : tensor (batch_pos ::' d_vocab_out) A
      := (Tensor.map'
            (fun residual : tensor [d_model] A
             => weaksauce_einsum {{{ {{ d_model, d_model vocab -> vocab }}
                        , residual
                        , W_U }}}
               : tensor [d_vocab_out] A)
            residual
          + broadcast b_U)%core.
  End __.
End Unembed.

Module PosEmbed.
  Section __.
    Context {r} {batch : Shape r} {tokens_length : ShapeType}
      {d_model} {n_ctx:N}
      (n_ctx' : int := n_ctx)
      {A}
      (W_pos : tensor [n_ctx'; d_model] A).

    Definition forward (tokens : tensor (batch ::' tokens_length) IndexType)
      : tensor (batch ::' tokens_length ::' d_model) A
      := repeat batch (W_pos.[:tokens_length, :]).
  End __.
End PosEmbed.

Module LayerNorm.
  Section __.
    Context {r} {s : Shape r} {d_model}
      {A}
      {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A} {sqrtA : has_sqrt A} {zeroA : has_zero A} {coerZ : has_coer Z A}
      {use_checkpoint : with_default "use_checkpoint" bool true}
      (defaultA : pointed A := @coer _ _ coerZ point)
      (eps : A) (w b : tensor [d_model] A).
    #[local] Existing Instance defaultA.
    #[local] Notation checkpoint x := (if use_checkpoint then PArray.checkpoint x else x%tensor).

    Definition linpart (x : tensor (s ::' d_mo
Build Log (contains the Coq error message) (truncated to last 8.0KiB; full 77KiB file on GitHub Actions Artifacts under build.log)
mer/Config.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/TransformerLens/HookedTransformer/Config.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.g2DwflGdSW
MINIMIZER_DEBUG: files:  theories/TransformerLens/HookedTransformer/Config.v
COQC theories/TransformerLens/HookedTransformer.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/TransformerLens/HookedTransformer.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.mVwLiqLxAL
MINIMIZER_DEBUG: files:  theories/TransformerLens/HookedTransformer.v
COQC theories/Torch/Slicing/Instances.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Slicing/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.Lgwm3UkxwB
MINIMIZER_DEBUG: files:  theories/Torch/Slicing/Instances.v
COQC theories/TransformerLens/HookedTransformer/Instances.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/TransformerLens/HookedTransformer/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.cQRc3euYdp
MINIMIZER_DEBUG: files:  theories/TransformerLens/HookedTransformer/Instances.v
COQC theories/bug_search_anom_not_found_03.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/bug_search_anom_not_found_03.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.QRNjSZsDpd
MINIMIZER_DEBUG: files:  theories/bug_search_anom_not_found_03.v
HookedTransformer.block_params_type_genR_refl_dep:
  forall {n_heads d_model d_head : ShapeType}
    {nt : with_default "normalization_type" (Some LN)},
  Dependent.Reflexive (HookedTransformer.block_params_type_genR (nt:=nt))
HookedTransformer.block_params_type_genR_refl:
  forall {n_heads d_model d_head : ShapeType}
    {nt : with_default "normalization_type" (Some LN)} 
    {A : Type} {R : relation A},
  Reflexive R -> Reflexive (HookedTransformer.block_params_type_genR R)
HookedTransformer.HookedTransformer.blocks_attn_masked_attn_scores_Proper_dep:
  forall {n_heads d_model d_head : ShapeType} {n_ctx : N} 
    {r : Rank} {batch : Shape r} {pos : ShapeType}
    {normalization_type : with_default "normalization_type" (Some LN)},
  Dependent.Proper
    ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
     ((fun (A B : Type) (_ : Hetero.relation A B) => eq) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     ((fun (A B : Type) (R : Hetero.relation A B) => R) ==>
      (fun (A B : Type) (R : Hetero.relation A B) => R)) ==>
     (fun (A B : Type) (_ : Hetero.relation A B)
        (_ _ : with_default "use_checkpoint" true) => True) ==>
     (fun (A B : Type) (R : Hetero.relation A B) => R) ==>
     Forall2
     ∘ HookedTransformer.block_params_type_genR (nt:=normalization_type) ==>
     Forall2 ∘ (Tensor.eqfR ==> Tensor.eqfR))
    (@HookedTransformer.HookedTransformer.blocks_attn_masked_attn_scores
       n_heads d_model d_head n_ctx r batch pos normalization_type)
File "./theories/bug_search_anom_not_found_03.v", line 219, characters 4-52:
Error: Anomaly "Uncaught exception Not_found."
Please report at http://coq.inria.fr/bugs/.

make[1]: *** [Makefile.coq:838: theories/bug_search_anom_not_found_03.vo] Error 129
make[1]: *** [theories/bug_search_anom_not_found_03.vo] Deleting file 'theories/bug_search_anom_not_found_03.glob'
make: *** [Makefile:37: invoke-coqmakefile] Error 2
Minimization Log (truncated to last 8.0KiB; full 906KiB file on GitHub Actions Artifacts under bug.log)
I will now attempt to replace Qeds with Admitteds
�[92m
Admitting Qeds successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qeds unsuccessful.
No successful changes.

I will now attempt to replace Qeds with admit. Defined.
�[92m
Admitting Qeds successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qeds unsuccessful.
No successful changes.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions

Non-fatal error: Failed to remove non-instance definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to admit [abstract ...]s
�[92m
Admitting [abstract ...] successful.�[0m
�[92m
Admitting [abstract ...] successful.�[0m
Admitting [abstract ...] unsuccessful.
Admitting [abstract ...] unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions

Non-fatal error: Failed to remove non-instance definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to replace Obligation with Admit Obligations
�[92m
Admitting Obligations successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Obligations unsuccessful.
No successful changes.

I will now attempt to admit lemmas with Admitted
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with Admitted

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmp0gp2qhpv/NeuralNetInterp/bug_search_anom_not_found_03.v", line 86, characters 10-52:
Error: The type of this term is a product while it is expected to be a sort.


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to admit lemmas with admit. Defined
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with admit. Defined

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmpe1d83n0j/NeuralNetInterp/bug_search_anom_not_found_03.v", line 48, characters 0-8:
Error:  (in proof respectful_hetero): Attempt to save a proof with given up
goals. If this is really what you want to do, use Admitted in place of Qed.


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to export modules
Module exportation unsuccessful.

I will now attempt to split imports and exports
Import/Export splitting unsuccessful.

I will now attempt to split := definitions
One-line definition splitting unsuccessful.

I will now attempt to remove all lines, one at a time
Line removal unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions

Non-fatal error: Failed to remove non-instance definitions and preserve the error.  
The new error was:
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpa1stzm9_/NeuralNetInterp/bug_search_anom_not_found_03.v", line 162, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to remove empty sections

No empty sections to remove.

Now, I will attempt to strip repeated newlines and trailing spaces from this file...

No strippable newlines or spaces.

If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.

cc @JasonGross

@JasonGross
Copy link
Member Author

@coqbot minimize coq.dev

git clone https://github.com/JasonGross/neural-net-coq-interp.git --branch=zzz-bug-anomaly-search
cd neural-net-coq-interp
make theories/bug_search_anom_not_found_03.vo -j2

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

@JasonGross, Minimized File /github/workspace/neural-net-coq-interp/theories/bug_search_anom_not_found_03.v (full log on GitHub Actions)

Partially Minimized Coq File (could not inline Ltac2.Array)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "+implicit-core-hint-db,+implicits-in-term,+non-reversible-notation,+deprecated-intros-until-0,+deprecated-focus,+unused-intro-pattern,+variable-collision,+unexpected-implicit-declaration,+omega-is-deprecated,+deprecated-instantiate-syntax,+non-recursive,+undeclared-scope,+deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,+deprecated-typeclasses-transparency-without-locality,-ltac2-missing-notation-var,unsupported-attributes" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/neural-net-coq-interp/theories" "NeuralNetInterp" "-Q" "/github/workspace/cwd" "Top" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Bignums" "Bignums" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "NeuralNetInterp.bug_search_anom_not_found_03") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 220 lines to 39 lines, then from 52 lines to 522 lines, then from 524 lines to 229 lines, then from 699 lines to 216 lines, then from 228 lines to 118 lines, then from 131 lines to 665 lines, then from 670 lines to 135 lines, then from 148 lines to 1326 lines, then from 1331 lines to 173 lines, then from 186 lines to 747 lines, then from 752 lines to 498 lines, then from 511 lines to 883 lines, then from 887 lines to 744 lines, then from 757 lines to 844 lines, then from 849 lines to 749 lines, then from 762 lines to 829 lines, then from 834 lines to 761 lines, then from 774 lines to 850 lines, then from 855 lines to 774 lines, then from 787 lines to 837 lines, then from 842 lines to 790 lines, then from 803 lines to 1422 lines, then from 1427 lines to 811 lines, then from 824 lines to 989 lines, then from 995 lines to 57 lines, then from 63 lines to 58 lines *)
(* coqc version 8.19+alpha compiled with OCaml 4.13.1
   coqtop version buildkitsandbox:/home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-core.dev/_build/default,master (61ee398ed32f9334dd664ea8ed2697178e6e3844)
   Modules that could not be inlined: Ltac2.Array
   Expected coqc runtime on this file: 0.121 sec *)
Require Ltac2.Control.

Module Export Pattern.

Import Ltac2.Init.

Ltac2 Type t := pattern.

Ltac2 Type context.

Ltac2 Type match_kind := [
| MatchPattern
| MatchContext
].

Ltac2 @ external empty_context : unit -> context :=
  "coq-core.plugins.ltac2" "pattern_empty_context".

Ltac2 @ external matches_vect : t -> constr -> constr array :=
  "coq-core.plugins.ltac2" "pattern_matches_vect".

Ltac2 @ external matches_subterm_vect : t -> constr -> context * constr array :=
  "coq-core.plugins.ltac2" "pattern_matches_subterm_vect".

Ltac2 lazy_match0 t pats :=
  let rec interp m := match m with
  | [] => Control.zero Match_failure
  | p :: m =>
    let next _ := interp m in
    let (knd, pat, f) := p in
    let p := match knd with
    | MatchPattern =>
      (fun _ =>
        let context := empty_context () in
        let bind := matches_vect pat t in
        fun _ => f context bind)
    | MatchContext =>
      (fun _ =>
        let (context, bind) := matches_subterm_vect pat t in
        fun _ => f context bind)
    end in
    Control.plus p next
  end in
  Control.once (fun () => interp pats) ().

Ltac2 Notation "lazy_match!" t(tactic(6)) "with" m(constr_matching) "end" :=
  Pattern.lazy_match0 t m.

  Ltac2 shape_to_list (c : constr) : constr list
    := let rec aux c acc
         := lazy_match! c with
            | Shape.nil => acc
            | Shape.snoc ?cs ?c
              => aux cs (c :: acc)
            end in
       aux c [].
Intermediate Coq File (useful for debugging if minimization did not go as far as you wanted) (truncated to 8.0KiB; full 45KiB file on GitHub Actions Artifacts under tmp.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "+implicit-core-hint-db,+implicits-in-term,+non-reversible-notation,+deprecated-intros-until-0,+deprecated-focus,+unused-intro-pattern,+variable-collision,+unexpected-implicit-declaration,+omega-is-deprecated,+deprecated-instantiate-syntax,+non-recursive,+undeclared-scope,+deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,+deprecated-typeclasses-transparency-without-locality,-ltac2-missing-notation-var,unsupported-attributes" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/neural-net-coq-interp/theories" "NeuralNetInterp" "-Q" "/github/workspace/cwd" "Top" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Bignums" "Bignums" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "NeuralNetInterp.bug_search_anom_not_found_03") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 220 lines to 39 lines, then from 52 lines to 522 lines, then from 524 lines to 229 lines, then from 699 lines to 216 lines, then from 228 lines to 118 lines, then from 131 lines to 665 lines, then from 670 lines to 135 lines, then from 148 lines to 1326 lines, then from 1331 lines to 173 lines, then from 186 lines to 747 lines, then from 752 lines to 498 lines, then from 511 lines to 883 lines, then from 887 lines to 744 lines, then from 757 lines to 844 lines, then from 849 lines to 749 lines, then from 762 lines to 829 lines, then from 834 lines to 761 lines, then from 774 lines to 850 lines, then from 855 lines to 774 lines, then from 787 lines to 837 lines, then from 842 lines to 790 lines, then from 803 lines to 1422 lines, then from 1427 lines to 811 lines, then from 824 lines to 1082 lines *)
(* coqc version 8.19+alpha compiled with OCaml 4.13.1
   coqtop version buildkitsandbox:/home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-core.dev/_build/default,master (61ee398ed32f9334dd664ea8ed2697178e6e3844)
   Expected coqc runtime on this file: 0.000 sec *)
Require Coq.Init.Ltac.
Module Export AdmitTactic.
Module Import LocalFalse.
Inductive False : Prop := .
End LocalFalse.
Axiom proof_admitted : False.
Import Coq.Init.Ltac.
Tactic Notation "admit" := abstract case proof_admitted.
End AdmitTactic.
Require NeuralNetInterp.Util.Classes.RelationPairs.Dependent.
Require NeuralNetInterp.Util.Option.
Require NeuralNetInterp.Torch.Tensor.Instances.
Require NeuralNetInterp.Torch.Slicing.
Require NeuralNetInterp.TransformerLens.HookedTransformer.Config.
Require Ltac2.Constr.
Require Ltac2.Printf.
Require Ltac2.List.
Require Ltac2.Std.
Require Ltac2.Pattern.
Require Ltac2.Init.
Require Ltac2.Bool.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.

Module Ltac2_DOT_Array_WRAPPED.
Module Array.
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

(* This is mostly a translation of OCaml stdlib/array.ml *)

(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*             Xavier Leroy, projet Cristal, INRIA Rocquencourt           *)
(*                                                                        *)
(*   Copyright 1996 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)
Import Ltac2.Init.

(* Question: what is returned in case of an out of range value?
   Answer:   Ltac2 throws a panic *)

Ltac2 @external empty : unit -> 'a array := "coq-core.plugins.ltac2" "array_empty".
Ltac2 @external make : int -> 'a -> 'a array := "coq-core.plugins.ltac2" "array_make".
Ltac2 @external length : 'a array -> int := "coq-core.plugins.ltac2" "array_length".
Ltac2 @external get : 'a array -> int -> 'a := "coq-core.plugins.ltac2" "array_get".
Ltac2 @external set : 'a array -> int -> 'a -> unit := "coq-core.plugins.ltac2" "array_set".
Ltac2 @external lowlevel_blit : 'a array -> int -> 'a array -> int -> int -> unit := "coq-core.plugins.ltac2" "array_blit".
Ltac2 @external lowlevel_fill : 'a array -> int -> int -> 'a -> unit := "coq-core.plugins.ltac2" "array_fill".
Ltac2 @external concat : ('a array) list -> 'a array := "coq-core.plugins.ltac2" "array_concat".

(* Low level array operations *)

Ltac2 lowlevel_sub (arr : 'a array) (start : int) (len : int) :=
  let l := length arr in
  match Int.equal l 0 with
  | true => empty ()
  | false =>
      let newarr:=make len (get arr 0) in
      lowlevel_blit arr start newarr 0 len;
      newarr
  end.

(* Array functions as defined in the OCaml library *)

Ltac2 init (l : int) (f : int->'a) :=
  let rec init_aux (dst : 'a array) (pos : int) (len : int) (f : int->'a) :=
    match Int.equal len 0 with
    | true => ()
    | false =>
        set dst pos (f pos);
        init_aux dst (Int.add pos 1) (Int.sub len 1) f
    end
  in
  match Int.le l 0 with
  | true => empty ()
  | false =>
      let arr:=make l (f 0) in
      init_aux arr 1 (Int.sub l 1) f;
      arr
  end.

Ltac2 make_matrix (sx : int) (sy : int) (v : 'a) :=
  let init1 i := v in
  let initr i := init sy init1 in
  init sx initr.

Ltac2 copy a := lowlevel_sub a 0 (length a).

Ltac2 append (a1 : 'a array) (a2 : 'a array) :=
  match Int.equal (length a1) 0 with
  | true => copy a2
  | false => match Int.equal (length a2) 0 with
             | true => copy a1
             | false =>
                 let newarr:=make (Int.add (length a1) (length a2)) (get a1 0) in
                 lowlevel_blit a1 0 newarr 0 (length a1);
                 lowlevel_blit a2 0 newarr (length a1) (length a2);
                 newarr
             end
  end.

Ltac2 sub (a : 'a array) (ofs : int) (len : int) :=
  Control.assert_valid_argument "Array.sub ofs<0" (Int.ge ofs 0);
  Control.assert_valid_argument "Array.sub len<0" (Int.ge len 0);
  Control.assert_bounds "Array.sub" (Int.le ofs (Int.sub (length a) len));
  lowlevel_sub a ofs len.

Ltac2 fill (a : 'a array) (ofs : int) (len : int) (v : 'a) :=
  Control.assert_valid_argument "Array.fill ofs<0" (Int.ge ofs 0);
  Control.assert_valid_argument "Array.fill len<0" (Int.ge len 0);
  Control.assert_bounds "Array.fill" (Int.le ofs (Int.sub (length a) len));
  lowlevel_fill a ofs len v.

Ltac2 blit (a1 : 'a array) (ofs1 : int) (a2 : 'a array) (ofs2 : int) (len : int) :=
  Control.assert_valid_argument "Array.blit ofs1<0" (Int.ge ofs1 0);
  Control.assert_valid_argument "Array.blit ofs2<0" (Int.ge ofs2 0);
  Control.assert_valid_argument "Array.blit len<0" (Int.ge len 0);
  Control.assert_bounds "Array.blit ofs1+len>len a1" (Int.le ofs1 (Int.sub (length a1) len));
  Control.assert_bounds "Array.blit ofs2+len>len a2" (Int.le ofs2 (Int.sub (length a2) len));
  lowlevel_blit a1 ofs1 a2 ofs2 len.

Ltac2 rec iter_aux (f : 'a -> unit) (a : 'a array) (pos : int) (len : int) :=
  match Int.equal len 0 with
  | true => ()
  | false => f (get a p
Build Log (contains the Coq error message) (truncated to last 8.0KiB; full 68KiB file on GitHub Actions Artifacts under build.log)
+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Util/PArray/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.To1snFmQ2l
MINIMIZER_DEBUG: files:  theories/Util/PArray/Instances.v
COQC theories/Torch/Tensor.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Tensor.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.TX7BFln9rq
MINIMIZER_DEBUG: files:  theories/Torch/Tensor.v
COQC theories/Torch/Tensor/Instances.v
COQC theories/Torch/Slicing.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Tensor/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.qXJSS3ZCtx
MINIMIZER_DEBUG: files:  theories/Torch/Tensor/Instances.v
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Slicing.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.lpaWhBHBHU
MINIMIZER_DEBUG: files:  theories/Torch/Slicing.v
COQC theories/TransformerLens/HookedTransformer/Config.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/TransformerLens/HookedTransformer/Config.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.2KXgFwalxZ
MINIMIZER_DEBUG: files:  theories/TransformerLens/HookedTransformer/Config.v
COQC theories/Torch/Einsum.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Einsum.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.nefnuPMJHD
MINIMIZER_DEBUG: files:  theories/Torch/Einsum.v
COQC theories/bug_search_anom_not_found_03.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/bug_search_anom_not_found_03.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.8damoBQsTB
MINIMIZER_DEBUG: files:  theories/bug_search_anom_not_found_03.v
File "./theories/bug_search_anom_not_found_03.v", line 633, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "./theories/bug_search_anom_not_found_03.v", line 663, characters 0-9:
Warning: Let definition coerA' declared as an axiom.
[let-as-axiom,vernacular,default]
File "./theories/bug_search_anom_not_found_03.v", line 666, characters 0-9:
Warning: Let definition coer_ln_tensor declared as an axiom.
[let-as-axiom,vernacular,default]
File "./theories/bug_search_anom_not_found_03.v", line 751, characters 4-52:
Error: Anomaly "Uncaught exception Not_found."
Please report at http://coq.inria.fr/bugs/.

make[1]: *** [Makefile.coq:838: theories/bug_search_anom_not_found_03.vo] Error 129
make[1]: *** [theories/bug_search_anom_not_found_03.vo] Deleting file 'theories/bug_search_anom_not_found_03.glob'
make: *** [Makefile:37: invoke-coqmakefile] Error 2
Minimization Log (truncated to last 8.0KiB; full 791KiB file on GitHub Actions Artifacts under bug.log)
admit. Defined.
�[92m
Admitting Qeds successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qeds unsuccessful.
No successful changes.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to admit [abstract ...]s
�[92m
Admitting [abstract ...] successful.�[0m
�[92m
Admitting [abstract ...] successful.�[0m
Admitting [abstract ...] unsuccessful.
Admitting [abstract ...] unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to replace Obligation with Admit Obligations
�[92m
Admitting Obligations successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Obligations unsuccessful.
No successful changes.

I will now attempt to admit lemmas with Admitted
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with Admitted
�[92m
Admitting definitions successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to admit lemmas with admit. Defined
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with admit. Defined
�[92m
Admitting definitions successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to export modules
Module exportation unsuccessful.

I will now attempt to split imports and exports
Import/Export splitting unsuccessful.

I will now attempt to split := definitions
One-line definition splitting unsuccessful.

I will now attempt to remove all lines, one at a time
Line removal successful

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to replace Qed Obligation with Admit Obligations
�[92m
Admitting Qed Obligations successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qed Obligations unsuccessful.
No successful changes.

I will now attempt to replace Qeds with Admitteds
�[92m
Admitting Qeds successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qeds unsuccessful.
No successful changes.

I will now attempt to replace Qeds with admit. Defined.
�[92m
Admitting Qeds successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Qeds unsuccessful.
No successful changes.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to admit [abstract ...]s
�[92m
Admitting [abstract ...] successful.�[0m
�[92m
Admitting [abstract ...] successful.�[0m
Admitting [abstract ...] unsuccessful.
Admitting [abstract ...] unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to replace Obligation with Admit Obligations
�[92m
Admitting Obligations successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Obligations unsuccessful.
No successful changes.

I will now attempt to admit lemmas with Admitted
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with Admitted
�[92m
Admitting definitions successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to admit lemmas with admit. Defined
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with admit. Defined
�[92m
Admitting definitions successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to export modules
Module exportation unsuccessful.

I will now attempt to split imports and exports
Import/Export splitting unsuccessful.

I will now attempt to split := definitions
One-line definition splitting unsuccessful.

I will now attempt to remove all lines, one at a time
Line removal unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions
�[92m
Definition removal successful.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions
�[92m
Non-instance definition removal successful.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to remove empty sections

No empty sections to remove.

Now, I will attempt to strip repeated newlines and trailing spaces from this file...

No strippable newlines or spaces.

If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.

cc @JasonGross

@SkySkimmer
Copy link
Contributor

Unrelated Not_found

Ltac2 uses harcoded names instead of some Register-like mechanism so inlining the Ltac2 files won't work well.

@JasonGross
Copy link
Member Author

@coqbot minimize coq.dev

git clone https://github.com/JasonGross/neural-net-coq-interp.git --branch=zzz-bug-anomaly-search
cd neural-net-coq-interp
make theories/bug_search_anom_not_found_03.vo -j2

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

Hey @JasonGross, the coq bug minimizer is running your script, I'll come back to you with the results once it's done.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Aug 17, 2023

@JasonGross, Minimized File /github/workspace/neural-net-coq-interp/theories/bug_search_anom_not_found_03.v (full log on GitHub Actions)

Minimized Coq File (consider adding this file to the test-suite)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "+implicit-core-hint-db,+implicits-in-term,+non-reversible-notation,+deprecated-intros-until-0,+deprecated-focus,+unused-intro-pattern,+variable-collision,+unexpected-implicit-declaration,+omega-is-deprecated,+deprecated-instantiate-syntax,+non-recursive,+undeclared-scope,+deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,+deprecated-typeclasses-transparency-without-locality,-ltac2-missing-notation-var,unsupported-attributes" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/neural-net-coq-interp/theories" "NeuralNetInterp" "-Q" "/github/workspace/cwd" "Top" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Bignums" "Bignums" "-Q" "/home/coq/.opam/4.13.1+flambda/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "NeuralNetInterp.bug_search_anom_not_found_03") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 220 lines to 39 lines, then from 52 lines to 522 lines, then from 524 lines to 229 lines, then from 699 lines to 216 lines, then from 228 lines to 118 lines, then from 131 lines to 665 lines, then from 670 lines to 135 lines, then from 148 lines to 1326 lines, then from 1331 lines to 173 lines, then from 186 lines to 747 lines, then from 752 lines to 498 lines, then from 511 lines to 883 lines, then from 887 lines to 744 lines, then from 757 lines to 844 lines, then from 849 lines to 749 lines, then from 762 lines to 829 lines, then from 834 lines to 761 lines, then from 774 lines to 850 lines, then from 855 lines to 774 lines, then from 787 lines to 837 lines, then from 842 lines to 790 lines, then from 803 lines to 1422 lines, then from 1427 lines to 811 lines, then from 824 lines to 1082 lines, then from 766 lines to 303 lines, then from 316 lines to 428 lines, then from 433 lines to 315 lines, then from 328 lines to 758 lines, then from 763 lines to 322 lines, then from 335 lines to 937 lines, then from 942 lines to 340 lines, then from 353 lines to 1497 lines, then from 1501 lines to 448 lines, then from 461 lines to 759 lines, then from 764 lines to 452 lines, then from 465 lines to 992 lines, then from 997 lines to 452 lines, then from 465 lines to 786 lines, then from 790 lines to 459 lines, then from 472 lines to 648 lines, then from 653 lines to 482 lines, then from 495 lines to 529 lines, then from 534 lines to 493 lines, then from 506 lines to 539 lines, then from 544 lines to 497 lines, then from 510 lines to 544 lines, then from 549 lines to 502 lines, then from 515 lines to 975 lines, then from 979 lines to 529 lines, then from 542 lines to 646 lines, then from 651 lines to 531 lines, then from 544 lines to 679 lines, then from 684 lines to 530 lines, then from 543 lines to 1306 lines, then from 1308 lines to 560 lines, then from 573 lines to 767 lines, then from 768 lines to 579 lines, then from 592 lines to 663 lines, then from 667 lines to 589 lines, then from 602 lines to 640 lines, then from 645 lines to 591 lines, then from 596 lines to 592 lines *)
(* coqc version 8.19+alpha compiled with OCaml 4.13.1
   coqtop version buildkitsandbox:/home/coq/.opam/4.13.1+flambda/.opam-switch/build/coq-core.dev/_build/default,master (61ee398ed32f9334dd664ea8ed2697178e6e3844)
   Expected coqc runtime on this file: 1.111 sec *)
Require Coq.Array.PArray.
Require Coq.Floats.Floats.
Require Coq.Numbers.Cyclic.Int63.Sint63.

Axiom proof_admitted : False.
Tactic Notation "admit" := abstract case proof_admitted.
Module Export Hetero.

Definition relation A B := A -> B -> Prop.

Module Export NeuralNetInterp_DOT_Util_DOT_Program_DOT_Basics_DOT_Dependent_WRAPPED.
Module Export Dependent.
Import Coq.Program.Basics.
Declare Scope type_function_scope.
Delimit Scope type_function_scope with type_function.

Definition type_function := Type -> Type.
Notation "F ∘ G" := (fun A : Type => F%type_function (G%type_function A)) : type_function_scope.

End Dependent.

End NeuralNetInterp_DOT_Util_DOT_Program_DOT_Basics_DOT_Dependent_WRAPPED.
Module Export NeuralNetInterp_DOT_Util_DOT_Relations_DOT_Relation_Definitions_DOT_Dependent_WRAPPED.
Module Export Dependent.
Declare Scope dependent_signature_scope.

Definition relation (F : type_function)
  := forall A B, Hetero.relation A B -> Hetero.relation (F A) (F B).

Module Export RelationsNotations.
  Delimit Scope dependent_signature_scope with dependent_signature.
  Bind Scope dependent_signature_scope with relation.

  Notation "R ∘ R'" := (fun (A B : Type) (RAB : Hetero.relation A B) => R%dependent_signature _ _ (R'%dependent_signature A B RAB)) : dependent_signature_scope.
End RelationsNotations.

End Dependent.

End NeuralNetInterp_DOT_Util_DOT_Relations_DOT_Relation_Definitions_DOT_Dependent_WRAPPED.
Module Export Dependent.

Section Proper.
  Context {F : Type -> Type}.

  Class Proper (R : Dependent.relation F) (m : forall T, F T) : Prop :=
    proper_prf : forall {A B} (R0 : Hetero.relation A B), R A B R0 (m A) (m B).
Definition respectful_hetero {A : Type -> Type} {B : forall x, A x -> Type}
    (R : Dependent.relation A)
    (R' : forall x y, Hetero.relation x y -> forall x' y', Hetero.relation (B x x') (B y y'))
    : Dependent.relation (fun T => forall a : A T, B T a).
exact (fun a0 b0 R0 f g => forall x y, R _ _ R0 x y -> R' _ _ R0 _ _ (f x) (g y)).
Defined.

  Definition respectful {A B : Type -> Type} (R : Dependent.relation A) (R' : Dependent.relation B) : Dependent.relation (fun T => A T -> B T)
    := Eval cbv [respectful_hetero] in
      @respectful_hetero A (fun T _ => B T) R (fun x y R0 _ _ => R' x y R0).
End Proper.

Module Export ProperNotations.

  Notation " R ==> R' " := (@respectful _ _ (R%dependent_signature) (R'%dependent_signature))
    (right associativity, at level 55) : dependent_signature_scope.

End ProperNotations.

Notation idR := (fun (A B : Type) (R : Hetero.relation A B) => R).
Notation const R := (match _ as F return forall A B, Hetero.relation A B -> Hetero.relation F F with
                     | F => fun (A B : Type) (_ : Hetero.relation A B) => R
                     end) (only parsing).

Reserved Infix "::'" (at level 59, left associativity).
Reserved Infix "++'" (at level 59, left associativity).
Reserved Infix "+'" (at level 48, left associativity).
Module Export Option.

Section Relations.
  Definition option_eq {A B} eq (x : option A) (y : option B) :=
    match x with
    | None    => y = None
    | Some ax => match y with
                 | None => False
                 | Some ay => eq ax ay
                 end
    end.
End Relations.
Definition invert_Some {A} (x : option A)
  : (if x then A else unit).
Admitted.

#[export] Instance invert_Some_Proper_dep
  : Dependent.Proper
      (@Dependent.respectful_hetero
         (fun T => option T)
         (fun T (x : option T) => if x then _ else _)
         (@option_eq)
         (fun A B R x y => match x, y with
                           | Some _, Some _ => R
                           | None, None => fun _ _ => True
                           | Some _, None | None, Some _ => fun _ _ => False
                           end))
      (@invert_Some).
Admitted.
Fixpoint radd (n m : nat) {struct m} : nat.
exact (match m with
     | 0 => n
     | S p => S (radd n p)
     end).
Defined.
  Infix "+'" := radd : nat_scope.
Import Coq.ZArith.ZArith.
Import Coq.Array.PArray.
Class pointed T := point : T.
#[export] Instance default_Z : pointed Z.
Admitted.
#[export] Instance default_array {A} {a : pointed A} : pointed (array A).
Admitted.
Import Coq.Strings.String.
Definition with_default (name : string) {A} (x : A) := A.
#[global] Arguments with_default _ {_} _, _ _ _.
Existing Class with_default.
Ltac fill_default _ :=
  lazymatch goal with
  | [ |- @with_default ?name ?A ?x ]
    => match goal with
       | [ H : @with_default ?name' ?A' _ |- _ ] => constr_eq A A'; constr_eq name name'; fail 1
       | _ => exact x
       end
  end.
#[global] Hint Extern 0 (with_default _ _) => fill_default () : typeclass_instances.

Cumulative Polymorphic Inductive TyList := tynil | tycons (_ : Type) (_ : TyList).

Class has_ltb A := ltb : A -> A -> bool.
Class has_add_with A B C := add : A -> B -> C.
Notation has_add A := (has_add_with A A A).
Class has_sub_with A B C := sub : A -> B -> C.
Notation has_sub A := (has_sub_with A A A).
Class has_mul_with A B C := mul : A -> B -> C.
Notation has_mul A := (has_mul_with A A A).
Class has_opp A := opp : A -> A.
Class has_zero A := zero : A.
Class has_sqrt A := sqrt : A -> A.
Class has_div_by A B C := div : A -> B -> C.
Notation has_div A := (has_div_by A A A).
Class has_exp_to A B := exp : A -> B.
Notation has_exp A := (has_exp_to A A).
Class has_ln_to A B := ln : A -> B.
Notation has_ln A := (has_ln_to A A).
Class has_coer A B := coer : A -> B.
Definition has_coer_to (avoid : TyList) := has_coer.

#[export] Hint Extern 0 (has_coer_to _ _ ?A)
=> lazymatch goal with H : has_coer _ A |- _ => exact H end
  : typeclass_instances.
#[export] Instance lift_coer_has_zero {A B} {coerAB : has_coer_to (tycons B tynil) A B} {zeroA : has_zero A} : has_zero B.
Admitted.
#[export] Coercion Z.of_N : N >-> Z.
#[export] Instance Z_has_zero : has_zero Z.
Admitted.
  #[export] Coercion Uint63.of_Z : Z >-> Uint63.int.
Module Export PArray.
Import Coq.Numbers.Cyclic.Int63.Sint63.
Definition init_default {A} {default : pointed A} (len : int) (f : int -> A) : array A.
Admitted.

Definition Rank := nat.

Module Type IndexType.
  Parameter t : Type.
End IndexType.

Module Type ExtendedIndexType.
  Include IndexType.
End ExtendedIndexType.

Module Export IndexGen.
  Module Make (IndexType : IndexType).
    Notation IndexType := IndexType.t.

    Fixpoint t (r : Rank) : Type
      := match r with
         | O => unit
         | S r => t r * IndexType.t
         end.
    Notation Index := t.
Definition nil : t 0.
Admitted.
    Definition snoc {r} (s : t r) x : t (S r) := (s, x).
    Module Import IndexNotations0.
      Declare Scope index_scope.
      Delimit Scope index_scope with index.
      Notation "xs ::' x" := (snoc xs x) : index_scope.
    End IndexNotations0.
    Definition hd {r : Rank} : Index (S r) -> Index r.
Admitted.
Definition tl {r : Rank} : Index (S r) -> IndexType.
exact (@snd _ _).
Defined.
Fixpoint app {r1 r2 : Rank} {struct r2} : Index r1 -> Index r2 -> Index (r1 +' r2).
exact (match r2 with
         | 0%nat => fun sz _tt => sz
         | S r2 => fun sz1 sz2 => @app r1 r2 sz1 (hd sz2) ::' tl sz2
         end%index).
Defined.
    End Make.

  Module ExtendedMake (IndexType : ExtendedIndexType).
    Include Make IndexType.

    End ExtendedMake.

Module Export Shape.
  Module ShapeType <: ExtendedIndexType.
Definition t : Type.
exact (int).
Defined.
  End ShapeType.

  Include IndexGen.ExtendedMake ShapeType.
    Declare Scope shape_scope.
    Delimit Scope shape_scope with shape.
    Bind Scope shape_scope with t.
    Notation "xs ::' x" := (snoc xs x) : shape_scope.
    Notation "[ ]" := nil : shape_scope.
    Notation "[ x ]" := (snoc nil x) : shape_scope.
    Notation "[ x ; y ; .. ; z ]" :=  (snoc .. (snoc (snoc nil x) y) .. z) : shape_scope.
    Notation "s1 ++ s2" := (app s1 s2) : shape_scope.
    Notation "s1 ++' s2" := (app s1 s2) : shape_scope.
Notation Shape := Shape.Index.

Module Export RawIndex.
  Module RawIndexType <: ExtendedIndexType.
Definition t : Type.
exact (int).
Defined.
  End RawIndexType.

  Include IndexGen.ExtendedMake RawIndexType.
Notation RawIndex := RawIndex.Index.
Monomorphic Definition tensor_of_rank (r : Rank) (A : Type) : Type.
exact (RawIndex r -> A).
Defined.
Monomorphic Definition tensor {r : Rank} (s : Shape r) (A : Type) : Type.
exact (tensor_of_rank r A).
Defined.
  Fixpoint concrete_tensor_of_rank (r : Rank) (A : Type) : Type
    := match r with
       | O => A
       | S r => concrete_tensor_of_rank r (array A)
       end.
Definition concrete_tensor {r : Rank} (s : Shape r) (A : Type) : Type.
exact (concrete_tensor_of_rank r A).
Defined.

  Fixpoint concretize {r : Rank} {s : Shape r} {A : Type} {default : pointed A} {struct r} : forall (t : tensor s A), concrete_tensor s A
    := match r return forall (s : Shape r) (t : tensor s A), concrete_tensor s A with
       | 0%nat => fun _tt f => f tt
       | S r
         => fun '(s, len) f
            => concretize (r:=r) (A:=array A) (s:=s) (fun idxs => PArray.init_default len (fun idx => f (idxs, idx)))
       end s.
Definition reabstract {r s A} (t_ : unit -> @tensor r s A) (t : @concrete_tensor r s A) : @tensor r s A.
Admitted.

  Definition checkpoint {r s A default} t : @tensor r s A
    := let t_ _ := t in
       let t := @concretize r s A default t in
       reabstract t_ t.
Definition coer_tensor {r s A B} {coerAB : has_coer A B} : @tensor r s A -> @tensor r s B.
Admitted.
#[export] Coercion coer_tensor : tensor >-> tensor.

Module Export NeuralNetInterp_DOT_Torch_DOT_Tensor_DOT_Instances_WRAPPED.
Module Export Instances.

Module Export Tensor.
Definition eqfR_rank {r} : Dependent.relation (@tensor_of_rank r).
exact (fun A B R x y => forall i, R (x i) (y i)).
Defined.
Definition eqfR {r s} : Dependent.relation (@tensor r s).
exact (eqfR_rank).
Defined.
  #[global] Arguments eqfR {r s} [A B] R x y.
  Notation eqf := (eqfR eq).

  End Tensor.

End Instances.

End NeuralNetInterp_DOT_Torch_DOT_Tensor_DOT_Instances_WRAPPED.

Variant NormalizationType := LN   .

Module Type CommonConfig.
  Parameter d_model : N.
  Parameter n_ctx : N.
  Parameter d_head : N.
  Parameter d_vocab : N.
  Parameter n_heads : N.
  Parameter normalization_type : with_default "normalization_type" (option NormalizationType) (Some LN).

End CommonConfig.
Import Coq.Floats.Floats.

Definition ln_tensor_gen d_model (nt : with_default "normalization_type" (Some LN)) A
  := (match nt with
      | Some LN => tensor [d_model] A
      | Datatypes.None => with_default "()" True I
      end).
Definition block_params_type_gen n_heads d_model d_head (nt : with_default "normalization_type" (Some LN)) A
  := (
    tensor [n_heads; d_model; d_head] A * tensor [n_heads; d_model; d_head] A * tensor [n_heads; d_model; d_head] A * tensor [n_heads; d_model; d_head] A
    * tensor [n_heads; d_head] A * tensor [n_heads; d_head] A * tensor [n_heads; d_head] A
    * tensor [d_model] A
    * ln_tensor_gen d_model nt A
    * ln_tensor_gen d_model nt A)%type.
Module Type ExtraConfig (Import cfg : CommonConfig).
  Parameter W_E : tensor [d_vocab; d_model] float.
  Parameter W_pos : tensor [n_ctx; d_model] float.
  Notation ln_tensor A := (ln_tensor_gen d_model normalization_type A).
  Notation block_params_type A := (block_params_type_gen n_heads d_model d_head normalization_type A).
  Parameter blocks_params : list (block_params_type float).
End ExtraConfig.

Module Type Config := CommonConfig <+ ExtraConfig.

Module Export NeuralNetInterp_DOT_TransformerLens_DOT_HookedTransformer_WRAPPED.
Module Export HookedTransformer.

Module Export TransformerBlock.
  Section __.
    Context {r} {batch : Shape r}
      {pos n_heads d_model d_head} {n_ctx:N}
      {use_split_qkv_input : with_default "use_split_qkv_input" bool false}
      {normalization_type : with_default "normalization_type" (option NormalizationType) (Some LN)}
      (maybe_n_heads := fun b : bool => (if b return Shape (if b then _ else _) then [n_heads] else [])%shape)
      (ln_s := (batch ::' pos ++ maybe_n_heads use_split_qkv_input)%shape)
      {A}
      {zeroA : has_zero A} {coerZ : has_coer Z A}
      {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
      {sqrtA : has_sqrt A} {expA : has_exp A}
      (defaultA : pointed A := @coer _ _ coerZ point)
      {use_checkpoint : with_default "use_checkpoint" bool true}
      (W_Q W_K W_V W_O : tensor [n_heads; d_model; d_head] A)
      (b_Q b_K b_V : tensor [n_heads; d_head] A)
      (b_O : tensor [d_model] A)
      (eps : A)
      (ln1_w ln1_b ln2_w ln2_b : ln_tensor_gen d_model normalization_type A)
      (resid_pre : tensor ((batch ::' pos) ++' [d_model]) A).
Definition attn_only_out : tensor (batch ++ [pos; d_model]) A.
Proof using A W_K W_O W_Q W_V addA b_K b_O b_Q b_V batch coerZ d_head d_model defaultA divA
eps expA ln1_b ln1_w ln_s maybe_n_heads mulA n_ctx n_heads normalization_type pos r
resid_pre sqrtA subA use_checkpoint use_split_qkv_input zeroA
.
Admitted.
Definition attn_masked_attn_scores : tensor (batch ::' n_heads ::' pos ::' pos) A.
Proof using A W_K W_Q addA b_K b_Q batch coerZ d_head d_model defaultA divA eps ln1_b ln1_w
ln_s maybe_n_heads mulA n_ctx n_heads normalization_type pos r resid_pre sqrtA subA
use_checkpoint use_split_qkv_input zeroA
.
Admitted.
  End __.
End TransformerBlock.

Module Export HookedTransformer.
  Section __.
    Context {d_vocab d_vocab_out n_heads d_model d_head} {n_ctx:N}
      {r} {batch : Shape r} {pos}
      (s := (batch ::' pos)%shape)
      (resid_shape := (s ::' d_model)%shape)
      {normalization_type : with_default "normalization_type" (option NormalizationType) (Some LN)}
      {A}
      {zeroA : has_zero A} {coerZ : has_coer Z A}
      {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
      {sqrtA : has_sqrt A} {expA : has_exp A}
      (defaultA : pointed A := @coer _ _ coerZ point)

      {use_checkpoint : with_default "use_checkpoint" bool true}
      (eps : A)

      (W_E : tensor [d_vocab; d_model] A)
      (W_pos : tensor [n_ctx; d_model] A)

      (blocks_params
        : list (block_params_type_gen n_heads d_model d_head normalization_type A)
             )

      (ln_final_w ln_final_b : ln_tensor_gen d_model normalization_type A)

      (W_U : tensor [d_model; d_vocab_out] A) (b_U : tensor [d_vocab_out] A)
    .
    #[local] Existing Instance defaultA.
Definition blocks : list (tensor resid_shape A -> tensor resid_shape A).
exact (List.map
           (fun '(W_Q, W_K, W_V, W_O,
                  b_Q, b_K, b_V,
                  b_O,
                  ln1_w, ln1_b)
            => TransformerBlock.attn_only_out
                 (n_ctx:=n_ctx)
                 W_Q W_K W_V W_O
                 b_Q b_K b_V
                 b_O
                 eps
                 ln1_w ln1_b)
           blocks_params).
Defined.
Polymorphic Definition blocks_cps {T} {n : with_default "blocks n" nat (List.length blocks)} (residual : tensor resid_shape A) (K : tensor resid_shape A -> T) : T.
admit.
Defined.
    Definition resid_postembed (tokens : tensor s IndexType) : tensor resid_shape A.
      Proof using A W_E W_pos addA batch coerZ d_model d_vocab defaultA n_ctx pos r resid_shape s
        use_checkpoint.
      Admitted.
Definition blocks_attn_masked_attn_scores
      : list (tensor resid_shape A -> tensor (batch ::' n_heads ::' pos ::' pos) A).
exact (List.map
           (fun '(W_Q, W_K, W_V, W_O,
                  b_Q, b_K, b_V,
                  b_O,
                  ln1_w, ln1_b)
            => TransformerBlock.attn_masked_attn_scores
                 (n_ctx:=n_ctx)
                 W_Q W_K
                 b_Q b_K
                 eps
                 ln1_w ln1_b)
           blocks_params).
Defined.
Definition masked_attn_scores (n : nat) (tokens : tensor s IndexType)
      : option (tensor (batch ::' n_heads ::' pos ::' pos) A).
exact (match List.nth_error blocks_attn_masked_attn_scores n with
         | Some block_n_attn_masked_attn_scores
           => Some (let residual       := resid_postembed tokens in
                    blocks_cps
                      (n:=Nat.pred n)
                      residual
                      (fun residual
                       => checkpoint (block_n_attn_masked_attn_scores residual)))
         | None => None
         end).
Defined.
  End __.
End HookedTransformer.

End HookedTransformer.

End NeuralNetInterp_DOT_TransformerLens_DOT_HookedTransformer_WRAPPED.
Module Export Instances.

Module Export HookedTransformer.
Definition block_params_type_genR n_heads d_model d_head nt : Dependent.relation (block_params_type_gen n_heads d_model d_head nt).
Admitted.

  Module Export HookedTransformer.

    #[export] Instance masked_attn_scores_Proper_dep {d_vocab n_heads d_model d_head n_ctx r batch pos normalization_type}
      : Dependent.Proper
          (Dependent.idR
             ==> (Dependent.const eq ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR)
             ==> (Dependent.idR ==> Dependent.idR)
             ==> Dependent.const (fun _ _ => True)
             ==> Dependent.idR
             ==> Tensor.eqfR
             ==> Tensor.eqfR
             ==> List.Forall2 ∘ @block_params_type_genR n_heads d_model d_head normalization_type
             ==> Dependent.const eq
             ==> Dependent.const Tensor.eqf
             ==> @option_eq ∘ Tensor.eqfR)
          (@HookedTransformer.HookedTransformer.masked_attn_scores d_vocab n_heads d_model d_head n_ctx r batch pos normalization_type).
Admitted.
  End HookedTransformer.
End HookedTransformer.

End Instances.
Module Export Parameters.
Local Open Scope float_scope.

Module cfg <: CommonConfig.
  Definition d_model := 32%N.
  Definition n_ctx := 2%N.
  Definition d_head := 32%N.
  Definition n_heads := 1%N.
  Definition d_vocab := 64%N.
  Definition eps := 1e-05.
  Definition normalization_type := Some LN.
End cfg.

End Parameters.
Import Coq.Lists.List.

Module Model (cfg : Config).

  Module Export HookedTransformer.
    Section __.
      Context {r} {batch : Shape r} {pos}
        (s := (batch ::' pos)%shape)
        (resid_shape := (s ::' cfg.d_model)%shape)
        {A} {coer_float : has_coer float A} {coerZ : has_coer Z A}
        {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
        {sqrtA : has_sqrt A} {expA : has_exp A}
        {use_checkpoint : with_default "use_checkpoint" bool true}.
Let coerA' (x : float) : A.
Admitted.
      #[local] Coercion coerA' : float >-> A.
Let coer_ln_tensor : cfg.ln_tensor float -> cfg.ln_tensor A.
Admitted.
      Definition coer_blocks_params
        := List.map
             (fun '((W_Q, W_K, W_V, W_O,
                      b_Q, b_K, b_V, b_O,
                      ln1_w, ln1_b) : cfg.block_params_type float)
              => ((W_Q:tensor _ A), (W_K:tensor _ A), (W_V:tensor _ A), (W_O:tensor _ A),
                   (b_Q:tensor _ A), (b_K:tensor _ A), (b_V:tensor _ A), (b_O:tensor _ A),
                   coer_ln_tensor ln1_w, coer_ln_tensor ln1_b)).
Definition masked_attn_scores (n : nat) (tokens : tensor s IndexType)
        : option (tensor (batch ::' cfg.n_heads ::' pos ::' pos) A).
exact (HookedTransformer.HookedTransformer.masked_attn_scores
             (A:=A) (n_ctx:=cfg.n_ctx) (normalization_type:=cfg.normalization_type)cfg.eps
             cfg.W_E cfg.W_pos
             (coer_blocks_params cfg.blocks_params)
             n tokens).
Defined.
    End __.
  End HookedTransformer.
End Model.
Import ListNotations.

Module cfg <: Config.
  Include Parameters.cfg.
  Parameter W_E : tensor [d_vocab; d_model] float.
  Parameter W_pos : tensor [n_ctx; d_model] float.
  Notation block_params_type A := (block_params_type_gen n_heads d_model d_head normalization_type A).
  Parameter block_params : block_params_type float.
  Definition blocks_params := [block_params].
End cfg.
  Include Model cfg.

  Section with_batch.
    Context {r} {batch : Shape r} {pos}
      (s := (batch ::' pos)%shape)
      (resid_shape := (s ::' cfg.d_model)%shape)
      {return_per_token : with_default "return_per_token" bool false}
      {A} {coer_float : has_coer float A} {coerZ : has_coer Z A}
      (defaultA : pointed A := @coer _ _ coerZ point)
      {addA : has_add A} {subA : has_sub A} {mulA : has_mul A} {divA : has_div A}
      {ltbA : has_ltb A}
      {oppA : has_opp A} {sqrtA : has_sqrt A} {expA : has_exp A} {lnA : has_ln A}
      {use_checkpoint : with_default "use_checkpoint" bool true}.
Definition masked_attn_scores (tokens : tensor s IndexType)
        : tensor (batch ::' cfg.n_heads ::' pos ::' pos) A.
exact (Option.invert_Some
           (HookedTransformer.masked_attn_scores (A:=A) 0 tokens)).
Defined.
  End with_batch.

  #[export] Instance masked_attn_scores_Proper_dep {r batch pos}
    : Dependent.Proper
        ((Dependent.const eq ==> Dependent.idR)
           ==> (Dependent.const eq ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR)
           ==> (Dependent.idR ==> Dependent.idR)
           ==> Dependent.const (fun _ _ => True)
           ==> Dependent.const Tensor.eqf
           ==> Tensor.eqfR)
        (@masked_attn_scores r batch pos).
  Proof.
    cbv [masked_attn_scores].
    pose proof (@HookedTransformer.HookedTransformer.masked_attn_scores_Proper_dep) as H.
    repeat intro.
    repeat (let v := open_constr:(_) in specialize (H v)).
    move H at bottom.
    revert H.
    lazymatch goal with
    | [ |- ?R _ _ ?R'' ?x ?y -> ?R' (invert_Some ?x' ?i) (invert_Some ?y' ?i) ]
      => unify x x'; unify y y'; unify R'' R'; set (x'':=x); set (y'':=y);
         intro H;
         refine (@invert_Some_Proper_dep _ _ (Tensor.eqfR R') x y H i)
    end.
    Unshelve.
    Search HookedTransformer.block_params_type_genR.
Intermediate Coq File (useful for debugging if minimization did not go as far as you wanted)
Build Log (contains the Coq error message) (truncated to last 8.0KiB; full 61KiB file on GitHub Actions Artifacts under build.log)
NIMIZER_DEBUG: files:  theories/Util/PArray/Proofs.v
COQC theories/Util/PArray/Instances.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Util/PArray/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.xUoTDQYs59
MINIMIZER_DEBUG: files:  theories/Util/PArray/Instances.v
COQC theories/Torch/Tensor.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Tensor.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.fbFA1QEYDq
MINIMIZER_DEBUG: files:  theories/Torch/Tensor.v
COQC theories/Torch/Slicing.v
COQC theories/Torch/Tensor/Instances.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Slicing.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.5s2YGTAFWF
MINIMIZER_DEBUG: files:  theories/Torch/Slicing.v
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/Torch/Tensor/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.yh5pnxvU94
MINIMIZER_DEBUG: files:  theories/Torch/Tensor/Instances.v
COQC theories/TransformerLens/HookedTransformer/Config.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/TransformerLens/HookedTransformer/Config.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.VMsjeIYIsz
MINIMIZER_DEBUG: files:  theories/TransformerLens/HookedTransformer/Config.v
COQC theories/bug_search_anom_not_found_03.v
MINIMIZER_DEBUG_EXTRA: coqc: /home/coq/.opam/4.13.1+flambda/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/neural-net-coq-interp
MINIMIZER_DEBUG_EXTRA: exec: /home/coq/.opam/4.13.1+flambda/bin/coqc.orig -q -w +implicit-core-hint-db\,+implicits-in-term\,+non-reversible-notation\,+deprecated-intros-until-0\,+deprecated-focus\,+unused-intro-pattern\,+variable-collision\,+unexpected-implicit-declaration\,+omega-is-deprecated\,+deprecated-instantiate-syntax\,+non-recursive\,+undeclared-scope\,+deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,+deprecated-typeclasses-transparency-without-locality\,-ltac2-missing-notation-var\,unsupported-attributes -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/neural-net-coq-interp/theories NeuralNetInterp theories/bug_search_anom_not_found_03.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.Ap16XLBB1D
MINIMIZER_DEBUG: files:  theories/bug_search_anom_not_found_03.v
File "./theories/bug_search_anom_not_found_03.v", line 78, characters 0-11:
Warning: Trying to mask the absolute name "Ltac2.Constr.Unsafe"!
[masking-absolute-name,deprecated-since-8.8,deprecated,default]
File "./theories/bug_search_anom_not_found_03.v", line 80, characters 0-11:
Warning: Trying to mask the absolute name "Ltac2.Constr"!
[masking-absolute-name,deprecated-since-8.8,deprecated,default]
File "./theories/bug_search_anom_not_found_03.v", line 80, characters 0-11:
Warning: Trying to mask the absolute name "Ltac2.Constr.Unsafe"!
[masking-absolute-name,deprecated-since-8.8,deprecated,default]
File "./theories/bug_search_anom_not_found_03.v", line 649, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "./theories/bug_search_anom_not_found_03.v", line 677, characters 0-9:
Warning: Let definition coerA' declared as an axiom.
[let-as-axiom,vernacular,default]
File "./theories/bug_search_anom_not_found_03.v", line 680, characters 0-9:
Warning: Let definition coer_ln_tensor declared as an axiom.
[let-as-axiom,vernacular,default]
File "./theories/bug_search_anom_not_found_03.v", line 765, characters 4-52:
Error: Anomaly "Uncaught exception Not_found."
Please report at http://coq.inria.fr/bugs/.

make[1]: *** [Makefile.coq:838: theories/bug_search_anom_not_found_03.vo] Error 129
make[1]: *** [theories/bug_search_anom_not_found_03.vo] Deleting file 'theories/bug_search_anom_not_found_03.glob'
make: *** [Makefile:37: invoke-coqmakefile] Error 2
Minimization Log (truncated to last 8.0KiB; full 1.2MiB file on GitHub Actions Artifacts under bug.log)
ot_found_03.v", line 271, characters 0-51:
Warning:
New coercion path [coer_tensor] : tensor >-> tensor is not definitionally an identity function.
[ambiguous-paths,coercions,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 489, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 491, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.PArray.IndexGen.Shape.RawIndex.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables

Non-fatal error: Failed to remove variables and preserve the error.  
The new error was:
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 157, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 4-10:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 177, characters 26-37:
Error: The reference IndexType.t was not found in the current environment.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to replace Obligation with Admit Obligations
�[92m
Admitting Obligations successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting Obligations unsuccessful.
No successful changes.

I will now attempt to admit lemmas with Admitted
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with Admitted

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmp3eigtl5h/NeuralNetInterp/bug_search_anom_not_found_03.v", line 93, characters 10-52:
Error: The type of this term is a product while it is expected to be a sort.


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to admit lemmas with admit. Defined
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with admit. Defined

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmpxtlkv1q2/NeuralNetInterp/bug_search_anom_not_found_03.v", line 154, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpxtlkv1q2/NeuralNetInterp/bug_search_anom_not_found_03.v", line 157, characters 4-10:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpxtlkv1q2/NeuralNetInterp/bug_search_anom_not_found_03.v", line 251, characters 31-35:
Error: Illegal application (Non-functional construction): 
The expression "f" of type "tensor _tt A"
cannot be applied to the term
 "tt" : "unit"


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to export modules
Module exportation unsuccessful.

I will now attempt to split imports and exports
Import/Export splitting unsuccessful.

I will now attempt to split := definitions
One-line definition splitting unsuccessful.

I will now attempt to remove all lines, one at a time
Line removal unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpgumzk20s/NeuralNetInterp/bug_search_anom_not_found_03.v", line 151, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpgumzk20s/NeuralNetInterp/bug_search_anom_not_found_03.v", line 152, characters 4-10:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpgumzk20s/NeuralNetInterp/bug_search_anom_not_found_03.v", line 252, characters 15-25:
Error: 
Could not find an instance for "pointed (array A)" in
environment:
concretize : forall (r : Rank) (s : Shape r) (A : Type),
             pointed A -> tensor s A -> concrete_tensor s A
r0 : Rank
s0 : Shape r0
A : Type
default : pointed A
r : nat
pat : Shape (S r)
s : (fix t (r : Rank) : Type :=
       match r with
       | 0 => unit
       | S r0 => (t r0 * Shape.IndexType)%type
       end) r
len : Shape.IndexType
f : tensor (s, len) A



�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions

Non-fatal error: Failed to remove non-instance definitions and preserve the error.  
The new error was:
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 157, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 4-10:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 271, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 271, characters 0-51:
Warning: coer_tensor does not respect the uniform inheritance condition.
[uniform-inheritance,coercions,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 271, characters 0-51:
Warning:
New coercion path [coer_tensor] : tensor >-> tensor is not definitionally an identity function.
[ambiguous-paths,coercions,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 489, characters 20-25:
Warning: The constant 1e-05 is not a binary64 floating-point value. A closest
value 0x1.4f8b588e368f1p-17 will be used and unambiguously printed
1.0000000000000001e-05. [inexact-float,parsing,default]
File "/tmp/tmpht8k32rh/NeuralNetInterp/bug_search_anom_not_found_03.v", line 491, characters 0-8:
Error:
The field d_vocab is missing in NeuralNetInterp.bug_search_anom_not_found_03.Hetero.Dependent.Option.PArray.IndexGen.Shape.RawIndex.Parameters.cfg.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables

Non-fatal error: Failed to remove variables and preserve the error.  
The new error was:
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 157, characters 2-8:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 160, characters 4-10:
Warning: This command does not support this attribute: export.
[unsupported-attributes,parsing,default]
File "/tmp/tmpofowkqnd/NeuralNetInterp/bug_search_anom_not_found_03.v", line 177, characters 26-37:
Error: The reference IndexType.t was not found in the current environment.


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to remove empty sections

No empty sections to remove.

Now, I will attempt to strip repeated newlines and trailing spaces from this file...

No strippable newlines or spaces.

If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.

herbelin added a commit to herbelin/github-coq that referenced this issue Aug 29, 2023
We pass sigma everywhere env is already passed. This is probably
overkill, since most of the time, env and sigma do not change, but
since it is already done for env, we imitate.
@herbelin
Copy link
Member

In the minimized example, the problem is caused by an existential variable in the hypothesis H of the goal.

An alternative shorter example, not failing though, is:

Goal exists y, Some y = Some y :> option nat -> True.
eexists. intro H.
Search Some eq. 

which returns

H: Some ?X8 = Some ?X8

instead of

H: Some ?y = Some ?y

Or also:

Goal exists y, Some y = Some y :> option nat -> True.
eexists ?[y]. [y]:exact 0. intro H.
Search Some eq. 

which shows H: Some ?X8 = Some ?X8 instead of H: Some 0 = Some 0.

Fixed in #17987.

herbelin added a commit to herbelin/github-coq that referenced this issue Aug 30, 2023
We pass sigma everywhere env is already passed. This is probably
overkill, since most of the time, env and sigma do not change, but
since it is already done for env, we imitate.
coqbot-app bot added a commit that referenced this issue Sep 8, 2023
Reviewed-by: ppedrot
Co-authored-by: ppedrot <ppedrot@users.noreply.github.com>
@coqbot-app coqbot-app bot added this to the 8.19+rc1 milestone Sep 8, 2023
Villetaneuse pushed a commit to Villetaneuse/coq that referenced this issue Sep 9, 2023
We pass sigma everywhere env is already passed. This is probably
overkill, since most of the time, env and sigma do not change, but
since it is already done for env, we imitate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: anomaly An uncaught exception has been raised.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants