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

Slightly tweak the heuristic to pose dependent metas in case_pf. #17564

Merged
merged 6 commits into from
May 12, 2023

Conversation

ppedrot
Copy link
Member

@ppedrot ppedrot commented May 3, 2023

We refine the case scrutinee before calling the case_pf function proper, and rely on tclWITHHOLES instead of the legacy refiner to check that holes are correctly solved rather than turned into shelved evars.

As a side-effect, this fixes a bug with intropatterns that silently introduced shelved evars even though the toplevel tactic should have forbidden them. A trivial fix is to turn the offending tactic into its e-variant.

@ppedrot ppedrot added kind: cleanup Code removal, deprecation, refactorings, etc. request: full CI Use this label when you want your next push to trigger a full CI. labels May 3, 2023
@ppedrot ppedrot added this to the 8.18+rc1 milestone May 3, 2023
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label May 3, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

The job library:ci-fiat_crypto_legacy has failed in allow failure mode
ping @JasonGross

ppedrot added a commit to ppedrot/cross-crypto that referenced this pull request May 3, 2023
ppedrot added a commit to ppedrot/bignums that referenced this pull request May 3, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

🔴 CI failures at commit 59b2ccd without any failure in the test-suite

✔️ Corresponding jobs for the base commit 65720db succeeded

❔ Ask me to try to extract minimal test cases that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following targets: ci-bignums, ci-coquelicot, ci-cross_crypto, ci-fiat_crypto_legacy, ci-metacoq, ci-perennial, ci-quickchick, ci-verdi_raft, ci-vst
  • You can also pass me a specific list of targets to minimize as arguments.

⚠️ ⌛ You may want to wait until the pipeline for the base commit (65720db) finishes.

@ppedrot
Copy link
Member Author

ppedrot commented May 3, 2023

Most of the failures are faulty calls to intropatterns that silently introduce shelved evars. The new PR fails on these ones so that the calling tactic (destruct / intros) must be turned into its e-variant.

ppedrot added a commit to ppedrot/QuickChick that referenced this pull request May 3, 2023
@SkySkimmer
Copy link
Contributor

Is there a way to have a warning instead of an error for backwards compat?

ppedrot added a commit to ppedrot/verdi that referenced this pull request May 3, 2023
ppedrot added a commit to coq-community/bignums that referenced this pull request May 3, 2023
palmskog added a commit to uwplse/verdi that referenced this pull request May 3, 2023
andres-erbsen pushed a commit to mit-plv/cross-crypto that referenced this pull request May 3, 2023
@ppedrot
Copy link
Member Author

ppedrot commented May 3, 2023

Depends for which behaviour change (intopattern stricter vs. slight unification differences). Given the nature of the code it's probably going to be either hard or costly to implement, though.

@ppedrot
Copy link
Member Author

ppedrot commented May 3, 2023

@coqbot ci minimize

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

I have initiated minimization at commit 59b2ccd for the suggested targets ci-fiat_crypto_legacy, ci-metacoq, ci-perennial, ci-quickchick, ci-vst as requested.
However, you may want to try again once the pipeline for the head commit (59b2ccd) finishes.

ppedrot added a commit to ppedrot/perennial that referenced this pull request May 3, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/quickchick/src/Instances.v (from ci-quickchick) (full log on GitHub Actions)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

Minimized Coq File (consider adding this file to the test-suite)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-native-compiler-option" "-native-compiler" "ondemand" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/quickchick/src" "QuickChick" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/ExtLib" "ExtLib" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/SimpleIO" "SimpleIO" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/mathcomp" "mathcomp" "-I" "/github/workspace/builds/coq/coq-failing/_build_ci/quickchick/plugin" "-top" "QuickChick.Instances") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 764 lines to 26 lines, then from 39 lines to 570 lines, then from 567 lines to 26 lines, then from 31 lines to 27 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 0.533 sec *)
Require QuickChick.Classes.

Import QuickChick.Classes.
Import QuickChick.Sets.
Import QuickChick.Producer.
#[global] Instance enumPairSized {A B : Type} `{EnumSized A} `{EnumSized B}
: EnumSized (A*B).
Admitted.

#[global] Instance enumPairSized_CorrectSized
         A {_ : EnumSized A} { _ : forall s, SizeMonotonic (@enumSized A _ s)}
         { _ : SizedMonotonic (@enumSized A _)} { _ : CorrectSized (@enumSized A _)}
         B {_ : EnumSized B} { _ : forall s, SizeMonotonic (@enumSized B _ s)}
         { _ : SizedMonotonic (@enumSized B _)} { _ : CorrectSized (@enumSized B _)}:
  CorrectSized (@enumSized (A * B) enumPairSized).
Proof.
  constructor.
split.
  {
 intros.
reflexivity.
}
  destruct a.
  intros _.
  destruct H1 as [[_ Hca]].
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 4.3MiB file on GitHub Actions Artifacts under build.log)
-xr-x 1 root root 22613416 May  3 12:41 coqchk
-rwxr-xr-x 1 root root  9473312 May  3 12:41 coqdep
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqdoc
-rwxr-xr-x 1 root root  9392344 May  3 12:41 coqdoc.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqide
-rwxr-xr-x 1 root root 21602928 May  3 12:42 coqide.orig
-rwxr-xr-x 1 root root     2132 May  3 20:50 coqidetop.byte
-rwxr-xr-x 1 root root 41836419 May  3 12:42 coqidetop.byte.orig
-rwxr-xr-x 1 root root     2131 May  3 20:50 coqidetop.opt
-rwxr-xr-x 1 root root 67900456 May  3 12:42 coqidetop.opt.orig
-rwxr-xr-x 1 root root     2127 May  3 20:50 coqnative
-rwxr-xr-x 1 root root 22718304 May  3 12:41 coqnative.orig
-rwxr-xr-x 1 root root     2123 May  3 20:50 coqpp
-rwxr-xr-x 1 root root  3430448 May  3 12:41 coqpp.orig
-rwxr-xr-x 1 root root     2133 May  3 20:50 coqtimelog2html
-rwxr-xr-x 1 root root  4633952 May  3 12:41 coqtimelog2html.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqtop
-rwxr-xr-x 1 root root     2129 May  3 20:50 coqtop.byte
-rwxr-xr-x 1 root root 59580852 May  3 12:41 coqtop.byte.orig
-rwxr-xr-x 1 root root     2128 May  3 20:50 coqtop.opt
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.opt.orig
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.orig
-rwxr-xr-x 1 root root     2123 May  3 20:50 coqwc
-rwxr-xr-x 1 root root  2357648 May  3 12:41 coqwc.orig
-rwxr-xr-x 1 root root     2131 May  3 20:50 coqworker.opt
-rwxr-xr-x 1 root root 67260312 May  3 12:41 coqworker.opt.orig
-rwxr-xr-x 1 root root     2128 May  3 20:50 coqworkmgr
-rwxr-xr-x 1 root root  3603640 May  3 12:41 coqworkmgr.orig
-rwxr-xr-x 1 root root     2126 May  3 20:50 csdpcert
-rwxr-xr-x 1 root root 81440368 May  3 12:41 csdpcert.orig
-rwxr-xr-x 1 root root     2129 May  3 20:50 ocamllibdep
-rwxr-xr-x 1 root root  3680048 May  3 12:41 ocamllibdep.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 votour
-rwxr-xr-x 1 root root  4405272 May  3 12:41 votour.orig
++ CI_BUILD_DIR=/github/workspace/builds/coq/coq-failing/_build_ci
++ CI_INSTALL_DIR=/github/workspace/builds/coq/coq-failing/_install_ci
++ ls -l /github/workspace/builds/coq/coq-failing/_build_ci
total 16
drwxr-xr-x  9 root root 4096 May  3 13:43 ext_lib
drwxr-xr-x  6 root root 4096 May  3 13:11 mathcomp
drwxr-xr-x 14 root root 4096 May  3 13:44 quickchick
drwxr-xr-x  6 root root 4096 May  3 13:44 simple_io
++ declare -A overlays
++ set +x
+ git_download quickchick
+ local project=quickchick
+ local dest=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
+ local giturl_var=quickchick_CI_GITURL
+ local giturl=https://github.com/QuickChick/QuickChick
+ local ref_var=quickchick_CI_REF
+ local ref=master
+ local ov_url=
+ local ov_ref=
+ '[' -d /github/workspace/builds/coq/coq-failing/_build_ci/quickchick ']'
+ echo 'Warning: download and unpacking of quickchick skipped because /github/workspace/builds/coq/coq-failing/_build_ci/quickchick already exists.'
Warning: download and unpacking of quickchick skipped because /github/workspace/builds/coq/coq-failing/_build_ci/quickchick already exists.
+ '[' '' ']'
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/quickchick
+ make
+ '[' -z x ']'
+ command make
+ make
make[1]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/quickchick'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqtop
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqtop.orig -config 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.JhHJLWUmEE
MINIMIZER_DEBUG: files: 
make -f Makefile.coq 
make[2]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/quickchick'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.4gtixjwZPb
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.XOkXNcYeZe
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.zpTGv95qte
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.9BuUBunA9e
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.33TzO4iMnt
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.GMsb9x7O7T
MINIMIZER_DEBUG: files: 
COQC src/Instances.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/quickchick
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-native-compiler-option -native-compiler ondemand -I /github/workspace/builds/coq/coq-failing/_build_ci/quickchick/plugin -R /github/workspace/builds/coq/coq-failing/_build_ci/quickchick/src QuickChick src/Instances.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.2xBIBwkLwX
MINIMIZER_DEBUG: files:  src/Instances.v
File "./src/Instances.v", line 309, characters 2-26:
Error: Cannot infer an instance of type "A" for the variable a in
environment:
A : Type
X : EnumSized A
H : forall s : nat, SizeMonotonic (enumSized s)
H0 : SizedMonotonic enumSized
prodCorrectSized : set_eq
                     (fun n : A => exists s : nat, semProd (enumSized s) n)
                     setT
B : Type
X0 : EnumSized B
H2 : forall s : nat, SizeMonotonic (enumSized s)
H3 : SizedMonotonic enumSized
H4 : CorrectSized enumSized
a : A
b : B

Command exited with non-zero status 1
src/Instances.vo (real: 1.37, user: 1.04, sys: 0.31, mem: 498916 ko)
Makefile.coq:809: recipe for target 'src/Instances.vo' failed
make[3]: *** [src/Instances.vo] Error 1
Makefile.coq:408: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/quickchick'
Makefile:26: recipe for target 'plugin' failed
make[1]: *** [plugin] Error 2
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/quickchick'
Makefile.ci:150: recipe for target 'ci-quickchick' failed
make: *** [ci-quickchick] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 420KiB file on GitHub Actions Artifacts under bug.log)
sful.�[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

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:

�[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/tmpu39od373/QuickChick/Instances.v", line 66, characters 0-8:
Error:  (in proof enumPairSized_CorrectSized): 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 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

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:

�[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/tmp4nbxgzcr/QuickChick/Instances.v", line 17, characters 0-8:
Error:  (in proof enumPairSized_CorrectSized): 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
�[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.

zeldovich added a commit to mit-pdos/perennial that referenced this pull request May 3, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/vst/msl/knot_prop.v (from ci-vst) (full log on GitHub Actions)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

Minimized Coq File (consider adding this file to the test-suite)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-w" "-deprecated-native-compiler-option,-native-compiler-disabled" "-native-compiler" "ondemand" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/msl" "VST.msl" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/sepcomp" "VST.sepcomp" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/veric" "VST.veric" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/zlist" "VST.zlist" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/floyd" "VST.floyd" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/progs" "VST.progs" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/concurrency" "VST.concurrency" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/atomics" "VST.atomics" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/wand_demo" "wand_demo" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/sha" "sha" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/hmacfcf" "hmacfcf" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/tweetnacl20140427" "tweetnacl20140427" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/hmacdrbg" "hmacdrbg" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/aes" "aes" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/mailbox" "mailbox" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/lib" "compcert.lib" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/common" "compcert.common" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/x86_32" "compcert.x86_32" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/x86" "compcert.x86" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/cfrontend" "compcert.cfrontend" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/export" "compcert.export" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Flocq" "Flocq" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "VST.msl.knot_prop") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 274 lines to 63 lines, then from 76 lines to 805 lines, then from 809 lines to 80 lines, then from 93 lines to 607 lines, then from 610 lines to 142 lines, then from 155 lines to 736 lines, then from 740 lines to 159 lines, then from 172 lines to 1133 lines, then from 1137 lines to 206 lines, then from 219 lines to 463 lines, then from 468 lines to 214 lines, then from 227 lines to 391 lines, then from 396 lines to 216 lines, then from 229 lines to 292 lines, then from 295 lines to 220 lines, then from 225 lines to 220 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 0.476 sec *)
Require Coq.Logic.ClassicalFacts.
Require Coq.Logic.FunctionalExtensionality.
Require Coq.micromega.Lia.

Export Coq.Logic.FunctionalExtensionality.

Axiom prop_ext: ClassicalFacts.prop_extensionality.

Tactic Notation "extensionality" ident(x0) ident(x1) ident(x2) :=
  extensionality x0; extensionality x1; extensionality x2.
Export Coq.micromega.Lia.

Definition compose (A B C:Type) (g:B -> C) (f:A -> B) := fun x => g (f x).
Arguments compose [A B C] _ _ _.
Infix "oo" := compose (at level 54, right associativity).

Definition id (A:Type) := fun x:A => x.

Record ageable_facts (A:Type) (level: A -> nat) (age1:A -> option A)  :=
{ af_unage : forall x':A, exists x, age1 x = Some x'
; af_level1 : forall x, age1 x = None <-> level x = 0
; af_level2 : forall x y, age1 x = Some y -> level x = S (level y)
}.

Class ageable (A:Type) := mkAgeable
{ level : A -> nat
; age1 : A -> option A
; age_facts : ageable_facts A level age1
}.

Section level'.
End level'.

Section RtRft.
End RtRft.

Section NAT_AGEABLE.

End NAT_AGEABLE.

Section BIJECTION.
End BIJECTION.

Section PROD.
  Variable A B : Type.
  Variable agA: ageable A.

  Let levelAB (x:prod A B) := level (fst x).
  Let age1AB (x:prod A B) :=
    match age1 (fst x) with
    | None => None
    | Some a' => Some (a',snd x)
    end.

  Lemma ag_prod_facts : ageable_facts (prod A B) levelAB age1AB.
Admitted.

  Definition ag_prod :=
    mkAgeable (prod A B) levelAB age1AB ag_prod_facts.

End PROD.

Section PROD'.

End PROD'.

Set Implicit Arguments.

Module Export CovariantFunctor.

Record functorFacts (PS : Type -> Type)
  (fmap : forall A B (f : A -> B), PS A -> PS B) : Type :=
FunctorFacts {
  ff_id : forall A, fmap _ _ (id A) = id (PS A);
  ff_comp : forall A B C (f : B -> C) (g : A -> B),
fmap _ _ f oo fmap _ _ g = fmap _ _ (f oo g)
}.

Record functor : Type := Functor {
  _functor: Type -> Type;
  fmap : forall A B (f : A -> B), _functor A -> _functor B;
  functor_facts : functorFacts _functor fmap
}.

Coercion CovariantFunctor._functor:
  CovariantFunctor.functor >-> Funclass.

Module Type TY_FUNCTOR.
  Parameter F : functor.

  Parameter T : Type.
  Parameter T_bot : T.

  Parameter other : Type.
End TY_FUNCTOR.

Module Type KNOT.
  Declare Module TF:TY_FUNCTOR.
  Import TF.

  Parameter knot : Type.

  Parameter ag_knot : ageable knot.
  #[global] Existing Instance ag_knot.
  #[global] Existing Instance ag_prod.

  Definition predicate := (knot * other) -> T.

  Parameter squash : (nat * F predicate) -> knot.
  Parameter unsquash : knot -> (nat * F predicate).
Definition approx (n:nat) (p:predicate) : predicate.
exact (fun w => if Compare_dec.le_gt_dec n (level w) then T_bot else p w).
Defined.
  Axiom unsquash_squash : forall n x', unsquash (squash (n,x')) = (n,fmap F (approx n) x').

End KNOT.

Module Knot (TF':TY_FUNCTOR) : KNOT with Module TF:=TF'.
  Module TF := TF'.
  Import TF.
Fixpoint sinv (n: nat) : Type.
Admitted.

  Definition knot := { n:nat & F (sinv n) }.

  Definition predicate := knot * other -> T.
Definition squash (x:nat * F predicate) : knot.
Admitted.
Definition unsquash (x:knot) : (nat * F predicate).
Admitted.

  Definition def_knot_level (k:knot) := fst (unsquash k).
Definition def_knot_age1 (k:knot) : option knot.
Admitted.
Definition approx (n:nat) (p:predicate) : predicate.
exact (fun w => if Compare_dec.le_gt_dec n (def_knot_level (fst w)) then T_bot else p w).
Defined.

  Lemma unsquash_squash : forall n x', unsquash (squash (n,x')) = (n,fmap F (approx n) x').
Admitted.

  Lemma ag_knot_facts : ageable_facts knot def_knot_level def_knot_age1.
Admitted.
Definition ag_knot : ageable knot.
exact (mkAgeable knot def_knot_level def_knot_age1 ag_knot_facts).
Defined.

End Knot.

Module Type TY_FUNCTOR_PROP.
  Parameter F : functor.
  Parameter other : Type.
End TY_FUNCTOR_PROP.

Module Type KNOT_HERED.
  Declare Module TF:TY_FUNCTOR_PROP.

End KNOT_HERED.

Module KnotHered (TF':TY_FUNCTOR_PROP) : KNOT_HERED with Module TF:=TF'.
  Module Export TF:=TF'.

  Section stratifies.
  End stratifies.

End KnotHered.

Module Type KNOT_PROP.
  Declare Module TF:TY_FUNCTOR_PROP.
End KNOT_PROP.

Module TyFunctorProp2TyFunctor (TF : TY_FUNCTOR_PROP) <: TY_FUNCTOR.

  Definition F := TF.F.
Definition T: Type.
exact (Prop).
Defined.
Definition T_bot : T.
exact (False).
Defined.

  Definition other := TF.other.
End TyFunctorProp2TyFunctor.

Module KnotProp (TF':TY_FUNCTOR_PROP) : KNOT_PROP with Module TF:=TF'.
  Module TF := TF'.

  Module TF_G := TyFunctorProp2TyFunctor(TF).

  Module Knot_G := Knot(TF_G).

  Import TF.
Definition knot : Type.
exact (Knot_G.knot).
Defined.
  Definition predicate := (knot * other) -> Prop.
Definition squash : (nat * F predicate) -> knot.
exact (Knot_G.squash).
Defined.
Definition unsquash : knot -> (nat * F predicate).
exact (Knot_G.unsquash).
Defined.

  Definition ag_knot := Knot_G.ag_knot.
  #[global] Existing Instance ag_knot.
Definition approx (n:nat) (p:predicate) : predicate.
exact (fun w => level w < n /\ p w).
Defined.

  Lemma unsquash_squash : forall n x', unsquash (squash (n,x')) = (n,fmap F (approx n) x').
  Proof.
    replace approx with Knot_G.approx.
    apply Knot_G.unsquash_squash.
    extensionality n p w.
    unfold approx, Knot_G.approx, TF_G.T_bot.
    case (Compare_dec.le_gt_dec n (level w)); intro; apply prop_ext; firstorder.
    unfold knot, TF_G.other, ag_knot in *.
lia.
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 3.7MiB file on GitHub Actions Artifacts under build.log)
ds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ ls -l /github/workspace/builds/coq/coq-failing/_install_ci/bin/
total 664728
-rwxr-xr-x 1 root root     2125 May  3 20:51 coq-tex
-rwxr-xr-x 1 root root  2754376 May  3 12:41 coq-tex.orig
-rwxr-xr-x 1 root root  8917640 May  3 12:41 coq_makefile
-rwxr-xr-x 1 root root     2122 May  3 20:51 coqc
-rwxr-xr-x 1 root root     2127 May  3 20:51 coqc.byte
-rwxr-xr-x 1 root root 41273893 May  3 12:41 coqc.byte.orig
-rwxr-xr-x 1 root root 67183512 May  3 12:41 coqc.orig
-rwxr-xr-x 1 root root 22613416 May  3 12:41 coqchk
-rwxr-xr-x 1 root root  9473312 May  3 12:41 coqdep
-rwxr-xr-x 1 root root     2124 May  3 20:51 coqdoc
-rwxr-xr-x 1 root root  9392344 May  3 12:41 coqdoc.orig
-rwxr-xr-x 1 root root     2124 May  3 20:51 coqide
-rwxr-xr-x 1 root root 21602928 May  3 12:42 coqide.orig
-rwxr-xr-x 1 root root     2132 May  3 20:51 coqidetop.byte
-rwxr-xr-x 1 root root 41836419 May  3 12:42 coqidetop.byte.orig
-rwxr-xr-x 1 root root     2131 May  3 20:51 coqidetop.opt
-rwxr-xr-x 1 root root 67900456 May  3 12:42 coqidetop.opt.orig
-rwxr-xr-x 1 root root     2127 May  3 20:51 coqnative
-rwxr-xr-x 1 root root 22718304 May  3 12:41 coqnative.orig
-rwxr-xr-x 1 root root     2123 May  3 20:51 coqpp
-rwxr-xr-x 1 root root  3430448 May  3 12:41 coqpp.orig
-rwxr-xr-x 1 root root     2133 May  3 20:51 coqtimelog2html
-rwxr-xr-x 1 root root  4633952 May  3 12:41 coqtimelog2html.orig
-rwxr-xr-x 1 root root     2124 May  3 20:51 coqtop
-rwxr-xr-x 1 root root     2129 May  3 20:51 coqtop.byte
-rwxr-xr-x 1 root root 59580852 May  3 12:41 coqtop.byte.orig
-rwxr-xr-x 1 root root     2128 May  3 20:51 coqtop.opt
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.opt.orig
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.orig
-rwxr-xr-x 1 root root     2123 May  3 20:51 coqwc
-rwxr-xr-x 1 root root  2357648 May  3 12:41 coqwc.orig
-rwxr-xr-x 1 root root     2131 May  3 20:51 coqworker.opt
-rwxr-xr-x 1 root root 67260312 May  3 12:41 coqworker.opt.orig
-rwxr-xr-x 1 root root     2128 May  3 20:51 coqworkmgr
-rwxr-xr-x 1 root root  3603640 May  3 12:41 coqworkmgr.orig
-rwxr-xr-x 1 root root     2126 May  3 20:51 csdpcert
-rwxr-xr-x 1 root root 81440368 May  3 12:41 csdpcert.orig
-rwxr-xr-x 1 root root     2129 May  3 20:51 ocamllibdep
-rwxr-xr-x 1 root root  3680048 May  3 12:41 ocamllibdep.orig
-rwxr-xr-x 1 root root     2124 May  3 20:51 votour
-rwxr-xr-x 1 root root  4405272 May  3 12:41 votour.orig
++ CI_BUILD_DIR=/github/workspace/builds/coq/coq-failing/_build_ci
++ CI_INSTALL_DIR=/github/workspace/builds/coq/coq-failing/_install_ci
++ ls -l /github/workspace/builds/coq/coq-failing/_build_ci
total 8
drwxr-xr-x  5 root root 4096 May  3 13:09 flocq
drwxr-xr-x 32 root root 4096 May  3 13:17 vst
++ declare -A overlays
++ set +x
+ git_download vst
+ local project=vst
+ local dest=/github/workspace/builds/coq/coq-failing/_build_ci/vst
+ local giturl_var=vst_CI_GITURL
+ local giturl=https://github.com/PrincetonUniversity/VST
+ local ref_var=vst_CI_REF
+ local ref=master
+ local ov_url=
+ local ov_ref=
+ '[' -d /github/workspace/builds/coq/coq-failing/_build_ci/vst ']'
+ echo 'Warning: download and unpacking of vst skipped because /github/workspace/builds/coq/coq-failing/_build_ci/vst already exists.'
Warning: download and unpacking of vst skipped because /github/workspace/builds/coq/coq-failing/_build_ci/vst already exists.
+ '[' '' ']'
+ export COMPCERT=bundled
+ COMPCERT=bundled
+ ulimit -s
16384
+ ulimit -s 65536
+ ulimit -s
65536
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/vst
+ make IGNORECOQVERSION=true
+ '[' -z x ']'
+ command make IGNORECOQVERSION=true
+ make IGNORECOQVERSION=true
make[1]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/vst'
===== CONFIGURATION SUMMARY =====
COMPCERT=bundled
COMPCERT_SRC_DIR=compcert
COMPCERT_INST_DIR=compcert
ZLIST=bundled
BITSIZE=32
ARCH=x86
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/vst
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -where 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.b1SkkszXFw
MINIMIZER_DEBUG: files: 
INSTALLDIR=/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq-variant/VST32/VST
===== DERIVED CONFIGURATION =====
COMPCERT_INFO_PATH_REF=compcert
COMPCERT_EXPLICIT_PATH=true
COMPCERT_BUILD_FROM_SRC=true
COMPCERT_NEW=false
COQFLAGS=  -Q msl VST.msl   -Q sepcomp VST.sepcomp   -Q veric VST.veric   -Q zlist VST.zlist   -Q floyd VST.floyd   -Q progs VST.progs   -Q concurrency VST.concurrency     -Q atomics VST.atomics   -Q wand_demo wand_demo   -Q sha sha   -Q hmacfcf hmacfcf   -Q tweetnacl20140427 tweetnacl20140427   -Q hmacdrbg hmacdrbg   -Q aes aes   -Q mailbox mailbox    -Q compcert/lib compcert.lib  -Q compcert/common compcert.common  -Q compcert/x86_32 compcert.x86_32  -Q compcert/x86 compcert.x86  -Q compcert/cfrontend compcert.cfrontend  -Q compcert/export compcert.export   
COMPCERT_R_FLAGS= -R compcert/lib compcert.lib  -R compcert/common compcert.common  -R compcert/x86_32 compcert.x86_32  -R compcert/x86 compcert.x86  -R compcert/cfrontend compcert.cfrontend  -R compcert/export compcert.export
=================================
COQC msl/knot_prop.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/vst
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/msl VST.msl -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/sepcomp VST.sepcomp -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/veric VST.veric -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/zlist VST.zlist -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/floyd VST.floyd -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/progs VST.progs -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/concurrency VST.concurrency -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/atomics VST.atomics -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/wand_demo wand_demo -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/sha sha -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/hmacfcf hmacfcf -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/tweetnacl20140427 tweetnacl20140427 -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/hmacdrbg hmacdrbg -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/aes aes -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/mailbox mailbox -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/lib compcert.lib -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/common compcert.common -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/x86_32 compcert.x86_32 -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/x86 compcert.x86 -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/cfrontend compcert.cfrontend -Q /github/workspace/builds/coq/coq-failing/_build_ci/vst/compcert/export compcert.export msl/knot_prop.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.uiEdY79zhP
MINIMIZER_DEBUG: files:  msl/knot_prop.v
File "./msl/knot_prop.v", line 123, characters 43-46:
Error: Tactic failure:  Cannot find witness.

Makefile:695: recipe for target 'msl/knot_prop.vo' failed
make[1]: *** [msl/knot_prop.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/vst'
Makefile.ci:150: recipe for target 'ci-vst' failed
make: *** [ci-vst] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 404KiB file on GitHub Actions Artifacts under bug.log)
)
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp6uggide4/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp2efm4ehs/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[93mIntermediate code not saved.�[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/tmp6uggide4/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp6uggide4/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp2efm4ehs/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module KnotProp and module CovariantFunctor need to be closed.


�[93mIntermediate code not saved.�[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:
Error: The module KnotProp and module CovariantFunctor need to be closed.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
File "/tmp/tmpr7buslbd/VST/msl/knot_prop.v", line 212, characters 0-8:
Error:  (in proof unsquash_squash): 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 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/tmp7yfok5w3/VST/msl/knot_prop.v", line 113, characters 0-8:
Error:  (in proof approx): 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/tmp6uggide4/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp6uggide4/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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/tmp2efm4ehs/VST/msl/knot_prop.v", line 47, characters 2-44:
Error:
The following term contains unresolved implicit arguments:
  (fun x : A * B => level (fst x))
More precisely: 
- ?ageable: Cannot infer the implicit parameter ageable of level whose type
  is "ageable A" (no type class instance found) in
  environment:
  A, B : Type
  x : A * B


�[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

Non-fatal error: Failed to remove empty sections and preserve the error.  
The new error was:
File "/tmp/tmp62dt6xaz/VST/msl/knot_prop.v", line 166, characters 0-70:
Error: TF' already exists.


�[93mChanged file not saved.�[0m

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.

liyishuai pushed a commit to QuickChick/QuickChick that referenced this pull request May 3, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 3, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src/Util/Loops.v (from ci-fiat_crypto_legacy) (full log on GitHub Actions)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

Minimized Coq File (consider adding this file to the test-suite)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-hint-rewrite-without-locality,+deprecated-hint-without-locality,+deprecated-instance-without-locality,unsupported-attributes" "-w" "-notation-overridden" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src" "Crypto" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv" "bbv" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src/Coqprime" "Coqprime" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-I" "/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src" "-top" "Crypto.Util.Loops") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 478 lines to 90 lines, then from 95 lines to 91 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 0.480 sec *)
Require Coq.micromega.Lia.

Import Coq.micromega.Lia.
  Section Loops.
    Context {A B : Type} (body : A -> A + B).
Fixpoint loop (fuel : nat) (s : A) {struct fuel} : A + B.
Admitted.

    Context (body_cps : A -> forall T, (A + B -> T) -> T).

    Context (body_cps_ok : forall s {R} f, body_cps s R f = f (body s)).

    Context (body_cps2 : A -> forall R, (A -> R) -> (B -> R) -> R).

    Context (body_cps2_ok : forall s {R} continue break,
                body_cps2 s R continue break =
                match body s with
                | inl a => continue a
                | inr b => break b
                end).

    Local Lemma loop_fuel_0 s : loop 0 s = body s.
Admitted.

    Lemma loop_fuel_irrelevant n m s bn bm
          (Hn : loop n s = inr bn)
          (Hm : loop m s = inr bm)
      : bn = bm.
Admitted.

    Definition iterations_required fuel s : option nat :=
      nat_rect _ None
               (fun n r =>
                  match r with
                  | Some _ => r
                  | None =>
                    match loop n s with
                    | inl a => None
                    | inr b => Some n
                    end
                  end
               ) fuel.

    Lemma iterations_required_correct fuel s :
      (forall m, iterations_required fuel s = Some m ->
                 m < fuel /\
                 exists b, forall n, (n < m -> exists a, loop n s = inl a) /\ (m <= n -> loop n s = inr b))
      /\
      (iterations_required fuel s = None -> forall n, n < fuel -> exists a, loop n s = inl a).
Admitted.

    Lemma iterations_required_step fuel s s' n
          (Hs : iterations_required fuel s = Some (S n))
          (Hstep : body s = inl s')
      : iterations_required fuel s' = Some n.
Admitted.

    Local Lemma invariant_complete (P:_->Prop) f s0 b (H:loop f s0 = inr b) (HP:P b)
      : exists inv measure,
        (inv s0 /\ measure s0 <= f)
        /\ forall s, inv s -> match body s with
                              | inl s' => inv s' /\ measure s' < measure s
                              | inr s' => P s'
                              end.
    Proof.
      set (measure s := match iterations_required (S f) s with None => 0 | Some n => n end).
      exists (fun s => match loop (measure s) s with
                       | inl a => False
                       | inr r => r = b end).
      exists (measure); split; [ |repeat match goal with |- _ /\ _ => split end..].
      {
 cbv [measure].
        destruct (iterations_required (S f) s0) eqn:Hs0;
          eapply iterations_required_correct in Hs0;
          [ .. | exact (ltac:(lia):f <S f)]; [|destruct Hs0; congruence].
        destruct Hs0 as [? [? Hs0]]; split; [|lia].
        pose proof (proj2 (Hs0 n) ltac:(lia)) as HH; rewrite HH.
        exact (loop_fuel_irrelevant _ _ _ _ _ HH H).
}
      {
 intros s Hinv; destruct (body s) as [s'|c] eqn:Hstep.
        {
 destruct (loop (measure s) s) eqn:Hs; [contradiction|subst].
          cbv [measure] in *.
          destruct (iterations_required (S f) s) eqn:Hs' in *; try destruct n;
            try (rewrite loop_fuel_0 in Hs; congruence); [].
          pose proof (iterations_required_step _ _ s' _ Hs' Hstep) as HA.
          rewrite HA.
          destruct (proj1 (iterations_required_correct _ _) _ HA) as [? [? [? HE']]].
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 11MiB file on GitHub Actions Artifacts under build.log)
q-failing/_install_ci/bin/coqworker.opt
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqworker.opt.orig --kind=tactic -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv -worker-id tactic:1 -async-proofs-worker-priority high -main-channel stdfds 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.9KXcZ1yps1
MINIMIZER_DEBUG: files: 
src/Curves/Edwards/XYZT/Basic.vo (real: 18.01, user: 19.10, sys: 1.04, mem: 893396 ko)
TIMEOUT -m 10000000 COQC src/Curves/Edwards/XYZT/Precomputed.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv src/Curves/Edwards/XYZT/Precomputed.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.XFxWjoQPwY
MINIMIZER_DEBUG: files:  src/Curves/Edwards/XYZT/Precomputed.v
src/Curves/Edwards/XYZT/Precomputed.vo (real: 1.56, user: 1.29, sys: 0.26, mem: 505380 ko)
TIMEOUT -m 10000000 COQC src/Spec/MontgomeryCurve.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv src/Spec/MontgomeryCurve.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.rdasZKZL8T
MINIMIZER_DEBUG: files:  src/Spec/MontgomeryCurve.v
src/Spec/MontgomeryCurve.vo (real: 3.20, user: 2.96, sys: 0.23, mem: 519336 ko)
TIMEOUT -m 10000000 COQC src/Spec/WeierstrassCurve.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv src/Spec/WeierstrassCurve.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.xgHRr9KTCs
MINIMIZER_DEBUG: files:  src/Spec/WeierstrassCurve.v
File "./src/Spec/WeierstrassCurve.v", line 78, characters 0-29:
Warning: Declaring a scope implicitly is deprecated; use in advance an
explicit "Declare Scope W_scope.". [undeclared-scope,deprecated]
src/Spec/WeierstrassCurve.vo (real: 1.96, user: 1.69, sys: 0.27, mem: 498264 ko)
TIMEOUT -m 10000000 COQC src/Curves/Montgomery/Affine.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv src/Curves/Montgomery/Affine.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.CCXRYHlnOT
MINIMIZER_DEBUG: files:  src/Curves/Montgomery/Affine.v
src/Curves/Montgomery/Affine.vo (real: 4.70, user: 4.45, sys: 0.25, mem: 534548 ko)
TIMEOUT -m 10000000 COQC src/Util/Loops.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/coqprime/src
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-hint-rewrite-without-locality\,+deprecated-hint-without-locality\,+deprecated-instance-without-locality\,unsupported-attributes -w -notation-overridden -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/src Crypto -R /github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy/bbv/src/bbv bbv src/Util/Loops.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.sfC1vj1QAf
MINIMIZER_DEBUG: files:  src/Util/Loops.v
File "./src/Util/Loops.v", line 274, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
body_cps : A -> forall T : Type, (A + B -> T) -> T
body_cps_ok : forall (s : A) (R : Type) (f : A + B -> R),
              body_cps s R f = f (body s)
body_cps2 : A -> forall R : Type, (A -> R) -> (B -> R) -> R
body_cps2_ok : forall (s : A) (R : Type) (continue : A -> R) (break : B -> R),
               body_cps2 s R continue break =
               match body s with
               | inl a => continue a
               | inr b => break b
               end
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)

Command exited with non-zero status 1
src/Util/Loops.vo (real: 0.73, user: 0.52, sys: 0.21, mem: 460620 ko)
Makefile.coq:809: recipe for target 'src/Util/Loops.vo' failed
make[1]: *** [src/Util/Loops.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/fiat_crypto_legacy'
Makefile.ci:150: recipe for target 'ci-fiat_crypto_legacy' failed
make: *** [ci-fiat_crypto_legacy] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 71KiB file on GitHub Actions Artifacts under bug.log)
(n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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/tmpstfh6mef/Crypto/Util/Loops.v", line 76, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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/tmpstfh6mef/Crypto/Util/Loops.v", line 76, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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/tmpstfh6mef/Crypto/Util/Loops.v", line 76, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The section Loops needs to be closed.


�[93mIntermediate code not saved.�[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:
Error: The section Loops needs to be closed.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
File "/tmp/tmp780m7kt4/Crypto/Util/Loops.v", line 66, characters 0-8:
Error:  (in proof invariant_complete): 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 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/tmp780m7kt4/Crypto/Util/Loops.v", line 66, characters 0-8:
Error:  (in proof invariant_complete): 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/tmpstfh6mef/Crypto/Util/Loops.v", line 76, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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/tmpstfh6mef/Crypto/Util/Loops.v", line 76, characters 10-84:
Error: Cannot infer an instance of type "nat" for the variable n in
environment:
A : Type
B : Type
body : A -> A + B
P : B -> Prop
f : nat
s0 : A
b : B
H : loop f s0 = inr b
HP : P b
measure := fun s : A =>
           match iterations_required (S f) s with
           | Some n => n
           | None => 0
           end : A -> nat
s : A
n : nat
Hs' : iterations_required (S f) s = Some (S n)
Hs : loop (S n) s = inr b
s' : A
Hstep : body s = inl s'
HA : iterations_required (S f) s' = Some n
H0 : n < S f
x : B
H1 : forall n0 : nat,
     (n0 < n -> exists a : A, loop n0 s' = inl a) /\
     (n <= n0 -> loop n0 s' = inr x)


�[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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

🔴 CI failures at commit 59b2ccd without any failure in the test-suite

✔️ Corresponding jobs for the base commit 65720db succeeded

❔ Ask me to try to extract minimal test cases that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following targets: ci-fiat_crypto_legacy, ci-math_classes, ci-metacoq, ci-perennial, ci-vst
  • You can also pass me a specific list of targets to minimize as arguments.
  • If you tag me saying @coqbot ci minimize all, I will additionally minimize the following target (which I do not suggest minimizing): ci-fiat_crypto (because base job at 65720db failed)

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.v (from ci-perennial) (interrupted by timeout, being automatically continued) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 48KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-w" "-ssr-search-moved" "-w" "+deprecated-hint-without-locality" "-w" "+deprecated-instance-without-locality" "-w" "-future-coercion-class-field" "-w" "+deprecated-hint-rewrite-without-locality" "-w" "-deprecated-field-instance-without-locality" "-w" "+deprecated-tactic-notation" "-w" "-notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality" "-w" "-deprecated-native-compiler-option,-native-compiler-disabled" "-native-compiler" "ondemand" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/src" "Perennial" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp" "stdpp" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable" "stdpp.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris" "iris" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated" "iris.deprecated" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable" "iris.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang" "iris.heap_lang" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil" "coqutil" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose" "Goose" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src" "RecordUpdate" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src" "Tactical" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src" "iris_named_props" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Perennial.base_logic.lib.wsat") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 1064 lines to 89 lines, then from 102 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 783 lines, then from 785 lines to 113 lines, then from 126 lines to 480 lines, then from 485 lines to 130 lines, then from 143 lines to 668 lines, then from 673 lines to 175 lines, then from 188 lines to 343 lines, then from 348 lines to 176 lines, then from 189 lines to 351 lines, then from 356 lines to 176 lines, then from 189 lines to 530 lines, then from 535 lines to 181 lines, then from 194 lines to 1498 lines, then from 1503 lines to 220 lines, then from 233 lines to 3895 lines, then from 3900 lines to 1287 lines, then from 1300 lines to 1388 lines, then from 1393 lines to 1387 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 1.961 sec *)
Require Coq.Bool.Bool.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Init.Ltac.
Require Coq.Init.Peano.
Require Coq.Lists.List.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require Coq.Setoids.Setoid.
Require Coq.Sorting.Permutation.
Require Coq.Unicode.Utf8.
Require Coq.micromega.Lia.
Require Coq.QArith.QArith_base.
Require Coq.QArith.Qcanon.
Require Coq.Logic.EqdepFacts.
Require Coq.PArith.PArith.
Require Coq.NArith.NArith.
Require Coq.ZArith.ZArith.
Require Coq.Numbers.Natural.Peano.NPeano.
Require Coq.QArith.QArith.
Require stdpp.options.
Require stdpp.base.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require stdpp.tactics.
Require stdpp.option.
Require stdpp.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.well_founded.
Require stdpp.countable.
Require stdpp.vector.
Require stdpp.finite.
Require Coq.ssr.ssreflect.
Require stdpp.orders.
Require stdpp.sets.
Require stdpp.relations.
Require stdpp.fin_sets.
Require stdpp.listset.
Require stdpp.lexico.
Require stdpp.prelude.
Require iris.prelude.options.
Require iris.prelude.prelude.
Require iris.algebra.ofe.
Require iris.algebra.monoid.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.functions.
Require Coq.Strings.Ascii.
Require Coq.Strings.String.
Require stdpp.strings.
Require stdpp.pretty.
Require stdpp.infinite.
Require stdpp.fin_maps.
Require stdpp.fin_map_dom.
Require stdpp.mapset.
Require stdpp.pmap.
Require stdpp.propset.
Require stdpp.gmap.
Require stdpp.functions.
Require stdpp.gmultiset.
Require iris.algebra.big_op.
Require iris.algebra.list.
Require iris.algebra.local_updates.
Require iris.algebra.gset.
Require iris.algebra.proofmode_classes.
Require iris.algebra.gmap.
Require stdpp.coPset.
Require stdpp.namespaces.
Require iris.bi.notation.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.extensions.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
Require iris.bi.big_op.
Require iris.bi.internal_eq.
Require iris.bi.plainly.
Require iris.bi.updates.
Require iris.bi.embedding.
Require iris.bi.bi.
Require iris.proofmode.base.
Require iris.proofmode.ident_name.
Require iris.proofmode.modalities.
Require iris.proofmode.classes.
Require iris.algebra.cofe_solver.
Require iris.algebra.frac.
Require iris.base_logic.upred.
Require iris.base_logic.bi.
Require iris.base_logic.derived.
Require iris.base_logic.proofmode.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require Perennial.base_logic.lib.own.
Require iris.proofmode.coq_tactics.
Require iris.proofmode.intro_patterns.
Require iris.proofmode.reduction.
Require iris.proofmode.spec_patterns.
Require iris.proofmode.string_ident.
Import stdpp.tactics.

 
Inductive tlist := tnil : tlist | tcons : Type → tlist → tlist.

Inductive hlist : tlist → Type :=
  | hnil : hlist tnil
  | hcons {A As} : A → hlist As → hlist (tcons A As).
Import stdpp.namespaces.
Import iris.proofmode.intro_patterns.
Import iris.proofmode.spec_patterns.
Import iris.proofmode.sel_patterns.
Import iris.proofmode.coq_tactics.
Import iris.proofmode.reduction.
Import iris.proofmode.string_ident.

Ltac iSolveSideCondition :=
  lazymatch goal with
  | |- pm_error ?err => fail "" err
  | _ => split_and?; try solve [ fast_done | solve_ndisj | tc_solve ]
  end.

Ltac pretty_ident H :=
  lazymatch H with
  | INamed ?H => H
  | ?H => H
  end.

Ltac iGetCtx :=
  lazymatch goal with
  | |- envs_entails ?Δ _ => Δ
  | |- context[ envs_split _ _ ?Δ ] => Δ
  end.

Ltac iMissingHypsCore Δ Hs :=
  let Hhyps := pm_eval (envs_dom Δ) in
  eval vm_compute in (list_difference Hs Hhyps).

Ltac iTypeOf H :=
  let Δ := match goal with |- envs_entails ?Δ _ => Δ end in
  pm_eval (envs_lookup H Δ).

Ltac iBiOfGoal :=
  match goal with |- @envs_entails ?PROP _ _ => PROP end.

Tactic Notation "iStartProof" :=
  lazymatch goal with
  | |- envs_entails _ _ => idtac
  | |- ?φ => notypeclasses refine (as_emp_valid_2 φ _ _);
               [tc_solve || fail "iStartProof: not a BI assertion"
               |notypeclasses refine (tac_start _ _)]
  end.

Ltac iFresh :=

  let start :=
    lazymatch goal with
    | _ => iStartProof
    end in
  let c :=
    lazymatch goal with
    | |- envs_entails (Envs _ _ ?c) _ => c
    end in
  let inc :=
    lazymatch goal with
    | |- envs_entails (Envs ?Δp ?Δs _) ?Q =>
      let c' := eval vm_compute in (Pos.succ c) in
      change_no_check (envs_entails (Envs Δp Δs c') Q)
    end in
  constr:(IAnon c).

Tactic Notation "iRename" constr(H1) "into" constr(H2) :=
  eapply tac_rename with H1 H2 _ _;
    [pm_reflexivity ||
     let H1 := pretty_ident H1 in
     fail "iRename:" H1 "not found"
    |pm_reduce;
     lazymatch goal with
       | |- False =>
         let H2 := pretty_ident H2 in
         fail "iRename:" H2 "not fresh"
       | _ => idtac
     end].

Inductive esel_pat :=
  | ESelPure
  | ESelIdent :   bool → ident → esel_pat.

Local Ltac iElaborateSelPat_go pat Δ Hs :=
  lazymatch pat with
  | [] => eval cbv in Hs
  | SelPure :: ?pat =>  iElaborateSelPat_go pat Δ (ESelPure :: Hs)
  | SelIntuitionistic :: ?pat =>
    let Hs' := pm_eval (env_dom (env_intuitionistic Δ)) in
    let Δ' := pm_eval (envs_clear_intuitionistic Δ) in
    iElaborateSelPat_go pat Δ' ((ESelIdent true <$> Hs') ++ Hs)
  | SelSpatial :: ?pat =>
    let Hs' := pm_eval (env_dom (env_spatial Δ)) in
    let Δ' := pm_eval (envs_clear_spatial Δ) in
    iElaborateSelPat_go pat Δ' ((ESelIdent false <$> Hs') ++ Hs)
  | SelIdent ?H :: ?pat =>
    lazymatch pm_eval (envs_lookup_delete false H Δ) with
    | Some (?p,_,?Δ') =>  iElaborateSelPat_go pat Δ' (ESelIdent p H :: Hs)
    | None =>
      let H := pretty_ident H in
      fail "iElaborateSelPat:" H "not found"
    end
  end.

Ltac iElaborateSelPat pat :=
  lazymatch goal with
  | |- envs_entails ?Δ _ =>
    let pat := sel_pat.parse pat in iElaborateSelPat_go pat Δ (@nil esel_pat)
  end.

Local Ltac iClearHyp H :=
  eapply tac_clear with H _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iClear:" H "not found"
    |pm_reduce; tc_solve ||
     let H := pretty_ident H in
     let P := match goal with |- TCOr (Affine ?P) _ => P end in
     fail "iClear:" H ":" P "not affine and the goal not absorbing"
    |pm_reduce].

Local Ltac iClear_go Hs :=
  lazymatch Hs with
  | [] => idtac
  | ESelPure :: ?Hs => clear; iClear_go Hs
  | ESelIdent _ ?H :: ?Hs => iClearHyp H; iClear_go Hs
  end.
Tactic Notation "iClear" constr(Hs) :=
  iStartProof; let Hs := iElaborateSelPat Hs in iClear_go Hs.

Tactic Notation "iExact" constr(H) :=
  eapply tac_assumption with H _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iExact:" H "not found"
    |tc_solve ||
     let H := pretty_ident H in
     let P := match goal with |- FromAssumption _ ?P _ => P end in
     fail "iExact:" H ":" P "does not match goal"
    |pm_reduce; tc_solve ||
     let H := pretty_ident H in
     fail "iExact: remaining hypotheses not affine and the goal not absorbing"].

Tactic Notation "iAssumptionCoq" :=
  let Hass := fresh in
  match goal with
  | H : ⊢ ?P |- envs_entails _ ?Q =>
     pose proof (_ : FromAssumption false P Q) as Hass;
     notypeclasses refine (tac_assumption_coq _ P _ H _ _);
       [exact Hass
       |pm_reduce; tc_solve ||
        fail 2 "iAssumption: remaining hypotheses not affine and the goal not absorbing"]
  end.

Tactic Notation "iAssumption" :=
  let Hass := fresh in
  let rec find p Γ Q :=
    lazymatch Γ with
    | Esnoc ?Γ ?j ?P => first
       [pose proof (_ : FromAssumption p P Q) as Hass;
        eapply (tac_assumption _ j p P);
          [pm_reflexivity
          |exact Hass
          |pm_reduce; tc_solve ||
           fail 2 "iAssumption: remaining hypotheses not affine and the goal not absorbing"]
       |assert_fails (is_evar P);
        assert (P = False%I) as Hass by reflexivity;
        apply (tac_false_destruct _ j p P);
          [pm_reflexivity
          |exact Hass]
       |find p Γ Q]
    end in
  lazymatch goal with
  | |- envs_entails (Envs ?Γp ?Γs _) ?Q =>
     first [find true Γp Q
           |find false Γs Q
           |iAssumptionCoq
           |fail "iAssumption:" Q "not found"]
  end.

Tactic Notation "iExFalso" := apply tac_ex_falso.

Local Tactic Notation "iIntuitionistic" constr(H) "as" constr(H') :=
  eapply tac_intuitionistic with H H' _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iIntuitionistic:" H "not found"
    |tc_solve ||
     let P := match goal with |- IntoPersistent _ ?P _ => P end in
     fail "iIntuitionistic:" P "not persistent"
    |pm_reduce; tc_solve ||
     let P := match goal with |- TCOr (Affine ?P) _ => P end in
     fail "iIntuitionistic:" P "not affine and the goal not absorbing"
    |pm_reduce;
     lazymatch goal with
     | |- False =>
       let H' := pretty_ident H' in
       fail "iIntuitionistic:" H' "not fresh"
     | _ => idtac
     end].

Local Tactic Notation "iSpatial" constr(H) "as" constr(H') :=
  eapply tac_spatial with H H' _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iSpatial:" H "not found"
    |pm_reduce; tc_solve
    |pm_reduce;
     lazymatch goal with
     | |- False =>
       let H' := pretty_ident H' in
       fail "iSpatial:" H' "not fresh"
     | _ => idtac
     end].

Tactic Notation "iPure" constr(H) "as" simple_intropattern(pat) :=
  eapply tac_pure with H _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iPure:" H "not found"
    |tc_solve ||
     let P := match goal with |- IntoPure ?P _ => P end in
     fail "iPure:" P "not pure"
    |pm_reduce; tc_solve ||
     let P := match goal with |- TCOr (Affine ?P) _ => P end in
     fail "iPure:" P "not affine and the goal not absorbing"
    |pm_reduce; intros pat].

Tactic Notation "iEmpIntro" :=
  iStartProof;
  eapply tac_emp_intro;
    [pm_reduce; tc_solve ||
     fail "iEmpIntro: spatial context contains non-affine hypotheses"].

Tactic Notation "iPureIntro" :=
  iStartProof;
  eapply tac_pure_intro;
    [tc_solve ||
     let P := match goal with |- FromPure _ ?P _ => P end in
     fail "iPureIntro:" P "not pure"
    |pm_reduce; tc_solve ||
     fail "iPureIntro: spatial context contains non-affine hypotheses"
    |].

Ltac iFrameFinish :=
  pm_prettify;
  try match goal with
  | |- envs_entails _ True => by iPureIntro
  | |- envs_entails _ emp => iEmpIntro
  end.

Ltac iFramePure t :=
  iStartProof;
  let φ := type of t in
  eapply (tac_frame_pure _ _ _ _ t);
    [tc_solve || fail "iFrame: cannot frame" φ
    |iFrameFinish].

Ltac iFrameHyp H :=
  iStartProof;
  eapply tac_frame with H _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iFrame:" H "not found"
    |tc_solve ||
     let R := match goal with |- Frame _ ?R _ _ => R end in
     fail "iFrame: cannot frame" R
    |pm_reduce; iFrameFinish].

Ltac iFrameAnyPure :=
  repeat match goal with H : _ |- _ => iFramePure H end.

Ltac iFrameAnyIntuitionistic :=
  iStartProof;
  let rec go Hs :=
    match Hs with [] => idtac | ?H :: ?Hs => repeat iFrameHyp H; go Hs end in
  match goal with
  | |- envs_entails ?Δ _ =>
     let Hs := eval cbv in (env_dom (env_intuitionistic Δ)) in go Hs
  end.

Ltac iFrameAnySpatial :=
  iStartProof;
  let rec go Hs :=
    match Hs with [] => idtac | ?H :: ?Hs => try iFrameHyp H; go Hs end in
  match goal with
  | |- envs_entails ?Δ _ =>
     let Hs := eval cbv in (env_dom (env_spatial Δ)) in go Hs
  end.

Local Ltac iFrame_go Hs :=
  lazymatch Hs with
  | [] => idtac
  | SelPure :: ?Hs => iFrameAnyPure; iFrame_go Hs
  | SelIntuitionistic :: ?Hs => iFrameAnyIntuitionistic; iFrame_go Hs
  | SelSpatial :: ?Hs => iFrameAnySpatial; iFrame_go Hs
  | SelIdent ?H :: ?Hs => iFrameHyp H; iFrame_go Hs
  end.

Tactic Notation "iFrame" constr(Hs) :=
  let Hs := sel_pat.parse Hs in iFrame_go Hs.

Local Tactic Notation "iIntro" "(" simple_intropattern(x) ")" :=

  (

    intros x
  ) || (

    iStartProof;
    lazymatch goal with
    | |- envs_entails _ _ =>
      eapply tac_forall_intro;
        [tc_solve ||
         let P := match goal with |- FromForall ?P _ _ => P end in
         fail "iIntro: cannot turn" P "into a universal quantifier"
        |let name := lazymatch goal with
                     | |- let _ := (λ name, _) in _ => name
                     end in
         pm_prettify;
         let y := fresh name in
         intros y; revert y; intros x
          ]
    end).

Local Tactic Notation "iIntro" constr(H) :=
  iStartProof;
  first
  [
    eapply tac_impl_intro with H _ _ _;
      [tc_solve
      |pm_reduce; tc_solve ||
       let P := lazymatch goal with |- Persistent ?P => P end in
       let H := pretty_ident H in
       fail 1 "iIntro: introducing non-persistent" H ":" P
              "into non-empty spatial context"
      |tc_solve
      |pm_reduce;
       let H := pretty_ident H in
        lazymatch goal with
        | |- False =>
          let H := pretty_ident H in
          fail 1 "iIntro:" H "not fresh"
        | _ => idtac
        end]
  |
    eapply tac_wand_intro with H _ _;
      [tc_solve
      | pm_reduce;
        lazymatch goal with
        | |- False =>
          let H := pretty_ident H in
          fail 1 "iIntro:" H "not fresh"
        | _ => idtac
        end]
  | let H := pretty_ident H in
    fail 1 "iIntro: could not introduce" H ", goal is not a wand or implication" ].

Local Tactic Notation "iIntro" "#" constr(H) :=
  iStartProof;
  first
  [
   eapply tac_impl_intro_intuitionistic with H _ _ _;
     [tc_solve
     |tc_solve ||
      let P := match goal with |- IntoPersistent _ ?P _ => P end in
      fail 1 "iIntro:" P "not persistent"
     |pm_reduce;
      lazymatch goal with
      | |- False =>
        let H := pretty_ident H in
        fail 1 "iIntro:" H "not fresh"
      | _ => idtac
      end]
  |
   eapply tac_wand_intro_intuitionistic with H _ _ _;
     [tc_solve
     |tc_solve ||
      let P := match goal with |- IntoPersistent _ ?P _ => P end in
      fail 1 "iIntro:" P "not intuitionistic"
     |tc_solve ||
      let P := match goal with |- TCOr (Affine ?P) _ => P end in
      fail 1 "iIntro:" P "not affine and the goal not absorbing"
     |pm_reduce;
      lazymatch goal with
      | |- False =>
        let H := pretty_ident H in
        fail 1 "iIntro:" H "not fresh"
      | _ => idtac
      end]
  |fail 1 "iIntro: nothing to introduce"].

Local Tactic Notation "iIntro" constr(H) "as" constr(p) :=
  lazymatch p with
  | true => iIntro #H
  | _ =>  iIntro H
  end.

Local Tactic Notation "iIntroForall" :=
  lazymatch goal with
  | |- ∀ _, ?P => fail
  | |- ∀ _, _ => intro
  | |- let _ := _ in _ => intro
  | |- _ =>
    iStartProof;
    lazymatch goal with
    | |- envs_entails _ (∀ x : _, _) => let x' := fresh x in iIntro (x')
    end
  end.
Local Tactic Notation "iIntro" :=
  lazymatch goal with
  | |- _ → ?P => intro
  | |- _ =>
    iStartProof;
    lazymatch goal with
    | |- envs_entails _ (_ -∗ _) => iIntro (?) || let H := iFresh in iIntro #H || iIntro H
    | |- envs_entails _ (_ → _) => iIntro (?) || let H := iFresh in iIntro #H || iIntro H
    end
  end.

Tactic Notation "iRevertHyp" constr(H) "with" tactic1(tac) :=
  eapply tac_revert with H;
    [lazymatch goal with
     | |- match envs_lookup_delete true ?i ?Δ with _ => _ end =>
        lazymatch eval pm_eval in (envs_lookup_delete true i Δ) with
        | Some (?p,_,_) => pm_reduce; tac p
        | None =>
           let H := pretty_ident H in
           fail "iRevert:" H "not found"
        end
     end].

Record iTrm {X As S} :=
  ITrm { itrm : X ; itrm_vars : hlist As ; itrm_hyps : S }.
Global Arguments ITrm {_ _ _} _ _ _.

Notation "( H $! x1 .. xn )" :=
  (ITrm H (hcons x1 .. (hcons xn hnil) ..) "") (at level 0, x1, xn at level 9).
Notation "( H 'with' pat )" := (ITrm H hnil pat) (at level 0).

Tactic Notation "iPoseProofCoreHyp" constr(H) "as" constr(Hnew) :=
  let Δ := iGetCtx in
  notypeclasses refine (tac_pose_proof_hyp _ H Hnew _ _);
    pm_reduce;
    lazymatch goal with
    | |- False =>
      let lookup := pm_eval (envs_lookup_delete false H Δ) in
      lazymatch lookup with
      | None =>
        let H := pretty_ident H in
        fail "iPoseProof:" H "not found"
      | _ =>
        let Hnew := pretty_ident Hnew in
        fail "iPoseProof:" Hnew "not fresh"
      end
    | _ => idtac
    end.

Ltac iIntoEmpValid_go :=
  lazymatch goal with
  | |- IntoEmpValid (?φ → ?ψ) _ =>

    notypeclasses refine (into_emp_valid_impl _ _ _ _ _);
      [ |iIntoEmpValid_go]
  | |- IntoEmpValid (∀ _, _) _ =>

    notypeclasses refine (into_emp_valid_forall _ _ _ _); iIntoEmpValid_go
  | |- IntoEmpValid (∀.. _, _) _ =>

    notypeclasses refine (into_emp_valid_tforall _ _ _ _); iIntoEmpValid_go
  | |- _ =>
    first
      [
       notypeclasses refine (into_emp_valid_impl _ _ _ _ _);
         [ |iIntoEmpValid_go]
      |
       notypeclasses refine (into_emp_valid_forall _ _ _ _); iIntoEmpValid_go
      |
       notypeclasses refine (into_emp_valid_tforall _ _ _ _); iIntoEmpValid_go
      |
       notypeclasses refine (into_emp_valid_here _ _ _) ]
  end.

Ltac iIntoEmpValid :=

  iIntoEmpValid_go;
    [..
    |tc_solve ||
     let φ := lazymatch goal with |- AsEmpValid ?φ _ => φ end in
     fail "iPoseProof:" φ "not a BI assertion"].

Tactic Notation "iPoseProofCoreLem" open_constr(lem) "as" tactic3(tac) :=
  let Hnew := iFresh in
  notypeclasses refine (tac_pose_proof _ Hnew _ _ (into_emp_valid_proj _ _ _ lem) _);
    [iIntoEmpValid
    |pm_reduce;
     lazymatch goal with
     | |- False =>
       let Hnew := pretty_ident Hnew in
       fail "iPoseProof:" Hnew "not fresh"
     | _ => tac Hnew
     end];

  try tc_solve.

Local Ltac iSpecializeArgs_go H xs :=
  lazymatch xs with
  | hnil => idtac
  | hcons ?x ?xs =>
     notypeclasses refine (tac_forall_specialize _ H _ _ _ _ _ _ _);
       [pm_reflexivity ||
        let H := pretty_ident H in
        fail "iSpecialize:" H "not found"
       |tc_solve ||
        let P := match goal with |- IntoForall ?P _ => P end in
        fail "iSpecialize: cannot instantiate" P "with" x
       |lazymatch goal with
        | |- ∃ _ : ?A, _ =>
          notypeclasses refine (@ex_intro A _ x _)
        end; [shelve..|pm_reduce; iSpecializeArgs_go H xs]]
  end.
Local Tactic Notation "iSpecializeArgs" constr(H) open_constr(xs) :=
  iSpecializeArgs_go H xs.

Ltac iSpecializePat_go H1 pats :=
  let solve_to_wand H1 :=
    tc_solve ||
    let P := match goal with |- IntoWand _ _ ?P _ _ => P end in
    fail "iSpecialize:" P "not an implication/wand" in
  let solve_done d :=
    lazymatch d with
    | true =>
       first [ done
             | let Q := match goal with |- envs_entails _ ?Q => Q end in
               fail 1 "iSpecialize: cannot solve" Q "using done"
             | let Q := match goal with |- ?Q => Q end in
               fail 1 "iSpecialize: cannot solve" Q "using done" ]
    | false => idtac
    end in
  let Δ := iGetCtx in
  lazymatch pats with
    | [] => idtac
    | SForall :: ?pats =>
       idtac "[IPM] The * specialization pattern is deprecated because it is applied implicitly.";
       iSpecializePat_go H1 pats
    | SIdent ?H2 [] :: ?pats =>

       notypeclasses refine (tac_specialize false _ H2 _ H1 _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H2 := pretty_ident H2 in
          fail "iSpecialize:" H2 "not found"
         |pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |tc_solve ||
          let P := match goal with |- IntoWand _ _ ?P ?Q _ => P end in
          let Q := match goal with |- IntoWand _ _ ?P ?Q _ => Q end in
          fail "iSpecialize: cannot instantiate" P "with" Q
         |pm_reduce; iSpecializePat_go H1 pats]
    | SIdent ?H2 ?pats1 :: ?pats =>

       let H2tmp := iFresh in
       iPoseProofCoreHyp H2 as H2tmp;

       iRevertHyp H1 with (fun p =>
         iSpecializePat_go H2tmp pats1;
           [..
           |iIntro H1 as p]);

         [..
         |
          notypeclasses refine (tac_specialize true _ H2tmp _ H1 _ _ _ _ _ _ _ _ _);
            [pm_reflexivity ||
             let H2tmp := pretty_ident H2tmp in
             fail "iSpecialize:" H2tmp "not found"
            |pm_reflexivity ||
             let H1 := pretty_ident H1 in
             fail "iSpecialize:" H1 "not found"
            |tc_solve ||
             let P := match goal with |- IntoWand _ _ ?P ?Q _ => P end in
             let Q := match goal with |- IntoWand _ _ ?P ?Q _ => Q end in
             fail "iSpecialize: cannot instantiate" P "with" Q
            |pm_reduce; iSpecializePat_go H1 pats]]
    | SPureGoal ?d :: ?pats =>
       notypeclasses refine (tac_specialize_assert_pure _ H1 _ _ _ _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |solve_to_wand H1
         |tc_solve ||
          let Q := match goal with |- FromPure _ ?Q _ => Q end in
          fail "iSpecialize:" Q "not pure"
         |solve_done d
         |pm_reduce;
          iSpecializePat_go H1 pats]
    | SGoal (SpecGoal GIntuitionistic false ?Hs_frame [] ?d) :: ?pats =>
       notypeclasses refine (tac_specialize_assert_intuitionistic _ H1 _ _ _ _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |solve_to_wand H1
         |tc_solve ||
          let Q := match goal with |- Persistent ?Q => Q end in
          fail "iSpecialize:" Q "not persistent"
         |tc_solve
         |pm_reduce; iFrame Hs_frame; solve_done d
         |pm_reduce; iSpecializePat_go H1 pats]
    | SGoal (SpecGoal GIntuitionistic _ _ _ _) :: ?pats =>
       fail "iSpecialize: cannot select hypotheses for intuitionistic premise"
    | SGoal (SpecGoal ?m ?lr ?Hs_frame ?Hs ?d) :: ?pats =>
       let Hs' := eval cbv in (if lr then Hs else Hs_frame ++ Hs) in
       notypeclasses refine (tac_specialize_assert _ H1 _
           (if m is GModal then true else false) lr Hs' _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |solve_to_wand H1
         |tc_solve || fail "iSpecialize: goal not a modality"
         |pm_reduce;
          lazymatch goal with
          | |- False =>
            let Hs' := iMissingHypsCore Δ Hs' in
            fail "iSpecialize: hypotheses" Hs' "not found"
          | _ =>
            notypeclasses refine (conj _ _);
              [iFrame Hs_frame; solve_done d
              |iSpecializePat_go H1 pats]
          end]
    | SAutoFrame GIntuitionistic :: ?pats =>
       notypeclasses refine (tac_specialize_assert_intuitionistic _ H1 _ _ _ _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |solve_to_wand H1
         |tc_solve ||
          let Q := match goal with |- Persistent ?Q => Q end in
          fail "iSpecialize:" Q "not persistent"
         |tc_solve ||
          fail "iSpecialize: Cannot find IntoAbsorbingly;"
               "this should not happen, please report a bug"
         |pm_reduce; solve [iFrame "∗ #"]
         |pm_reduce; iSpecializePat_go H1 pats]
    | SAutoFrame ?m :: ?pats =>
       notypeclasses refine (tac_specialize_frame _ H1 _
           (if m is GModal then true else false) _ _ _ _ _ _ _ _ _ _ _);
         [pm_reflexivity ||
          let H1 := pretty_ident H1 in
          fail "iSpecialize:" H1 "not found"
         |solve_to_wand H1
         |tc_solve || fail "iSpecialize: goal not a modality"
         |pm_reduce;
          first
            [notypeclasses refine (tac_unlock_emp _ _ _)
            |notypeclasses refine (tac_unlock_True _ _ _)
            |iFrame "∗ #"; notypeclasses refine (tac_unlock _ _ _)
            |let P :=
               match goal with |- envs_entails _ (?P ∗ locked _)%I => P end in
             fail 1 "iSpecialize: premise" P "cannot be solved by framing"]
         |exact eq_refl]; iIntro H1; iSpecializePat_go H1 pats
    end.

Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
  let pats := spec_pat.parse pat in iSpecializePat_go H pats.

Fixpoint use_tac_specialize_intuitionistic_helper {M}
    (Δ : envs M) (pats : list spec_pat) : bool :=
  match pats with
  | [] => false
  | (SForall | SPureGoal _) :: pats =>
     use_tac_specialize_intuitionistic_helper Δ pats
  | SAutoFrame _ :: _ => true
  | SIdent H _ :: pats =>
     match envs_lookup_delete false H Δ with
     | Some (false, _, Δ) => true
     | Some (true, _, Δ) => use_tac_specialize_intuitionistic_helper Δ pats
     | None => false
     end
  | SGoal (SpecGoal GModal _ _ _ _) :: _ => false
  | SGoal (SpecGoal GIntuitionistic _ _ _ _) :: pats =>
     use_tac_specialize_intuitionistic_helper Δ pats
  | SGoal (SpecGoal GSpatial neg Hs_frame Hs _) :: pats =>
     match envs_split (if neg is true then Right else Left)
                      (if neg then Hs else pm_app Hs_frame Hs) Δ with
     | Some (Δ1,Δ2) => if env_spatial_is_nil Δ1
                       then use_tac_specialize_intuitionistic_helper Δ2 pats
                       else true
     | None => false
     end
  end.

Tactic Notation "iSpecializeCore" open_constr(H)
    "with" open_constr(xs) open_constr(pat) "as" constr(p) :=
  let p := intro_pat_intuitionistic p in
  let pat := spec_pat.parse pat in
  let H :=
    lazymatch type of H with
    | string => constr:(INamed H)
    | _ => H
    end in
  iSpecializeArgs H xs; [..|
    lazymatch type of H with
    | ident =>
       let pat := spec_pat.parse pat in
       let Δ := iGetCtx in

       let b := eval cbv [use_tac_specialize_intuitionistic_helper] in
         (if p then use_tac_specialize_intuitionistic_helper Δ pat else false) in
       lazymatch eval pm_eval in b with
       | true =>

          lazymatch iTypeOf H with
          | Some (?q, _) =>
             let PROP := iBiOfGoal in
             lazymatch eval compute in (q || tc_to_bool (BiAffine PROP)) with
             | true =>
                notypeclasses refine (tac_specialize_intuitionistic_helper _ H _ _ _ _ _ _ _ _ _ _);
                  [pm_reflexivity

                  |pm_reduce; tc_solve

                  |iSpecializePat H pat;
                    [..
                    |notypeclasses refine (tac_specialize_intuitionistic_helper_done _ H _ _ _);
                     pm_reflexivity]
                  |tc_solve ||
                   let Q := match goal with |- IntoPersistent _ ?Q _ => Q end in
                   fail "iSpecialize:" Q "not persistent"
                  |pm_reduce  ]
             | false => iSpecializePat H pat
             end
          | None =>
             let H := pretty_ident H in
             fail "iSpecialize:" H "not found"
          end
       | false => iSpecializePat H pat
       end
    | _ => fail "iSpecialize:" H "should be a hypothesis, use iPoseProof instead"
    end].

Tactic Notation "iSpecializeCore" open_constr(t) "as" constr(p) :=
  lazymatch type of t with
  | string => iSpecializeCore t with hnil "" as p
  | ident => iSpecializeCore t with hnil "" as p
  | _ =>
    lazymatch t with
    | ITrm ?H ?xs ?pat => iSpecializeCore H with xs pat as p
    | _ => fail "iSpecialize:" t "should be a proof mode term"
    end
  end.

Tactic Notation "iSpecialize" open_constr(t) :=
  iSpecializeCore t as false.

Tactic Notation "iPoseProofCore" open_constr(lem)
    "as" constr(p) tactic3(tac) :=
  iStartProof;
  let t := lazymatch lem with ITrm ?t ?xs ?pat => t | _ => lem end in
  let t := lazymatch type of t with string => constr:(INamed t) | _ => t end in
  let spec_tac Htmp :=
    lazymatch lem with
    | ITrm _ ?xs ?pat => iSpecializeCore (ITrm Htmp xs pat) as p
    | _ => idtac
    end in
  lazymatch type of t with
  | ident =>
     let Htmp := iFresh in
     iPoseProofCoreHyp t as Htmp; spec_tac Htmp; [..|tac Htmp]
  | _ => iPoseProofCoreLem t as (fun Htmp => spec_tac Htmp; [..|tac Htmp])
  end.

Tactic Notation "iOrDestruct" constr(H) "as" constr(H1) constr(H2) :=
  eapply tac_or_destruct with H _ H1 H2 _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iOrDestruct:" H "not found"
    |tc_solve ||
     let P := match goal with |- IntoOr ?P _ _ => P end in
     fail "iOrDestruct: cannot destruct" P
    | pm_reduce;
      lazymatch goal with
      | |- False =>
        let H1 := pretty_ident H1 in
        let H2 := pretty_ident H2 in
        fail "iOrDestruct:" H1 "or" H2 "not fresh"
      |  _ => split
      end].

Local Tactic Notation "iAndDestruct" constr(H) "as" constr(H1) constr(H2) :=
  eapply tac_and_destruct with H _ H1 H2 _ _ _;
    [pm_reflexivity ||
     let H := pretty_ident H in
     fail "iAndDestruct:" H "not found"
    |pm_reduce; tc_solve ||
     let P :=
       lazymatch goal with
       | |- IntoSep ?P _ _ => P
       | |- IntoAnd _ ?P _ _ => P
       end in
     fail "iAndDestruct: cannot destruct" P
    |pm_reduce;
     lazymatch goal with
       | |- False =>
         let H1 := pretty_ident H1 in
         let H2 := pretty_ident H2 in
         fail "iAndDestruct:" H1 "or" H2 "not fresh"
       | _ => idtac
     end].

Local Tactic Notation "iAndDestructChoice" constr(H) "as" constr(d) constr(H') :=
  eapply tac_and_destruct_choice with H _ d H' _ _ _;
    [pm_reflexivity || fail "iAndDestructChoice:" H "not found"
    |pm_reduce; tc_solve ||
     let P := match goal with 
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 3.8MiB file on GitHub Actions Artifacts under build.log)
ild_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/builds/coq/coq/_build_ci/perennial'
make[1]: Leaving directory '/builds/coq/coq/_build_ci/perennial'
Aggregating timing log...
No timing data
/github/workspace/builds/coq /github/workspace
::endgroup::
::group::make ci-perennial (failing)
/builds/coq/coq /github/workspace/builds/coq /github/workspace
./dev/ci/ci-wrapper.sh perennial
++ : 2
++ export NJOBS
++ which cygpath
++ OCAMLFINDSEP=:
++ export OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ '[' -n 1 ']'
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ export CI_BRANCH=
++ CI_BRANCH=
++ [[ '' =~ ^[0-9]*$ ]]
++ export CI_PULL_REQUEST=
++ CI_PULL_REQUEST=
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ ls -l /github/workspace/builds/coq/coq-failing/_install_ci/bin/
total 664728
-rwxr-xr-x 1 root root     2125 May  3 20:50 coq-tex
-rwxr-xr-x 1 root root  2754376 May  3 12:41 coq-tex.orig
-rwxr-xr-x 1 root root  8917640 May  3 12:41 coq_makefile
-rwxr-xr-x 1 root root     2122 May  3 20:50 coqc
-rwxr-xr-x 1 root root     2127 May  3 20:50 coqc.byte
-rwxr-xr-x 1 root root 41273893 May  3 12:41 coqc.byte.orig
-rwxr-xr-x 1 root root 67183512 May  3 12:41 coqc.orig
-rwxr-xr-x 1 root root 22613416 May  3 12:41 coqchk
-rwxr-xr-x 1 root root  9473312 May  3 12:41 coqdep
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqdoc
-rwxr-xr-x 1 root root  9392344 May  3 12:41 coqdoc.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqide
-rwxr-xr-x 1 root root 21602928 May  3 12:42 coqide.orig
-rwxr-xr-x 1 root root     2132 May  3 20:50 coqidetop.byte
-rwxr-xr-x 1 root root 41836419 May  3 12:42 coqidetop.byte.orig
-rwxr-xr-x 1 root root     2131 May  3 20:50 coqidetop.opt
-rwxr-xr-x 1 root root 67900456 May  3 12:42 coqidetop.opt.orig
-rwxr-xr-x 1 root root     2127 May  3 20:50 coqnative
-rwxr-xr-x 1 root root 22718304 May  3 12:41 coqnative.orig
-rwxr-xr-x 1 root root     2123 May  3 20:50 coqpp
-rwxr-xr-x 1 root root  3430448 May  3 12:41 coqpp.orig
-rwxr-xr-x 1 root root     2133 May  3 20:50 coqtimelog2html
-rwxr-xr-x 1 root root  4633952 May  3 12:41 coqtimelog2html.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 coqtop
-rwxr-xr-x 1 root root     2129 May  3 20:50 coqtop.byte
-rwxr-xr-x 1 root root 59580852 May  3 12:41 coqtop.byte.orig
-rwxr-xr-x 1 root root     2128 May  3 20:50 coqtop.opt
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.opt.orig
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.orig
-rwxr-xr-x 1 root root     2123 May  3 20:50 coqwc
-rwxr-xr-x 1 root root  2357648 May  3 12:41 coqwc.orig
-rwxr-xr-x 1 root root     2131 May  3 20:50 coqworker.opt
-rwxr-xr-x 1 root root 67260312 May  3 12:41 coqworker.opt.orig
-rwxr-xr-x 1 root root     2128 May  3 20:50 coqworkmgr
-rwxr-xr-x 1 root root  3603640 May  3 12:41 coqworkmgr.orig
-rwxr-xr-x 1 root root     2126 May  3 20:50 csdpcert
-rwxr-xr-x 1 root root 81440368 May  3 12:41 csdpcert.orig
-rwxr-xr-x 1 root root     2129 May  3 20:50 ocamllibdep
-rwxr-xr-x 1 root root  3680048 May  3 12:41 ocamllibdep.orig
-rwxr-xr-x 1 root root     2124 May  3 20:50 votour
-rwxr-xr-x 1 root root  4405272 May  3 12:41 votour.orig
++ CI_BUILD_DIR=/github/workspace/builds/coq/coq-failing/_build_ci
++ CI_INSTALL_DIR=/github/workspace/builds/coq/coq-failing/_install_ci
++ ls -l /github/workspace/builds/coq/coq-failing/_build_ci
total 4
drwxr-xr-x 7 root root 4096 May  3 13:43 perennial
++ declare -A overlays
++ set +x
+ WITH_SUBMODULES=1
+ git_download perennial
+ local project=perennial
+ local dest=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ local giturl_var=perennial_CI_GITURL
+ local giturl=https://github.com/mit-pdos/perennial
+ local ref_var=perennial_CI_REF
+ local ref=coq/tested
+ local ov_url=
+ local ov_ref=
+ '[' -d /github/workspace/builds/coq/coq-failing/_build_ci/perennial ']'
+ echo 'Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.'
Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.
+ '[' '' ']'
+ ulimit -s
16384
+ ulimit -s 65536
+ ulimit -s
65536
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
COQC src/base_logic/lib/wsat.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src Perennial -w -ssr-search-moved -w +deprecated-hint-without-locality -w +deprecated-instance-without-locality -w -future-coercion-class-field -w +deprecated-hint-rewrite-without-locality -w -deprecated-field-instance-without-locality -w +deprecated-tactic-notation -w -notation-overridden\,-redundant-canonical-projection\,-deprecated-typeclasses-transparency-without-locality -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp stdpp -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable stdpp.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris iris -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated iris.deprecated -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable iris.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang iris.heap_lang -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil coqutil -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose Goose -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src RecordUpdate -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src Tactical -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src iris_named_props -o /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.vo src/base_logic/lib/wsat.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.p9Mfi2VG3u
MINIMIZER_DEBUG: files:  src/base_logic/lib/wsat.v
File "./src/base_logic/lib/wsat.v", line 627, characters 2-3:
Error: This proof is focused, but cannot be unfocused this way

Makefile:53: recipe for target 'src/base_logic/lib/wsat.vo' failed
make[1]: *** [src/base_logic/lib/wsat.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
Makefile.ci:150: recipe for target 'ci-perennial' failed
make: *** [ci-perennial] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 588KiB file on GitHub Actions Artifacts under bug.log)
l/iris/iris_unstable iris.unstable -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_heap_lang iris.heap_lang -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/coqutil/src/coqutil coqutil -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/Goose Goose -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/record-update/src RecordUpdate -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/coq-tactical/src Tactical -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris-named-props/src iris_named_props -Q /github/workspace/builds/coq/coq-passing/_install_ci/lib/coq/user-contrib/Ltac2 Ltac2 -arg -w -arg -ssr-search-moved -arg -w -arg +deprecated-hint-without-locality -arg -w -arg +deprecated-instance-without-locality -arg -w -arg -future-coercion-class-field -arg -w -arg +deprecated-hint-rewrite-without-locality -arg -w -arg -deprecated-field-instance-without-locality -arg -w -arg +deprecated-tactic-notation -arg -w -arg -notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality -arg -w -arg -deprecated-native-compiler-option,-native-compiler-disabled -arg -native-compiler -arg ondemand bug_01.v
getting Makefile1r8aaxol.coq (/github/workspace/cwd/Makefile1r8aaxol.coq)
make -k -f Makefile1r8aaxol.coq KEEP_ERROR=1 bug_01.glob
�[92m
Succeeded in normalizing Requires.�[0m

Now, I will attempt to split up [Require] statements...
getting /github/workspace/cwd/bug_01.v
getting /github/workspace/cwd/bug_01.glob
getting /github/workspace/cwd/bug_01.glob

No Requires to split.

In order to efficiently manipulate the file, I have to break it into statements.  I will attempt to do this by matching on periods.
�[92m
Splitting successful.�[0m

I will now attempt to remove any lines after the line which generates the error.

No lines to trim.

In order to efficiently manipulate the file, I have to break it into definitions.  I will now attempt to do this.
Sending statements to coqtop...
Done.  Splitting to definitions...
�[92m
Splitting to definitions 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

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpz4v39phj/Perennial/base_logic/lib/wsat.v", line 637, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmpmczj4117/Perennial/base_logic/lib/wsat.v", line 637, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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 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
Success!

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/tmppvv18m_z/Perennial/base_logic/lib/wsat.v", line 635, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmpwmkuj86n/Perennial/base_logic/lib/wsat.v", line 635, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmppvv18m_z/Perennial/base_logic/lib/wsat.v", line 635, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmpwmkuj86n/Perennial/base_logic/lib/wsat.v", line 635, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:

�[93mIntermediate code not saved.�[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/tmpypfex12_/Perennial/base_logic/lib/wsat.v", line 1365, characters 0-9:
Error: Could not declare a canonical structure mlistC.
Could not find its value in the global environment.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:

�[93mIntermediate code not saved.�[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/tmp__98d16j/Perennial/base_logic/lib/wsat.v", line 1366, characters 0-8:
Error: Could not declare a canonical structure mlistC.
Expected a record or structure constructor applied to arguments.


�[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 successful

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

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

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

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories/PCUICProgress.v (from ci-metacoq) (interrupted by timeout, being automatically continued) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 42KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/utils/theories" "MetaCoq.Utils" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/common/theories" "MetaCoq.Common" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories" "MetaCoq.PCUIC" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Equations" "Equations" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "MetaCoq.PCUIC.PCUICProgress") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 790 lines to 51 lines, then from 64 lines to 859 lines, then from 864 lines to 91 lines, then from 104 lines to 1730 lines, then from 1735 lines to 363 lines, then from 376 lines to 2672 lines, then from 2674 lines to 453 lines, then from 466 lines to 1362 lines, then from 1366 lines to 615 lines, then from 628 lines to 1040 lines, then from 1045 lines to 617 lines, then from 630 lines to 2427 lines, then from 2426 lines to 628 lines, then from 641 lines to 2534 lines, then from 2538 lines to 1165 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.09.0
   coqtop version runner-5nczbzj5-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874a4b) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 5.688 sec *)
Require Coq.Arith.Arith.
Require Coq.Arith.Compare_dec.
Require Coq.Arith.Wf_nat.
Require Coq.Bool.Bool.
Require Coq.Bool.Bvector.
Require Coq.Classes.CMorphisms.
Require Coq.Classes.CRelationClasses.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Classes.SetoidTactics.
Require Coq.FSets.FMapAVL.
Require Coq.FSets.FMapFacts.
Require Coq.FSets.FMapFullAVL.
Require Coq.FSets.FMapInterface.
Require Coq.FSets.FMapList.
Require Coq.Floats.FloatAxioms.
Require Coq.Floats.FloatOps.
Require Coq.Floats.PrimFloat.
Require Coq.Floats.SpecFloat.
Require Coq.Init.Decimal.
Require Coq.Init.Ltac.
Require Coq.Init.Nat.
Require Coq.Lists.List.
Require Coq.Lists.SetoidList.
Require Coq.Logic.FunctionalExtensionality.
Require Coq.MSets.MSetAVL.
Require Coq.MSets.MSetDecide.
Require Coq.MSets.MSetFacts.
Require Coq.MSets.MSetInterface.
Require Coq.MSets.MSetList.
Require Coq.MSets.MSetProperties.
Require Coq.NArith.BinNat.
Require Coq.NArith.NArith.
Require Coq.Numbers.Cyclic.Int63.Uint63.
Require Coq.Numbers.DecimalString.
Require Coq.Numbers.HexadecimalString.
Require Coq.PArith.BinPos.
Require Coq.Program.Program.
Require Coq.Program.Tactics.
Require Coq.Program.Wf.
Require Coq.Relations.Relation_Definitions.
Require Coq.Relations.Relation_Operators.
Require Coq.Relations.Relations.
Require Coq.Setoids.Setoid.
Require Coq.Strings.Ascii.
Require Coq.Strings.Byte.
Require Coq.Strings.String.
Require Coq.Structures.Equalities.
Require Coq.Structures.OrderedType.
Require Coq.Structures.OrderedTypeAlt.
Require Coq.Structures.OrderedTypeEx.
Require Coq.Structures.Orders.
Require Coq.Structures.OrdersAlt.
Require Coq.Unicode.Utf8.
Require Coq.Unicode.Utf8_core.
Require Coq.Wellfounded.Lexicographic_Product.
Require Coq.Wellfounded.Wellfounded.
Require Coq.ZArith.ZArith.
Require Coq.ZArith.Zcompare.
Require Coq.btauto.Btauto.
Require Coq.extraction.Extraction.
Require Coq.micromega.Lia.
Require Coq.ssr.ssrbool.
Require Coq.ssr.ssreflect.
Require Coq.ssr.ssrfun.
Require Equations.Init.
Require Equations.Signature.
Require Equations.CoreTactics.
Require Equations.Prop.Logic.
Require Equations.Prop.Classes.
Require Equations.Prop.EqDec.
Require Equations.Prop.DepElim.
Require Equations.Prop.Constants.
Require Equations.Prop.Subterm.
Require Equations.Prop.FunctionalInduction.
Require Equations.Prop.Tactics.
Require Equations.Prop.NoConfusion.
Require Equations.Prop.EqDecInstances.
Require Equations.Prop.Loader.
Require Equations.Prop.Telescopes.
Require Equations.Prop.Equations.
Require Equations.Type.Logic.
Require Equations.Type.Relation.
Require Equations.Type.Relation_Properties.
Require Ltac2.Init.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Ltac1.
Require MetaCoq.Utils.MCPrelude.
Require MetaCoq.Utils.MCReflect.
Require MetaCoq.Utils.MCRelations.
Require MetaCoq.Utils.ReflectEq.
Require MetaCoq.Utils.MCList.
Require MetaCoq.Utils.MCProd.
Require MetaCoq.Utils.MCOption.
Require MetaCoq.Utils.MCSquash.
Require MetaCoq.Utils.All_Forall.
Require MetaCoq.Utils.MCArith.
Require MetaCoq.Utils.MCCompare.
Require MetaCoq.Utils.MCEquality.
Require MetaCoq.Utils.ByteCompare.
Require MetaCoq.Utils.ByteCompareSpec.
Require MetaCoq.Utils.bytestring.
Require MetaCoq.Utils.MCString.
Require MetaCoq.Utils.MCTactics.SpecializeBy.
Require MetaCoq.Utils.MCTactics.Zeta1.
Require MetaCoq.Utils.MCTactics.GeneralizeOverHoles.
Require MetaCoq.Utils.MCTactics.FindHyp.
Require MetaCoq.Utils.MCTactics.UniquePose.
Require MetaCoq.Utils.MCTactics.InHypUnderBindersDo.
Require MetaCoq.Utils.MCTactics.SpecializeUnderBindersBy.
Require MetaCoq.Utils.MCTactics.Head.
Require MetaCoq.Utils.MCTactics.DestructHyps.
Require MetaCoq.Utils.MCTactics.DestructHead.
Require MetaCoq.Utils.MCTactics.SpecializeAllWays.
Require MetaCoq.Utils.MCTactics.SplitInContext.
Require MetaCoq.Utils.MCUtils.
Require MetaCoq.Utils.monad_utils.
Require MetaCoq.Utils.utils.
Require MetaCoq.Utils.MCMSets.
Require MetaCoq.Utils.MCFSets.
Require MetaCoq.Common.Kernames.
Require MetaCoq.Common.BasicAst.
Require MetaCoq.Common.Primitive.
Require MetaCoq.Common.config.
Require MetaCoq.Common.Universes.
Require MetaCoq.Common.Environment.
Require MetaCoq.Common.EnvironmentTyping.
Require MetaCoq.Common.Reflect.
Require MetaCoq.Utils.wGraph.
Require MetaCoq.Common.uGraph.
Require MetaCoq.PCUIC.utils.PCUICPrimitive.
Require MetaCoq.PCUIC.PCUICAst.
Require MetaCoq.PCUIC.utils.PCUICSize.
Require MetaCoq.PCUIC.utils.PCUICAstUtils.
Require MetaCoq.PCUIC.Syntax.PCUICCases.
Require MetaCoq.Utils.LibHypsNaming.
Require MetaCoq.PCUIC.Syntax.PCUICInduction.
Require MetaCoq.PCUIC.Syntax.PCUICLiftSubst.
Require MetaCoq.PCUIC.Syntax.PCUICReflect.

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.

Module Export MetaCoq_DOT_PCUIC_DOT_PCUICEquality_WRAPPED.
Module Export PCUICEquality.
 
Import Coq.Classes.CMorphisms.
Import MetaCoq.Utils.LibHypsNaming.
Import MetaCoq.Utils.utils.
Import MetaCoq.Common.config.
Import MetaCoq.Common.Reflect.
Import MetaCoq.PCUIC.PCUICAst.
Import MetaCoq.PCUIC.utils.PCUICAstUtils.
Import MetaCoq.PCUIC.Syntax.PCUICInduction.
Import MetaCoq.PCUIC.Syntax.PCUICLiftSubst.
Import MetaCoq.PCUIC.Syntax.PCUICReflect.
Import Coq.ssr.ssreflect.
Import Coq.ssr.ssrbool.
Import Equations.Prop.DepElim.
Import Equations.Prop.Equations.
Set Equations With UIP.

Ltac pcuic :=
  try repeat red; cbn in *;
   try (solve [ intuition auto; eauto with pcuic || (try lia || congruence) ]).
#[global]
Instance All2_fold_len {A} P (Γ Δ : list A) : HasLen (All2_fold P Γ Δ) #|Γ| #|Δ|. exact (All2_fold_length). Defined.

Implicit Types (cf : checker_flags).

Definition R_universe_instance R :=
  fun u u' => Forall2 R (List.map Universe.make u) (List.map Universe.make u').

Definition R_universe_instance_dep R R' :=
  fun {u u'} (H : R_universe_instance R u u') => Forall2_dep R' H.

 

Definition R_universe_variance (Re Rle : Universe.t -> Universe.t -> Prop) v u u' :=
  match v with
  | Variance.Irrelevant => True
  | Variance.Covariant => Rle (Universe.make u) (Universe.make u')
  | Variance.Invariant => Re (Universe.make u) (Universe.make u')
  end.

Fixpoint R_universe_instance_variance Re Rle v u u' :=
  match u, u' return Prop with
  | u :: us, u' :: us' =>
    match v with
    | [] => R_universe_instance_variance Re Rle v us us'
       
    | v :: vs => R_universe_variance Re Rle v u u' /\
        R_universe_instance_variance Re Rle vs us us'
    end
  | [], [] => True
  | _, _ => False
  end.

Definition global_variance_gen lookup gr napp :=
  match gr with
  | IndRef ind =>
    match lookup_inductive_gen lookup ind with
    | Some (mdecl, idecl) =>
      match destArity [] idecl.(ind_type) with
      | Some (ctx, _) => if (context_assumptions ctx) <=? napp then mdecl.(ind_variance)
        else None
      | None => None
      end
    | None => None
    end
  | ConstructRef ind k =>
    match lookup_constructor_gen lookup ind k with
    | Some (mdecl, idecl, cdecl) =>
      if (cdecl.(cstr_arity) + mdecl.(ind_npars))%nat <=? napp then
         
        Some []
      else None
    | _ => None
    end
  | _ => None
  end.

Notation global_variance Σ := (global_variance_gen (lookup_env Σ)).

Definition R_opt_variance Re Rle v :=
  match v with
  | Some v => R_universe_instance_variance Re Rle v
  | None => R_universe_instance Re
  end.

Definition R_global_instance_gen Σ Re Rle gr napp :=
  R_opt_variance Re Rle (global_variance_gen Σ gr napp).

Notation R_global_instance Σ := (R_global_instance_gen (lookup_env Σ)).

Definition R_ind_universes {cf:checker_flags} (Σ : global_env_ext) ind n i i' :=
  R_global_instance Σ (eq_universe (global_ext_constraints Σ))
    (leq_universe (global_ext_constraints Σ)) (IndRef ind) n i i'.

Lemma R_universe_instance_impl R R' :
  RelationClasses.subrelation R R' ->
  RelationClasses.subrelation (R_universe_instance R) (R_universe_instance R').
Admitted.

Lemma R_universe_instance_impl' R R' :
  RelationClasses.subrelation R R' ->
  forall u u', R_universe_instance R u u' -> R_universe_instance R' u u'.
Admitted.

Section compare_decls.
   
  Context {eq_term leq_term : term -> term -> Type}.
  Inductive compare_decls  : context_decl -> context_decl -> Type :=
  | compare_vass {na T na' T'} :
    eq_binder_annot na na' ->
    leq_term T T' ->
    compare_decls (vass na T) (vass na' T')
  | compare_vdef {na b T na' b' T'} :
    eq_binder_annot na na' ->
    eq_term b b' ->
    leq_term T T' ->
    compare_decls (vdef na b T) (vdef na' b' T').

  Derive Signature NoConfusion for compare_decls.
End compare_decls.
Arguments compare_decls : clear implicits.

Notation eq_context_upto_names := (All2 (compare_decls eq eq)).

Notation eq_context_gen eq_term leq_term :=
  (All2_fold (fun _ _ => compare_decls eq_term leq_term)).

Lemma eq_context_upto_names_gen Γ Γ' : eq_context_upto_names Γ Γ' <~> eq_context_gen eq eq Γ Γ'.
Admitted.

Lemma compare_decls_impl eq_term leq_term eq_term' leq_term' :
  subrelation eq_term eq_term' ->
  subrelation leq_term leq_term' ->
  subrelation (compare_decls eq_term leq_term)
    (compare_decls eq_term' leq_term').
Admitted.

Lemma eq_context_gen_impl eq_term leq_term eq_term' leq_term' :
  subrelation eq_term eq_term' ->
  subrelation leq_term leq_term' ->
  subrelation (eq_context_gen eq_term leq_term) (eq_context_gen eq_term' leq_term').
Admitted.

Lemma compare_decl_impl_ondecl P eq_term leq_term eq_term' leq_term' d d' :
  ondecl P d ->
  (forall x y, P x -> eq_term x y -> eq_term' x y) ->
  (forall x y, P x -> leq_term x y -> leq_term' x y) ->
  compare_decls eq_term leq_term d d' ->
  compare_decls eq_term' leq_term' d d'.
Admitted.

Lemma compare_decl_map eq_term leq_term f g d d' :
  compare_decls (fun x y => eq_term (f x) (g y))
    (fun x y => leq_term (f x) (g y)) d d' ->
  compare_decls eq_term leq_term (map_decl f d) (map_decl g d').
Admitted.
Definition bcompare_decls (eq_term leq_term : term -> term -> bool) (d d' : context_decl) : bool. exact (match d, d' with
  | {| decl_name := na; decl_body := None; decl_type := T |},
    {| decl_name := na'; decl_body := None; decl_type := T' |} =>
    eqb_binder_annot na na' && leq_term T T'
  | {| decl_name := na; decl_body := Some b; decl_type := T |},
    {| decl_name := na'; decl_body := Some b'; decl_type := T' |} =>
    eqb_binder_annot na na' && eq_term b b' && leq_term T T'
  | _, _ => false
  end). Defined.

#[global]
Polymorphic Instance compare_decl_refl eq_term leq_term :
  CRelationClasses.Reflexive eq_term ->
  CRelationClasses.Reflexive leq_term ->
  CRelationClasses.Reflexive (compare_decls eq_term leq_term).
Admitted.

#[global]
Polymorphic Instance compare_decl_sym eq_term leq_term :
  CRelationClasses.Symmetric eq_term ->
  CRelationClasses.Symmetric leq_term ->
  CRelationClasses.Symmetric (compare_decls eq_term leq_term).
Admitted.

#[global]
Polymorphic Instance compare_decl_trans eq_term leq_term :
  CRelationClasses.Transitive eq_term ->
  CRelationClasses.Transitive leq_term ->
  CRelationClasses.Transitive (compare_decls eq_term leq_term).
Admitted.

#[global]
Instance alpha_eq_reflexive : CRelationClasses.Reflexive eq_context_upto_names.
Admitted.

#[global]
Instance alpha_eq_symmmetric : CRelationClasses.Symmetric eq_context_upto_names.
Admitted.

#[global]
Instance alpha_eq_trans : CRelationClasses.Transitive eq_context_upto_names.
Admitted.

#[global]
Polymorphic Instance eq_context_refl eq_term leq_term :
  CRelationClasses.Reflexive eq_term ->
  CRelationClasses.Reflexive leq_term ->
  CRelationClasses.Reflexive (eq_context_gen eq_term leq_term).
Admitted.

#[global]
Polymorphic Instance eq_context_sym eq_term leq_term :
  CRelationClasses.Symmetric eq_term ->
  CRelationClasses.Symmetric leq_term ->
  CRelationClasses.Symmetric (eq_context_gen eq_term leq_term).
Admitted.

#[global]
Polymorphic Instance eq_context_trans eq_term leq_term :
  CRelationClasses.Transitive eq_term ->
  CRelationClasses.Transitive leq_term ->
  CRelationClasses.Transitive (eq_context_gen eq_term leq_term).
Admitted.

Definition eq_predicate (eq_term : term -> term -> Type) Re p p' :=
  All2 eq_term p.(pparams) p'.(pparams) *
  (R_universe_instance Re p.(puinst) p'.(puinst) *
  ((eq_context_gen eq eq p.(pcontext) p'.(pcontext)) *
    eq_term p.(preturn) p'.(preturn))).

 

 

Reserved Notation " Σ ⊢ t <==[ Rle , napp ] u" (at level 50, t, u at next level,
  format "Σ  ⊢  t  <==[ Rle , napp ]  u").

Inductive eq_term_upto_univ_napp Σ (Re Rle : Universe.t -> Universe.t -> Prop) (napp : nat) : term -> term -> Type :=
| eq_Rel : forall n,
    Σ ⊢ tRel n <==[ Rle , napp ] tRel n

| eq_Evar : forall e args args',
    All2 (eq_term_upto_univ_napp Σ Re Re 0) args args' ->
    Σ ⊢ tEvar e args <==[ Rle , napp ] tEvar e args'

| eq_Var : forall id,
    Σ ⊢ tVar id <==[ Rle , napp ] tVar id

| eq_Sort : forall s s',
    Rle s s' ->
    Σ ⊢ tSort s  <==[ Rle , napp ] tSort s'

| eq_App : forall t t' u u',
    Σ ⊢ t <==[ Rle , S napp ] t' ->
    Σ ⊢ u <==[ Re , 0 ] u' ->
    Σ ⊢ tApp t u <==[ Rle , napp ] tApp t' u'

| eq_Const : forall c u u',
    R_universe_instance Re u u' ->
    Σ ⊢ tConst c u <==[ Rle , napp ] tConst c u'

| eq_Ind : forall i u u',
    R_global_instance Σ Re Rle (IndRef i) napp u u' ->
    Σ ⊢ tInd i u <==[ Rle , napp ] tInd i u'

| eq_Construct : forall i k u u',
    R_global_instance Σ Re Rle (ConstructRef i k) napp u u' ->
    Σ ⊢ tConstruct i k u <==[ Rle , napp ] tConstruct i k u'

| eq_Lambda : forall na na' ty ty' t t',
    eq_binder_annot na na' ->
    Σ ⊢ ty <==[ Re , 0 ] ty' ->
    Σ ⊢ t <==[ Rle , 0 ] t' ->
    Σ ⊢ tLambda na ty t <==[ Rle , napp ] tLambda na' ty' t'

| eq_Prod : forall na na' a a' b b',
    eq_binder_annot na na' ->
    Σ ⊢ a <==[ Re , 0 ] a' ->
    Σ ⊢ b <==[ Rle , 0 ] b' ->
    Σ ⊢ tProd na a b <==[ Rle , napp ] tProd na' a' b'

| eq_LetIn : forall na na' t t' ty ty' u u',
    eq_binder_annot na na' ->
    Σ ⊢ t <==[ Re , 0 ] t' ->
    Σ ⊢ ty <==[ Re , 0 ] ty' ->
    Σ ⊢ u <==[ Rle , 0 ] u' ->
    Σ ⊢ tLetIn na t ty u <==[ Rle , napp ] tLetIn na' t' ty' u'

| eq_Case : forall indn p p' c c' brs brs',
    eq_predicate (eq_term_upto_univ_napp Σ Re Re 0) Re p p' ->
    Σ ⊢ c <==[ Re , 0 ] c' ->
    All2 (fun x y =>
      eq_context_gen eq eq (bcontext x) (bcontext y) *
      (Σ ⊢ x.(bbody) <==[ Re , 0 ] y.(bbody))
    ) brs brs' ->
    Σ ⊢ tCase indn p c brs <==[ Rle , napp ] tCase indn p' c' brs'

| eq_Proj : forall p c c',
    Σ ⊢ c <==[ Re , 0 ] c' ->
    Σ ⊢ tProj p c <==[ Rle , napp ] tProj p c'

| eq_Fix : forall mfix mfix' idx,
    All2 (fun x y =>
      (Σ ⊢ x.(dtype) <==[ Re , 0 ] y.(dtype)) *
      (Σ ⊢ x.(dbody) <==[ Re , 0 ] y.(dbody)) *
      (x.(rarg) = y.(rarg)) *
      eq_binder_annot x.(dname) y.(dname)
    )%type mfix mfix' ->
    Σ ⊢ tFix mfix idx <==[ Rle , napp ] tFix mfix' idx

| eq_CoFix : forall mfix mfix' idx,
    All2 (fun x y =>
      (Σ ⊢ x.(dtype) <==[ Re , 0 ] y.(dtype)) *
      (Σ ⊢ x.(dbody) <==[ Re , 0 ] y.(dbody)) *
      (x.(rarg) = y.(rarg)) *
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ⊢ tCoFix mfix idx <==[ Rle , napp ] tCoFix mfix' idx

| eq_Prim i : eq_term_upto_univ_napp Σ Re Rle napp (tPrim i) (tPrim i)
where " Σ ⊢ t <==[ Rle , napp ] u " := (eq_term_upto_univ_napp Σ _ Rle napp t u) : type_scope.

Notation eq_term_upto_univ Σ Re Rle := (eq_term_upto_univ_napp Σ Re Rle 0).

 

Definition compare_term_napp `{checker_flags} (pb : conv_pb) Σ φ napp (t u : term) :=
  eq_term_upto_univ_napp Σ (eq_universe φ) (compare_universe pb φ) napp t u.

Definition compare_term `{checker_flags} (pb : conv_pb) Σ φ (t u : term) :=
  eq_term_upto_univ Σ (eq_universe φ) (compare_universe pb φ) t u.

 

Notation eq_term := (compare_term Conv).

 

Notation leq_term := (compare_term Cumul).

Definition compare_opt_term `{checker_flags} (pb : conv_pb) Σ φ (t u : option term) :=
  match t, u with
  | Some t, Some u => compare_term pb Σ φ t u
  | None, None => True
  | _, _ => False
  end.

Definition compare_decl `{checker_flags} pb Σ φ (d d' : context_decl) :=
  compare_decls (compare_term Conv Σ φ) (compare_term pb Σ φ) d d'.

Notation eq_decl := (compare_decl Conv).
Notation leq_decl := (compare_decl Cumul).

Definition compare_context `{checker_flags} pb Σ φ (Γ Δ : context) :=
  eq_context_gen (compare_term Conv Σ φ) (compare_term pb Σ φ) Γ Δ.

Notation eq_context := (compare_context Conv).
Notation leq_context := (compare_context Cumul).

Notation eq_context_upto Σ Re Rle :=
  (eq_context_gen (eq_term_upto_univ Σ Re Re) (eq_term_upto_univ Σ Re Rle)).

Lemma R_global_instance_refl Σ Re Rle gr napp u :
  RelationClasses.Reflexive Re ->
  RelationClasses.Reflexive Rle ->
  R_global_instance Σ Re Rle gr napp u u.
Admitted.

#[global]
Instance eq_binder_annot_equiv {A} : RelationClasses.Equivalence (@eq_binder_annot A A).
Admitted.

Definition eq_binder_annot_refl {A} x : @eq_binder_annot A A x x.
Admitted.

#[global]
Hint Resolve eq_binder_annot_refl : core.

 
#[global]
Existing Instance All2_symP.

 
#[global]
Instance Forall2_symP :
  forall A (P : A -> A -> Prop),
    RelationClasses.Symmetric P ->
    Symmetric (Forall2 P).
Admitted.

Lemma eq_binder_relevances_refl (x : list aname) : All2 (on_rel eq binder_relevance) x x.
Admitted.

End PCUICEquality.
Import Coq.ssr.ssrbool.
Import MetaCoq.Utils.utils.
Import MetaCoq.PCUIC.PCUICAst.

Definition shiftnP k p i :=
  (i <? k) || p (i - k).
Fixpoint on_free_vars (p : nat -> bool) (t : term) : bool.
Admitted.

Definition on_free_vars_decl P d :=
  test_decl (on_free_vars P) d.

Definition on_free_vars_ctx P ctx :=
  alli (fun k => (on_free_vars_decl (shiftnP k P))) 0 (List.rev ctx).

Notation is_open_term Γ := (on_free_vars (shiftnP #|Γ| xpred0)).
Notation is_closed_context := (on_free_vars_ctx xpred0).
Definition set_preturn (p : predicate term) (pret' : term) : predicate term.
Admitted.
Definition set_pparams (p : predicate term) (pars' : list term) : predicate term.
Admitted.

Module Export PCUICCumulativitySpec.
Import MetaCoq.Common.config.
Import MetaCoq.PCUIC.Syntax.PCUICCases.

Implicit Types (cf : checker_flags).

Definition cumul_predicate (cumul : context -> term -> term -> Type) Γ Re p p' :=
  All2 (cumul Γ) p.(pparams) p'.(pparams) *
  (R_universe_instance Re p.(puinst) p'.(puinst) *
  ((eq_context_gen eq eq p.(pcontext) p'.(pcontext)) *
    cumul (Γ ,,, inst_case_predicate_context p) p.(preturn) p'.(preturn))).

Reserved Notation " Σ ;;; Γ ⊢ t ≤s[ pb ] u" (at level 50, Γ, t, u at next level,
  format "Σ  ;;;  Γ  ⊢  t  ≤s[ pb ]  u").

Definition cumul_Ind_univ {cf} (Σ : global_env_ext) pb i napp :=
  R_global_instance Σ (eq_universe Σ) (compare_universe pb Σ) (IndRef i) napp.

Definition cumul_Construct_univ {cf} (Σ : global_env_ext) pb  i k napp :=
  R_global_instance Σ (eq_universe Σ) (compare_universe pb Σ) (ConstructRef i k) napp.
Inductive cumulSpec0 {cf : checker_flags} (Σ : global_env_ext) Γ (pb : conv_pb) : term -> term -> Type :=

| cumul_Trans : forall t u v,
    is_closed_context Γ -> is_open_term Γ u ->
    Σ ;;; Γ ⊢ t ≤s[pb] u ->
    Σ ;;; Γ ⊢ u ≤s[pb] v ->
    Σ ;;; Γ ⊢ t ≤s[pb] v

| cumul_Sym : forall t u,
    Σ ;;; Γ ⊢ t ≤s[Conv] u ->
    Σ ;;; Γ ⊢ u ≤s[pb] t

| cumul_Refl : forall t,
    Σ ;;; Γ ⊢ t ≤s[pb] t

| cumul_Ind : forall i u u' args args',
    cumul_Ind_univ Σ pb i #|args| u u' ->
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ mkApps (tInd i u) args ≤s[pb] mkApps (tInd i u') args'

| cumul_Construct : forall i k u u' args args',
    cumul_Construct_univ Σ pb i k #|args| u u' ->
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ mkApps (tConstruct i k u) args ≤s[pb] mkApps (tConstruct i k u') args'

| cumul_Sort : forall s s',
    compare_universe pb Σ s s' ->
    Σ ;;; Γ ⊢ tSort s ≤s[pb] tSort s'

| cumul_Const : forall c u u',
    R_universe_instance (compare_universe Conv Σ) u u' ->
    Σ ;;; Γ ⊢ tConst c u ≤s[pb] tConst c u'

| cumul_Evar : forall e args args',
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ tEvar e args ≤s[pb] tEvar e args'

| cumul_App : forall t t' u u',
    Σ ;;; Γ ⊢ t ≤s[pb] t' ->
    Σ ;;; Γ ⊢ u ≤s[Conv] u' ->
    Σ ;;; Γ ⊢ tApp t u ≤s[pb] tApp t' u'

| cumul_Lambda : forall na na' ty ty' t t',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ ty ≤s[Conv] ty' ->
    Σ ;;; Γ ,, vass na ty ⊢ t ≤s[pb] t' ->
    Σ ;;; Γ ⊢ tLambda na ty t ≤s[pb] tLambda na' ty' t'

| cumul_Prod : forall na na' a a' b b',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ a ≤s[Conv] a' ->
    Σ ;;; Γ ,, vass na a ⊢ b ≤s[pb] b' ->
    Σ ;;; Γ ⊢ tProd na a b ≤s[pb] tProd na' a' b'

| cumul_LetIn : forall na na' t t' ty ty' u u',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ t ≤s[Conv] t' ->
    Σ ;;; Γ ⊢ ty ≤s[Conv] ty' ->
    Σ ;;; Γ ,, vdef na t ty ⊢ u ≤s[pb] u' ->
    Σ ;;; Γ ⊢ tLetIn na t ty u ≤s[pb] tLetIn na' t' ty' u'

| cumul_Case indn : forall p p' c c' brs brs',
    cumul_predicate (fun Γ t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) Γ (compare_universe Conv Σ) p p' ->
    Σ ;;; Γ ⊢ c ≤s[Conv] c' ->
    All2 (fun br br' =>
      eq_context_gen eq eq (bcontext br) (bcontext br') ×
      Σ ;;; Γ ,,, inst_case_branch_context p br ⊢ bbody br ≤s[Conv] bbody br'
    ) brs brs' ->
    Σ ;;; Γ ⊢ tCase indn p c brs ≤s[pb] tCase indn p' c' brs'

| cumul_Proj : forall p c c',
    Σ ;;; Γ ⊢ c ≤s[Conv] c' ->
    Σ ;;; Γ ⊢ tProj p c ≤s[pb] tProj p c'

| cumul_Fix : forall mfix mfix' idx,
    All2 (fun x y =>
      Σ ;;; Γ ⊢ x.(dtype) ≤s[Conv] y.(dtype) ×
      Σ ;;; Γ ,,, fix_context mfix ⊢ x.(dbody) ≤s[Conv] y.(dbody) ×
      (x.(rarg) = y.(rarg)) ×
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ;;; Γ ⊢ tFix mfix idx ≤s[pb] tFix mfix' idx

| cumul_CoFix : forall mfix mfix' idx,
    All2 (fun x y =>
      Σ ;;; Γ ⊢ x.(dtype) ≤s[Conv] y.(dtype) ×
      Σ ;;; Γ ,,, fix_context mfix ⊢ x.(dbody) ≤s[Conv] y.(dbody) ×
      (x.(rarg) = y.(rarg)) ×
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ;;; Γ ⊢ tCoFix mfix idx ≤s[pb] tCoFix mfix' idx

| cumul_beta : forall na t b a,
    Σ ;;; Γ ⊢ tApp (tLambda na t b) a ≤s[pb] b {0 := a}

| cumul_zeta : forall na b t b',
    Σ ;;; Γ ⊢ tLetIn na b t b' ≤s[pb] b' {0 := b}

| cumul_rel i body :
    option_map decl_body (nth_error Γ i) = Some (Some body) ->
    Σ ;;; Γ ⊢ tRel i ≤s[pb] lift0 (S i) body

| cumul_iota : forall ci c u args p brs br,
    nth_error brs c = Some br ->
    #|args| = (ci.(ci_npar) + context_assumptions br.(bcontext))%nat ->
    Σ ;;; Γ ⊢ tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs  ≤s[pb] iota_red ci.(ci_npar) p args br

| cumul_fix : forall mfix idx args narg fn,
    unfold_fix mfix idx = Some (narg, fn) ->
    is_constructor narg args = true ->
    Σ ;;; Γ ⊢ mkApps (tFix mfix idx) args ≤s[pb] mkApps fn args

| cumul_cofix_case : forall ip p mfix idx args narg fn brs,
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ ⊢ tCase ip p (mkApps (tCoFix mfix idx) args) brs ≤s[pb] tCase ip p (mkApps fn args) brs

| cumul_cofix_proj : forall p mfix idx args narg fn,
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ ⊢ tProj p (mkApps (tCoFix mfix idx) args) ≤s[pb] tProj p (mkApps fn args)

| cumul_delta : forall c decl body (isdecl : declared_constant Σ c decl) u,
    decl.(cst_body) = Some body ->
    Σ ;;; Γ ⊢ tConst c u ≤s[pb] body@[u]

| cumul_proj : forall p args u arg,
    nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg ->
    Σ ;;; Γ ⊢ tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args) ≤s[pb] arg

where " Σ ;;; Γ ⊢ t ≤s[ pb ] u " := (@cumulSpec0 _ Σ Γ pb t u) : type_scope.
Definition cumulSpec `{checker_flags} (Σ : global_env_ext) Γ := cumulSpec0 Σ Γ Cumul.

Notation " Σ ;;; Γ |- t <=s u " := (@cumulSpec _ Σ Γ t u) (at level 50, Γ, t, u at next level).

Module PCUICConversionParSpec <: EnvironmentTyping.ConversionParSig PCUICTerm PCUICEnvironment PCUICTermUtils PCUICEnvTyping.
  Definition cumul_gen := @cumulSpec0.
End PCUICConversionParSpec.

End PCUICCumulativitySpec.
Import MetaCoq.PCUIC.Syntax.PCUICCases.

Reserved Notation " Σ ;;; Γ |- t ⇝ u " (at level 50, Γ, t, u at next level).

Inductive red1 (Σ : global_env) (Γ : context) : term -> term -> Type :=

| red_beta na t b a :
  Σ ;;; Γ |- tApp (tLambda na t b) a ⇝ b {0 := a}

| red_zeta na b t b' :
  Σ ;;; Γ |- tLetIn na b t b' ⇝ b' {0 := b}

| red_rel i body :
    option_map decl_body (nth_error Γ i) = Some (Some body) ->
    Σ ;;; Γ |- tRel i ⇝ lift0 (S i) body

| red_iota ci c u args p brs br :
    nth_error brs c = Some br ->
    #|args| = (ci.(ci_npar) + context_assumptions br.(bcontext))%nat ->
    Σ ;;; Γ |- tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs
        ⇝ iota_red ci.(ci_npar) p args br

| red_fix mfix idx args narg fn :
    unfold_fix mfix idx = Some (narg, fn) ->
    is_constructor narg args = true ->
    Σ ;;; Γ |- mkApps (tFix mfix idx) args ⇝ mkApps fn args

| red_cofix_case ip p mfix idx args narg fn brs :
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ |- tCase ip p (mkApps (tCoFix mfix idx) args) brs ⇝
         tCase ip p (mkApps fn args) brs

| red_cofix_proj p mfix idx args narg fn :
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ |- tProj p (mkApps (tCoFix mfix idx) args) ⇝ tProj p (mkApps fn args)

| red_delta c decl body (isdecl : declared_constant Σ c decl) u :
    decl.(cst_body) = Some body ->
    Σ ;;; Γ |- tConst c u ⇝ subst_instance u body

| red_proj p args u arg:
    nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg ->
    Σ ;;; Γ |- tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args) ⇝ arg

| abs_red_l na M M' N : Σ ;;; Γ |- M ⇝ M' -> Σ ;;; Γ |- tLambda na M N ⇝ tLambda na M' N
| abs_red_r na M M' N : Σ ;;; Γ ,, vass na N |- M ⇝ M' -> Σ ;;; Γ |- tLambda na N M ⇝ tLambda na N M'

| letin_red_def na b t b' r : Σ ;;; Γ |- b ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na r t b'
| letin_red_ty na b t b' r : Σ ;;; Γ |- t ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na b r b'
| letin_red_body na b t b' r : Σ ;;; Γ ,, vdef na b t |- b' ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na b t r

| case_red_param ci p params' c brs :
    OnOne2 (fun t u => Σ ;;; Γ |- t ⇝ u) p.(pparams) params' ->
    Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci (set_pparams p params') c brs

| case_red_return ci p preturn' c brs :
  Σ ;;; Γ ,,, inst_case_predicate_context p |- p.(preturn) ⇝ preturn' ->
  Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci (set_preturn p preturn') c brs

| case_red_discr ci p c c' brs :
  Σ ;;; Γ |- c ⇝ c' -> Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci p c' brs

| case_red_brs ci p c brs brs' :
    OnOne2 (fun br br' =>
      on_Trel_eq (fun t u => Σ ;;; Γ ,,, inst_case_branch_context p br |- t ⇝ u) bbody bcontext br br')
      brs brs' ->
    Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci p c brs'

| proj_red p c c' : Σ ;;; Γ |- c ⇝ c' -> Σ ;;; Γ |- tProj p c ⇝ tProj p c'

| app_red_l M1 N1 M2 : Σ ;;; Γ |- M1 ⇝ N1 -> Σ ;;; Γ |- tApp M1 M2 ⇝ tApp N1 M2
| app_red_r M2 N2 M1 : Σ ;;; Γ |- M2 ⇝ N2 -> Σ ;;; Γ |- tApp M1 M2 ⇝ tApp M1 N2

| prod_red_l na M1 M2 N1 : Σ ;;; Γ |- M1 ⇝ N1 -> Σ ;;; Γ |- tProd na M1 M2 ⇝ tProd na N1 M2
| prod_red_r na M2 N2 M1 : Σ ;;; Γ ,, vass na M1 |- M2 ⇝ N2 ->
                           Σ ;;; Γ |- tProd na M1 M2 ⇝ tProd na M1 N2

| evar_red ev l l' : OnOne2 (fun t u => Σ ;;; Γ |- t ⇝ u) l l' -> Σ ;;; Γ |- tEvar ev l ⇝ tEvar ev l'

| fix_red_ty mfix0 mfix1 idx :
    OnOne2 (on_Trel_eq (fun t u => Σ ;;; Γ |- t ⇝ u) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 ->
    Σ ;;; Γ |- tFix mfix0 idx ⇝ tFix mfix1 idx

| fix_red_body mfix0 mfix1 idx :
    OnOne2 (on_Trel_eq (fun t u => Σ ;;; Γ ,,, fix_context mfix0 |- t ⇝ u) dbody (fun x => (dname x, dtype x, rarg x)))
           mfix0 mfix1 ->
    Σ ;;; Γ |- tFix mfix0 idx ⇝ tFix mfix1 idx

| cofix_red_ty mfix0 mfix1 idx :
    OnOne2 (on_Trel_eq (fun t u => Σ ;;; Γ |- t ⇝ u) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 ->
    Σ ;;; Γ |- tCoFix mfix0 idx ⇝ tCoFix mfix1 idx

| cofix_red_body mfix0 mfix1 idx :
    OnOne2 (on_Trel_eq (fun t u => Σ ;;; Γ ,,, fix_context mfix0 |- t ⇝ u) dbody (fun x => (dname x, dtype x, rarg x))) mfix0 mfix1 ->
    Σ ;;; Γ |- tCoFix mfix0 idx ⇝ tCoFix mfix1 idx
where " Σ ;;; Γ |- t ⇝ u " := (red1 Σ Γ t u).

Module Export MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED.
Module Export PCUICTyping.
Import MetaCoq.Common.config.
Import MetaCoq.PCUIC.utils.PCUICAstUtils.

Implicit Types (cf : checker_flags) (Σ : global_env_ext).

Definition type_of_constructor mdecl (cdecl : constructor_body) (c : inductive * nat) (u : list Level.t) :=
  let mind := inductive_mind (fst c) in
  subst0 (inds mind u mdecl.(ind_bodies)) (subst_instance u (cstr_type cdecl)).

Include PCUICEnvTyping.

Inductive FixCoFix : Type := Fix | CoFix.

Class GuardChecker :=
{
  guard : FixCoFix -> global_env_ext -> context -> mfixpoint term -> Prop ;
}.

Axiom guard_checking : GuardChecker.
#[global]
Existing Instance guard_checking.

Definition fix_guard := guard Fix.
Definition cofix_guard := guard CoFix.

Definition destInd (t : term) :=
  match t with
  | tInd ind u => Some (ind, u)
  | _ => None
  end.

Definition isCoFinite (r : recursivity_kind) :=
  match r with
  | CoFinite => true
  | _ => false
  end.

Definition check_recursivity_kind
  (lookup: kername -> option global_decl) ind r :=
  match lookup ind with
  | Some (InductiveDecl mib) => ReflectEq.eqb mib.(ind_finite) r
  | _ => false
  end.

Definition check_one_fix d :=
  let '{| dname := na;
         dtype := ty;
         dbody := b;
         rarg := arg |} := d in
  let '(ctx, ty) := decompose_prod_assum [] ty in
  match nth_error (List.rev (smash_context [] ctx)) arg with
  | Some argd =>
    let (hd, args) := decompose_app argd.(decl_type) in
    match destInd hd with
    | Some (mkInd mind _, u) => Some mind
    | None => None
    end
  | None => None
  end.

Definition wf_fixpoint_gen
  (lookup: kername -> option global_decl) mfix :=
  forallb (isLambda ∘ dbody) mfix &&
  let checks := map check_one_fix mfix in
  match map_option_out checks with
  | Some (ind :: inds) =>

    forallb (eqb ind) inds &&
    check_recursivity_kind lookup ind Finite
  | _ => false
  end.

Definition wf_fixpoint (Σ : global_env) := wf_fixpoint_gen (lookup_env Σ).

Definition check_one_cofix d :=
  let '{| dname := na;
         dtype := ty;
         dbody := b;
         rarg := arg |} := d in
  let '(ctx, ty) :=
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 4.0MiB file on GitHub Actions Artifacts under build.log)
ate-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.7IlcEjjOds
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.fC2E8ccXAp
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.ooDYaVYDQx
MINIMIZER_DEBUG: files: 
make[4]: Nothing to be done for 'real-all'.
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.JZVEuOq48z
MINIMIZER_DEBUG: files: 
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make -f Makefile.plugin
make[3]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.rlGYOYsVB5
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.R7Jcd2GCll
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.dj8XdE8aIS
MINIMIZER_DEBUG: files: 
make[4]: Nothing to be done for 'real-all'.
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.rH2ZvHHyKU
MINIMIZER_DEBUG: files: 
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make[2]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make -C pcuic
make[2]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
make -f Makefile.coq
make[3]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.35ZpOHYXxK
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.ODJPgJEwSg
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.fsswd4qUON
MINIMIZER_DEBUG: files: 
COQC theories/PCUICProgress.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/utils/theories MetaCoq.Utils -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/common/theories MetaCoq.Common -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories MetaCoq.PCUIC theories/PCUICProgress.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.oA2XhFOjTJ
MINIMIZER_DEBUG: files:  theories/PCUICProgress.v
File "./theories/PCUICProgress.v", line 108, characters 2-60:
Error: Cannot infer an instance of type
"Σ;;; Γ |- T : tSort s" for the variable HT in
environment:
cf : checker_flags
Σ : global_env × universes_decl
wfΣ : wf Σ.1
Γ : context
a : term
u : list term
s : Universe.t
f, T : term
IHu : forall (H : Σ;;; Γ |- mkApps (tApp f a) u : T)
        (HT : Σ;;; Γ |- T : tSort s),
      ∑
        (A : term) (Hf : Σ;;; Γ |- tApp f a : A) (s' : Universe.t) 
      (HA : Σ;;; Γ |- A : tSort s'),
        typing_size Hf <= typing_size H
        × typing_size HA <= Init.Nat.max (typing_size H) (typing_size HT)
          × typing_spine_pred Σ Γ
              (fun (x ty : term) (Hx : Σ;;; Γ |- x : ty) =>
               typing_size Hx <= typing_size H) A u T
Hf : Σ;;; Γ |- mkApps (tApp f a) u : T
Ht : Σ;;; Γ |- T : tSort s
X : forall HT : Σ;;; Γ |- T : tSort s,
    ∑
      (A : term) (Hf0 : Σ;;; Γ |- tApp f a : A) (s' : Universe.t) 
    (HA : Σ;;; Γ |- A : tSort s'),
      typing_size Hf0 <= typing_size Hf
      × typing_size HA <= Init.Nat.max (typing_size Hf) (typing_size HT)
        × typing_spine_pred Σ Γ
            (fun (x ty : term) (Hx : Σ;;; Γ |- x : ty) =>
             typing_size Hx <= typing_size Hf) A u T

Command exited with non-zero status 1
theories/PCUICProgress.vo (real: 2.73, user: 2.45, sys: 0.27, mem: 888708 ko)
Makefile.coq:809: recipe for target 'theories/PCUICProgress.vo' failed
make[4]: *** [theories/PCUICProgress.vo] Error 1
Makefile.coq:408: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
Makefile:11: recipe for target 'coq' failed
make[2]: *** [coq] Error 2
make[2]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
Makefile:142: recipe for target 'pcuic' failed
make[1]: *** [pcuic] Error 2
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq'
Makefile.ci:150: recipe for target 'ci-metacoq' failed
make: *** [ci-metacoq] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 329KiB file on GitHub Actions Artifacts under bug.log)
acters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1373, characters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1373, characters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1373, characters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1373, characters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1373, characters 2-32:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1521, characters 4-29:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1555, characters 4-29:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 1997, characters 2-12:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 2008, characters 2-12:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 2035, characters 4-29:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 2068, characters 4-29:
Warning:
Automatically inlined signature for type eq_term_upto_univ_napp. Use [Derive Signature for eq_term_upto_univ_napp.] to avoid this.
File "/tmp/tmpml_gaug3/MetaCoq/PCUIC/PCUICProgress.v", line 2415, characters 0-27:
Error:
The field cumul_gen is missing in MetaCoq.PCUIC.PCUICProgress.PCUICCumulativitySpec.PCUICConversionParSpec.


�[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 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
Success!

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/tmpk4tned3r/MetaCoq/PCUIC/PCUICProgress.v", line 1322, characters 0-27:
Error:
The field cumul_gen is missing in MetaCoq.PCUIC.PCUICProgress.PCUICCumulativitySpec.PCUICConversionParSpec.


�[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/tmpt2f50zqu/MetaCoq/PCUIC/PCUICProgress.v", line 1326, characters 0-27:
Error:
The field cumul_gen is missing in MetaCoq.PCUIC.PCUICProgress.PCUICCumulativitySpec.PCUICConversionParSpec.


�[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/tmpk4tned3r/MetaCoq/PCUIC/PCUICProgress.v", line 1322, characters 0-27:
Error:
The field cumul_gen is missing in MetaCoq.PCUIC.PCUICProgress.PCUICCumulativitySpec.PCUICConversionParSpec.


�[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/tmpt2f50zqu/MetaCoq/PCUIC/PCUICProgress.v", line 1326, characters 0-27:
Error:
The field cumul_gen is missing in MetaCoq.PCUIC.PCUICProgress.PCUICCumulativitySpec.PCUICConversionParSpec.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[93mIntermediate code not saved.�[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:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


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

I will now attempt to admit lemmas with admit. Defined

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[93mIntermediate code not saved.�[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:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[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 successful

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

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

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

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.v (from ci-perennial) (interrupted by timeout, being automatically continued) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 93KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-w" "-ssr-search-moved" "-w" "+deprecated-hint-without-locality" "-w" "+deprecated-instance-without-locality" "-w" "-future-coercion-class-field" "-w" "+deprecated-hint-rewrite-without-locality" "-w" "-deprecated-field-instance-without-locality" "-w" "+deprecated-tactic-notation" "-w" "-notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality" "-w" "-deprecated-native-compiler-option,-native-compiler-disabled" "-native-compiler" "ondemand" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/src" "Perennial" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp" "stdpp" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable" "stdpp.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris" "iris" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated" "iris.deprecated" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable" "iris.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang" "iris.heap_lang" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil" "coqutil" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose" "Goose" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src" "RecordUpdate" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src" "Tactical" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src" "iris_named_props" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Top.bug_01") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 1064 lines to 89 lines, then from 102 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 783 lines, then from 785 lines to 113 lines, then from 126 lines to 480 lines, then from 485 lines to 130 lines, then from 143 lines to 668 lines, then from 673 lines to 175 lines, then from 188 lines to 343 lines, then from 348 lines to 176 lines, then from 189 lines to 351 lines, then from 356 lines to 176 lines, then from 189 lines to 530 lines, then from 535 lines to 181 lines, then from 194 lines to 1498 lines, then from 1503 lines to 220 lines, then from 233 lines to 3895 lines, then from 3900 lines to 1287 lines, then from 1300 lines to 1388 lines, then from 1393 lines to 1387 lines, then from 1403 lines to 1292 lines, then from 1305 lines to 1446 lines, then from 1451 lines to 1355 lines, then from 1368 lines to 1535 lines, then from 1540 lines to 1441 lines, then from 1454 lines to 1590 lines, then from 1595 lines to 1475 lines, then from 1488 lines to 1743 lines, then from 1748 lines to 1640 lines, then from 1653 lines to 1762 lines, then from 1767 lines to 1667 lines, then from 1680 lines to 1836 lines, then from 1841 lines to 1760 lines, then from 1773 lines to 3174 lines, then from 3179 lines to 2669 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 8.990 sec *)
Require Coq.Bool.Bool.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Init.Ltac.
Require Coq.Init.Peano.
Require Coq.Lists.List.
Require Coq.Logic.EqdepFacts.
Require Coq.NArith.NArith.
Require Coq.Numbers.Natural.Peano.NPeano.
Require Coq.PArith.PArith.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require Coq.QArith.QArith.
Require Coq.QArith.QArith_base.
Require Coq.QArith.Qcanon.
Require Coq.Setoids.Setoid.
Require Coq.Sorting.Permutation.
Require Coq.Strings.Ascii.
Require Coq.Strings.String.
Require Coq.Unicode.Utf8.
Require Coq.ZArith.ZArith.
Require Coq.micromega.Lia.
Require Coq.ssr.ssreflect.
Require Ltac2.Init.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Bool.
Require Ltac2.Array.
Require Ltac2.Char.
Require Ltac2.Constant.
Require Ltac2.Constr.
Require Ltac2.Constructor.
Require Ltac2.Std.
Require Ltac2.Env.
Require Ltac2.Evar.
Require Ltac2.Float.
Require Ltac2.List.
Require Ltac2.Fresh.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Ltac1.
Require Ltac2.Meta.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require Ltac2.Printf.
Require Ltac2.Proj.
Require Ltac2.String.
Require Ltac2.Uint63.
Require Ltac2.Notations.
Require Ltac2.Ltac2.
Require stdpp.options.
Require stdpp.base.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require stdpp.tactics.
Require stdpp.option.
Require stdpp.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.well_founded.
Require stdpp.countable.
Require stdpp.vector.
Require stdpp.finite.
Require stdpp.orders.
Require stdpp.sets.
Require stdpp.relations.
Require stdpp.fin_sets.
Require stdpp.listset.
Require stdpp.lexico.
Require stdpp.prelude.
Require iris.prelude.options.
Require iris.prelude.prelude.
Require iris.algebra.ofe.
Require iris.algebra.monoid.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.functions.
Require stdpp.strings.
Require stdpp.pretty.
Require stdpp.infinite.
Require stdpp.fin_maps.
Require stdpp.fin_map_dom.
Require stdpp.mapset.
Require stdpp.pmap.
Require stdpp.propset.
Require stdpp.gmap.
Require stdpp.functions.
Require stdpp.gmultiset.
Require iris.algebra.big_op.
Require iris.algebra.list.
Require iris.algebra.local_updates.
Require iris.algebra.gset.
Require iris.algebra.proofmode_classes.
Require iris.algebra.gmap.
Require stdpp.coPset.
Require stdpp.namespaces.
Require iris.bi.notation.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.extensions.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
Require iris.bi.big_op.
Require iris.bi.internal_eq.
Require iris.bi.plainly.
Require iris.bi.updates.
Require iris.bi.embedding.
Require iris.bi.bi.
Require iris.proofmode.base.
Require iris.proofmode.ident_name.
Require iris.proofmode.modalities.
Require iris.proofmode.classes.
Require iris.algebra.cofe_solver.
Require iris.algebra.frac.
Require iris.base_logic.upred.
Require iris.base_logic.bi.
Require iris.base_logic.derived.
Require iris.base_logic.proofmode.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require iris.algebra.view.
Require iris.algebra.auth.
Require iris.algebra.csum.
Require iris.algebra.excl.
Require iris.algebra.lib.excl_auth.
Require iris.algebra.lib.gmap_view.
Require iris.algebra.lib.dfrac_agree.
Require iris.base_logic.algebra.
Require iris.base_logic.base_logic.
Require iris.base_logic.lib.iprop.
Require iris.base_logic.lib.own.
Require Perennial.base_logic.lib.own.
Require stdpp.telescopes.
Require iris.bi.telescopes.
Require iris.proofmode.classes_make.
Require iris.proofmode.environments.
Require iris.proofmode.modality_instances.

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.

Module Export iris_DOT_proofmode_DOT_coq_tactics_WRAPPED.
Module Export coq_tactics.
Export iris.bi.bi.
Export iris.bi.telescopes.
Export iris.proofmode.base.
Export iris.proofmode.environments.
Export iris.proofmode.classes.
Export iris.proofmode.classes_make.
Export iris.proofmode.modality_instances.
Import iris.prelude.options.
Import bi.
Import env_notations.

Local Open Scope lazy_bool_scope.

 
Section tactics.
Context {PROP : bi}.
Implicit Types Γ : env PROP.
Implicit Types Δ : envs PROP.
Implicit Types P Q : PROP.

 
Lemma tac_start P : envs_entails (Envs Enil Enil 1) P → ⊢ P.
Admitted.

Lemma tac_stop Δ P :
  (match env_intuitionistic Δ, env_spatial Δ with
   | Enil, Γs => env_to_prop Γs
   | Γp, Enil => □ env_to_prop_and Γp
   | Γp, Γs => □ env_to_prop_and Γp ∗ env_to_prop Γs
   end ⊢ P) →
  envs_entails Δ P.
Admitted.

 
Lemma tac_eval Δ Q Q' :
  (∀ (Q'':=Q'), Q'' ⊢ Q) →  
  envs_entails Δ Q' → envs_entails Δ Q.
Admitted.

Lemma tac_eval_in Δ i p P P' Q :
  envs_lookup i Δ = Some (p, P) →
  (∀ (P'':=P'), P ⊢ P') →
  match envs_simple_replace i p (Esnoc Enil i P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

Class AffineEnv (Γ : env PROP) := affine_env : Forall Affine Γ.
Global Instance affine_env_nil : AffineEnv Enil.
Admitted.
Global Instance affine_env_snoc Γ i P :
  Affine P → AffineEnv Γ → AffineEnv (Esnoc Γ i P).
Admitted.

 
Global Instance affine_env_bi `(!BiAffine PROP) Γ : AffineEnv Γ | 0.
Admitted.

Local Instance affine_env_spatial Δ :
  AffineEnv (env_spatial Δ) → Affine ([∗] env_spatial Δ).
Admitted.

Lemma tac_emp_intro Δ : AffineEnv (env_spatial Δ) → envs_entails Δ emp.
Admitted.

Lemma tac_assumption Δ i p P Q :
  envs_lookup i Δ = Some (p,P) →
  FromAssumption p P Q →
  (let Δ' := envs_delete true i p Δ in
   if env_spatial_is_nil Δ' then TCTrue
   else TCOr (Absorbing Q) (AffineEnv (env_spatial Δ'))) →
  envs_entails Δ Q.
Admitted.

Lemma tac_assumption_coq Δ P Q :
  (⊢ P) →
  FromAssumption false P Q →
  (if env_spatial_is_nil Δ then TCTrue
   else TCOr (Absorbing Q) (AffineEnv (env_spatial Δ))) →
  envs_entails Δ Q.
Admitted.

Lemma tac_rename Δ i j p P Q :
  envs_lookup i Δ = Some (p,P) →
  match envs_simple_replace i p (Esnoc Enil j P) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

Lemma tac_clear Δ i p P Q :
  envs_lookup i Δ = Some (p,P) →
  (if p then TCTrue else TCOr (Affine P) (Absorbing Q)) →
  envs_entails (envs_delete true i p Δ) Q →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_ex_falso Δ Q : envs_entails Δ False → envs_entails Δ Q.
Admitted.

Lemma tac_false_destruct Δ i p P Q :
  envs_lookup i Δ = Some (p,P) →
  P = False%I →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_pure_intro Δ Q φ a :
  FromPure a Q φ →
  (if a then AffineEnv (env_spatial Δ) else TCTrue) →
  φ →
  envs_entails Δ Q.
Admitted.

Lemma tac_pure Δ i p P φ Q :
  envs_lookup i Δ = Some (p, P) →
  IntoPure P φ →
  (if p then TCTrue else TCOr (Affine P) (Absorbing Q)) →
  (φ → envs_entails (envs_delete true i p Δ) Q) → envs_entails Δ Q.
Admitted.

Lemma tac_pure_revert Δ φ P Q :
  FromAffinely P ⌜ φ ⌝ →
  envs_entails Δ (P -∗ Q) →
  (φ → envs_entails Δ Q).
Admitted.

 
Lemma tac_intuitionistic Δ i j p P P' Q :
  envs_lookup i Δ = Some (p, P) →
  IntoPersistent p P P' →
  (if p then TCTrue else TCOr (Affine P) (Absorbing Q)) →
  match envs_replace i p true (Esnoc Enil j P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

Lemma tac_spatial Δ i j p P P' Q :
  envs_lookup i Δ = Some (p, P) →
  (if p then FromAffinely P' P else TCEq P' P) →
  match envs_replace i p false (Esnoc Enil j P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_impl_intro Δ i P P' Q R :
  FromImpl R P Q →
  (if env_spatial_is_nil Δ then TCTrue else Persistent P) →
  FromAffinely P' P →
  match envs_app false (Esnoc Enil i P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ R.
Admitted.
Lemma tac_impl_intro_intuitionistic Δ i P P' Q R :
  FromImpl R P Q →
  IntoPersistent false P P' →
  match envs_app true (Esnoc Enil i P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ R.
Admitted.
Lemma tac_impl_intro_drop Δ P Q R :
  FromImpl R P Q → envs_entails Δ Q → envs_entails Δ R.
Admitted.

Lemma tac_wand_intro Δ i P Q R :
  FromWand R P Q →
  match envs_app false (Esnoc Enil i P) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ R.
Admitted.

Lemma tac_wand_intro_intuitionistic Δ i P P' Q R :
  FromWand R P Q →
  IntoPersistent false P P' →
  TCOr (Affine P) (Absorbing Q) →
  match envs_app true (Esnoc Enil i P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ R.
Admitted.
Lemma tac_wand_intro_drop Δ P Q R :
  FromWand R P Q →
  TCOr (Affine P) (Absorbing Q) →
  envs_entails Δ Q →
  envs_entails Δ R.
Admitted.

 
Lemma tac_specialize remove_intuitionistic Δ i p j q P1 P2 R Q :
  envs_lookup i Δ = Some (p, P1) →
  let Δ' := envs_delete remove_intuitionistic i p Δ in
  envs_lookup j Δ' = Some (q, R) →
  IntoWand q p R P1 P2 →
  match envs_replace j q (p &&& q) (Esnoc Enil j P2) Δ' with
  | Some Δ'' => envs_entails Δ'' Q
  | None => False
  end → envs_entails Δ Q.
Admitted.

Lemma tac_specialize_assert Δ j (q am neg : bool) js R P1 P2 P1' Q :
  envs_lookup j Δ = Some (q, R) →
  IntoWand q false R P1 P2 →
  (if am then AddModal P1' P1 Q else TCEq P1' P1) →
  match
    '(Δ1,Δ2) ← envs_split (if neg is true then Right else Left)
                          js (envs_delete true j q Δ);
    Δ2' ← envs_app (negb am &&& q &&& env_spatial_is_nil Δ1) (Esnoc Enil j P2) Δ2;
    Some (Δ1,Δ2')  
  with
  | Some (Δ1,Δ2') =>
      
     envs_entails Δ1 P1' ∧ envs_entails Δ2' Q
  | None => False
  end → envs_entails Δ Q.
Admitted.

Lemma tac_unlock_emp Δ Q : envs_entails Δ Q → envs_entails Δ (emp ∗ locked Q).
Admitted.
Lemma tac_unlock_True Δ Q : envs_entails Δ Q → envs_entails Δ (True ∗ locked Q).
Admitted.
Lemma tac_unlock Δ Q : envs_entails Δ Q → envs_entails Δ (locked Q).
Admitted.

Lemma tac_specialize_frame Δ j (q am : bool) R P1 P2 P1' Q Q' :
  envs_lookup j Δ = Some (q, R) →
  IntoWand q false R P1 P2 →
  (if am then AddModal P1' P1 Q else TCEq P1' P1) →
  envs_entails (envs_delete true j q Δ) (P1' ∗ locked Q') →
  Q' = (P2 -∗ Q)%I →
  envs_entails Δ Q.
Admitted.

Lemma tac_specialize_assert_pure Δ j q a R P1 P2 φ Q :
  envs_lookup j Δ = Some (q, R) →
  IntoWand q false R P1 P2 →
  FromPure a P1 φ →
  φ →
  match envs_simple_replace j q (Esnoc Enil j P2) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

Lemma tac_specialize_assert_intuitionistic Δ j q P1 P1' P2 R Q :
  envs_lookup j Δ = Some (q, R) →
  IntoWand q true R P1 P2 →
  Persistent P1 →
  IntoAbsorbingly P1' P1 →
  envs_entails (envs_delete true j q Δ) P1' →
  match envs_simple_replace j q (Esnoc Enil j P2) Δ with
  | Some Δ'' => envs_entails Δ'' Q
  | None => False
  end → envs_entails Δ Q.
Admitted.

Lemma tac_specialize_intuitionistic_helper Δ j q P R R' Q :
  envs_lookup j Δ = Some (q,P) →
  (if q then TCTrue else BiAffine PROP) →
  envs_entails Δ (<absorb> R) →
  IntoPersistent false R R' →
  match envs_replace j q true (Esnoc Enil j R') Δ with
  | Some Δ'' => envs_entails Δ'' Q
  | None => False
  end → envs_entails Δ Q.
Admitted.

 
Lemma tac_specialize_intuitionistic_helper_done Δ i q P :
  envs_lookup i Δ = Some (q,P) →
  envs_entails Δ (<absorb> P).
Admitted.

Lemma tac_revert Δ i Q :
  match envs_lookup_delete true i Δ with
  | Some (p,P,Δ') => envs_entails Δ' ((if p then □ P else P)%I -∗ Q)
  | None => False
  end →
  envs_entails Δ Q.
Admitted.

Class IntoIH (φ : Prop) (Δ : envs PROP) (Q : PROP) :=
  into_ih : φ → □ of_envs Δ ⊢ Q.
Global Instance into_ih_entails Δ Q : IntoIH (envs_entails Δ Q) Δ Q.
Admitted.
Global Instance into_ih_forall {A} (φ : A → Prop) Δ Φ :
  (∀ x, IntoIH (φ x) Δ (Φ x)) → IntoIH (∀ x, φ x) Δ (∀ x, Φ x) | 2.
Admitted.
Global Instance into_ih_impl (φ ψ : Prop) Δ Q :
  IntoIH φ Δ Q → IntoIH (ψ → φ) Δ (⌜ψ⌝ → Q) | 1.
Admitted.
 
Global Instance into_ih_Forall {A} (φ : A → Prop) l Δ Φ :
  (∀ x, IntoIH (φ x) Δ (Φ x)) →
  IntoIH (Forall φ l) Δ ([∗ list] x ∈ l, □ Φ x) | 2.
Admitted.
Global Instance into_ih_Forall2 {A B} (φ : A → B → Prop) l1 l2 Δ Φ :
  (∀ x1 x2, IntoIH (φ x1 x2) Δ (Φ x1 x2)) →
  IntoIH (Forall2 φ l1 l2) Δ ([∗ list] x1;x2 ∈ l1;l2, □ Φ x1 x2) | 2.
Admitted.

Lemma tac_revert_ih Δ P Q {φ : Prop} (Hφ : φ) :
  IntoIH φ Δ P →
  env_spatial_is_nil Δ = true →
  envs_entails Δ (<pers> P → Q) →
  envs_entails Δ Q.
Admitted.

Lemma tac_assert Δ j P Q :
  match envs_app true (Esnoc Enil j (P -∗ P)%I) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end → envs_entails Δ Q.
Admitted.

Definition IntoEmpValid (φ : Type) (P : PROP) := φ → ⊢ P.
 
Lemma into_emp_valid_here φ P : AsEmpValid φ P → IntoEmpValid φ P.
Admitted.
Lemma into_emp_valid_impl (φ ψ : Type) P :
  φ → IntoEmpValid ψ P → IntoEmpValid (φ → ψ) P.
Admitted.
Lemma into_emp_valid_forall {A} (φ : A → Type) P x :
  IntoEmpValid (φ x) P → IntoEmpValid (∀ x : A, φ x) P.
Admitted.
Lemma into_emp_valid_tforall {TT : tele} (φ : TT → Prop) P x :
  IntoEmpValid (φ x) P → IntoEmpValid (∀.. x : TT, φ x) P.
Admitted.
Lemma into_emp_valid_proj φ P : IntoEmpValid φ P → φ → ⊢ P.
Admitted.

 
Lemma tac_pose_proof Δ j P Q :
  (⊢ P) →
  match envs_app true (Esnoc Enil j P) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

Lemma tac_pose_proof_hyp Δ i j Q :
  match envs_lookup_delete false i Δ with
  | None => False
  | Some (p, P, Δ') =>
    match envs_app p (Esnoc Enil j P) Δ' with
    | None => False
    | Some Δ'' => envs_entails Δ'' Q
    end
  end →
  envs_entails Δ Q.
Admitted.

Lemma tac_apply Δ i p R P1 P2 :
  envs_lookup i Δ = Some (p, R) →
  IntoWand p false R P1 P2 →
  envs_entails (envs_delete true i p Δ) P1 → envs_entails Δ P2.
Admitted.

 
Lemma tac_and_split Δ P Q1 Q2 :
  FromAnd P Q1 Q2 → envs_entails Δ Q1 → envs_entails Δ Q2 → envs_entails Δ P.
Admitted.

 
Lemma tac_sep_split Δ d js P Q1 Q2 :
  FromSep P Q1 Q2 →
  match envs_split d js Δ with
  | None => False
  | Some (Δ1,Δ2) => envs_entails Δ1 Q1 ∧ envs_entails Δ2 Q2
  end → envs_entails Δ P.
Admitted.

 
Class CombineSepsAsGives {PROP : bi} (Ps : list PROP) (Q R : PROP) := {
  combine_seps_as_gives_as : [∗] Ps ⊢ Q;
  combine_seps_as_gives_gives : [∗] Ps ⊢ <pers> R;
}.
Global Arguments CombineSepsAsGives {_} _%I _%I _%I.
Global Arguments combine_seps_as_gives_as {_} _%I _%I _%I {_}.
Global Arguments combine_seps_as_gives_gives {_} _%I _%I _%I {_}.
 

Global Instance combine_seps_as_gives_nil : @CombineSepsAsGives PROP [] emp True.
Admitted.
Global Instance combine_seps_as_gives_singleton P :
  CombineSepsAsGives [P] P True | 1.
Admitted.
Global Instance combine_seps_gives_cons P Ps Q R Q' progress R' R'':
  CombineSepsAsGives Ps Q R →  
  MaybeCombineSepAs P Q Q' progress →  
  CombineSepGives P Q R' →  
  MakeAnd R R' R'' →  
  CombineSepsAsGives (P :: Ps) Q' R'' | 2.
Admitted.

 
Class CombineSepsAs {PROP : bi} (Ps : list PROP) (Q : PROP) :=
  combine_seps_as : [∗] Ps ⊢ Q.
Global Arguments CombineSepsAs {_} _%I _%I.
Global Arguments combine_seps_as {_} _%I _%I {_}.
 

 
Global Instance combine_seps_as_from_as_gives Ps Q R :
  ((∀ P P', CombineSepGives P P' True%I) → CombineSepsAsGives Ps Q R) →
  CombineSepsAs Ps Q.
Admitted.

Lemma tac_combine_as Δ1 Δ2 Δ3 js p Ps j P Q :
  envs_lookup_delete_list false js Δ1 = Some (p, Ps, Δ2) →
  CombineSepsAs Ps P →
  envs_app p (Esnoc Enil j P) Δ2 = Some Δ3 →
  envs_entails Δ3 Q → envs_entails Δ1 Q.
Admitted.

Lemma combine_seps_gives_of_envs Δ1 Δ2 js p Ps P R :
  envs_lookup_delete_list false js Δ1 = Some (p, Ps, Δ2) →
  CombineSepsAsGives Ps P R →
  of_envs Δ1 ⊢ of_envs Δ1 ∗ □ R.
Admitted.

Lemma tac_combine_gives Δ1 Δ2 Δ3 js p Ps j P Q R :
  envs_lookup_delete_list false js Δ1 = Some (p, Ps, Δ2) →
  CombineSepsAsGives Ps P R →
  envs_app true (Esnoc Enil j R) Δ1 = Some Δ3 →
  envs_entails Δ3 Q → envs_entails Δ1 Q.
Admitted.

Lemma tac_combine_as_gives Δ1 Δ2 Δ3 js p Ps j k P R Q :
  envs_lookup_delete_list false js Δ1 = Some (p, Ps, Δ2) →
  CombineSepsAsGives Ps P R →
     
  envs_app p (Esnoc (Esnoc Enil j P) k (□ R)%I) Δ2 = Some Δ3 →
  envs_entails Δ3 Q → envs_entails Δ1 Q.
Admitted.

 
Lemma tac_and_destruct Δ i p j1 j2 P P1 P2 Q :
  envs_lookup i Δ = Some (p, P) →
  (if p then IntoAnd true P P1 P2 else IntoSep P P1 P2) →
  match envs_simple_replace i p (Esnoc (Esnoc Enil j1 P1) j2 P2) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_and_destruct_choice Δ i p d j P P1 P2 Q :
  envs_lookup i Δ = Some (p, P) →
  (if p then IntoAnd p P P1 P2 : Type else
    TCOr (IntoAnd p P P1 P2) (TCAnd (IntoSep P P1 P2)
      (if d is Left then TCOr (Affine P2) (Absorbing Q)
       else TCOr (Affine P1) (Absorbing Q)))) →
  match envs_simple_replace i p (Esnoc Enil j (if d is Left then P1 else P2)) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end → envs_entails Δ Q.
Admitted.

 
Lemma tac_frame_pure Δ (φ : Prop) P Q :
  φ → Frame true ⌜φ⌝ P Q → envs_entails Δ Q → envs_entails Δ P.
Admitted.

Lemma tac_frame Δ i p R P Q :
  envs_lookup i Δ = Some (p, R) →
  Frame p R P Q →
  envs_entails (envs_delete false i p Δ) Q → envs_entails Δ P.
Admitted.

 
Lemma tac_or_l Δ P Q1 Q2 :
  FromOr P Q1 Q2 → envs_entails Δ Q1 → envs_entails Δ P.
Admitted.
Lemma tac_or_r Δ P Q1 Q2 :
  FromOr P Q1 Q2 → envs_entails Δ Q2 → envs_entails Δ P.
Admitted.

Lemma tac_or_destruct Δ i p j1 j2 P P1 P2 Q :
  envs_lookup i Δ = Some (p, P) → IntoOr P P1 P2 →
  match envs_simple_replace i p (Esnoc Enil j1 P1) Δ,
        envs_simple_replace i p (Esnoc Enil j2 P2) Δ with
  | Some Δ1, Some Δ2 => envs_entails Δ1 Q ∧ envs_entails Δ2 Q
  | _, _ => False
  end →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_forall_intro {A} Δ (Φ : A → PROP) Q name :
  FromForall Q Φ name →
  (  
   let _ := name in
   ∀ a, envs_entails Δ (Φ a)) →
  envs_entails Δ Q.
Admitted.

Lemma tac_forall_specialize {A} Δ i p P (Φ : A → PROP) Q :
  envs_lookup i Δ = Some (p, P) → IntoForall P Φ →
  (∃ x : A,
      match envs_simple_replace i p (Esnoc Enil i (Φ x)) Δ with
      | None => False
      | Some Δ' => envs_entails Δ' Q
      end) →
  envs_entails Δ Q.
Admitted.

Lemma tac_forall_revert {A} Δ (Φ : A → PROP) :
  envs_entails Δ (∀ a, Φ a) → ∀ a, envs_entails Δ (Φ a).
Admitted.

 
Lemma tac_exist {A} Δ P (Φ : A → PROP) :
  FromExist P Φ → (∃ a, envs_entails Δ (Φ a)) → envs_entails Δ P.
Admitted.

Lemma tac_exist_destruct {A} Δ i p j P (Φ : A → PROP) (name: ident_name) Q :
  envs_lookup i Δ = Some (p, P) → IntoExist P Φ name →
  (  
    let _ := name in
    ∀ a,
     match envs_simple_replace i p (Esnoc Enil j (Φ a)) Δ with
     | Some Δ' => envs_entails Δ' Q
     | None => False
     end) →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_modal_elim Δ i j p p' φ P' P Q Q' :
  envs_lookup i Δ = Some (p, P) →
  ElimModal φ p p' P P' Q Q' →
  φ →
  match envs_replace i p p' (Esnoc Enil j P') Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q'
  end →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_accu Δ P :
  env_to_prop (env_spatial Δ) = P →
  envs_entails Δ P.
Admitted.

 
Lemma tac_inv_elim {X : Type} Δ i j φ p Pinv Pin Pout (Pclose : option (X → PROP))
      Q (Q' : X → PROP) :
  envs_lookup i Δ = Some (p, Pinv) →
  ElimInv φ Pinv Pin Pout Pclose Q Q' →
  φ →
  (∀ R,
    match envs_app false (Esnoc Enil j
      (Pin -∗
       (∀ x, Pout x -∗ pm_option_fun Pclose x -∗? Q' x) -∗
       R
      )%I) (envs_delete false i p Δ)
    with Some Δ'' => envs_entails Δ'' R | None => False end) →
  envs_entails Δ Q.
Admitted.

 
Lemma tac_rewrite `{!BiInternalEq PROP} Δ i p Pxy d Q :
  envs_lookup i Δ = Some (p, Pxy) →
  ∀ {A : ofe} (x y : A) (Φ : A → PROP),
    IntoInternalEq Pxy x y →
    (Q ⊣⊢ Φ (if d is Left then y else x)) →
    NonExpansive Φ →
    envs_entails Δ (Φ (if d is Left then x else y)) → envs_entails Δ Q.
Admitted.

Lemma tac_rewrite_in `{!BiInternalEq PROP} Δ i p Pxy j q P d Q :
  envs_lookup i Δ = Some (p, Pxy) →
  envs_lookup j Δ = Some (q, P) →
  ∀ {A : ofe} (x y : A) (Φ : A → PROP),
    IntoInternalEq Pxy x y →
    (P ⊣⊢ Φ (if d is Left then y else x)) →
    NonExpansive Φ →
    match envs_simple_replace j q (Esnoc Enil j (Φ (if d is Left then x else y))) Δ with
    | None => False
    | Some Δ' => envs_entails Δ' Q
    end →
    envs_entails Δ Q.
Admitted.

 
Lemma tac_löb Δ i Q :
  BiLöb PROP →
  env_spatial_is_nil Δ = true →
  match envs_app true (Esnoc Enil i (▷ Q)%I) Δ with
  | None => False
  | Some Δ' => envs_entails Δ' Q
  end →
  envs_entails Δ Q.
Admitted.
End tactics.

Global Hint Mode CombineSepsAs + ! - : typeclass_instances.
Global Hint Mode CombineSepsAsGives + ! - - : typeclass_instances.

 
 
Class TransformIntuitionisticEnv {PROP1 PROP2} (M : modality PROP1 PROP2)
    (C : PROP2 → PROP1 → Prop) (Γin : env PROP2) (Γout : env PROP1) := {
  transform_intuitionistic_env :
    (∀ P Q, C P Q → □ P ⊢ M (□ Q)) →
    (∀ P Q, M P ∧ M Q ⊢ M (P ∧ Q)) →
    <affine> env_and_persistently Γin ⊢ M (<affine> env_and_persistently Γout);
  transform_intuitionistic_env_wf : env_wf Γin → env_wf Γout;
  transform_intuitionistic_env_dom i : Γin !! i = None → Γout !! i = None;
}.

 
Class TransformSpatialEnv {PROP1 PROP2} (M : modality PROP1 PROP2)
    (C : PROP2 → PROP1 → Prop) (Γin : env PROP2) (Γout : env PROP1)
    (filtered : bool) := {
  transform_spatial_env :
    (∀ P Q, C P Q → P ⊢ M Q) →
    ([∗] Γin) ⊢ M ([∗] Γout) ∗ if filtered then True else emp;
  transform_spatial_env_wf : env_wf Γin → env_wf Γout;
  transform_spatial_env_dom i : Γin !! i = None → Γout !! i = None;
}.

 
Inductive IntoModalIntuitionisticEnv {PROP2} : ∀ {PROP1} (M : modality PROP1 PROP2)
    (Γin : env PROP2) (Γout : env PROP1), modality_action PROP1 PROP2 → Prop :=
  | MIEnvIsEmpty_intuitionistic {PROP1} (M : modality PROP1 PROP2) :
     IntoModalIntuitionisticEnv M Enil Enil MIEnvIsEmpty
  | MIEnvForall_intuitionistic (M : modality PROP2 PROP2) (C : PROP2 → Prop) Γ :
     TCForall C (env_to_list Γ) →
     IntoModalIntuitionisticEnv M Γ Γ (MIEnvForall C)
  | MIEnvTransform_intuitionistic {PROP1}
       (M : modality PROP1 PROP2) (C : PROP2 → PROP1 → Prop) Γin Γout :
     TransformIntuitionisticEnv M C Γin Γout →
     IntoModalIntuitionisticEnv M Γin Γout (MIEnvTransform C)
  | MIEnvClear_intuitionistic {PROP1 : bi} (M : modality PROP1 PROP2) Γ :
     IntoModalIntuitionisticEnv M Γ Enil MIEnvClear
  | MIEnvId_intuitionistic (M : modality PROP2 PROP2) Γ :
     IntoModalIntuitionisticEnv M Γ Γ MIEnvId.
Existing Class IntoModalIntuitionisticEnv.
Global Existing Instances MIEnvIsEmpty_intuitionistic MIEnvForall_intuitionistic
  MIEnvTransform_intuitionistic MIEnvClear_intuitionistic MIEnvId_intuitionistic.

 
Inductive IntoModalSpatialEnv {PROP2} : ∀ {PROP1} (M : modality PROP1 PROP2)
    (Γin : env PROP2) (Γout : env PROP1), modality_action PROP1 PROP2 → bool → Prop :=
  | MIEnvIsEmpty_spatial {PROP1} (M : modality PROP1 PROP2) :
     IntoModalSpatialEnv M Enil Enil MIEnvIsEmpty false
  | MIEnvForall_spatial (M : modality PROP2 PROP2) (C : PROP2 → Prop) Γ :
     TCForall C (env_to_list Γ) →
     IntoModalSpatialEnv M Γ Γ (MIEnvForall C) false
  | MIEnvTransform_spatial {PROP1}
       (M : modality PROP1 PROP2) (C : PROP2 → PROP1 → Prop) Γin Γout fi :
     TransformSpatialEnv M C Γin Γout fi →
     IntoModalSpatialEnv M Γin Γout (MIEnvTransform C) fi
  | MIEnvClear_spatial {PROP1 : bi} (M : modality PROP1 PROP2) Γ :
     IntoModalSpatialEnv M Γ Enil MIEnvClear false
  | MIEnvId_spatial (M : modality PROP2 PROP2) Γ :
     IntoModalSpatialEnv M Γ Γ MIEnvId false.
Existing Class IntoModalSpatialEnv.
Global Existing Instances MIEnvIsEmpty_spatial MIEnvForall_spatial
  MIEnvTransform_spatial MIEnvClear_spatial MIEnvId_spatial.

Section tac_modal_intro.
  Context {PROP1 PROP2 : bi} (M : modality PROP1 PROP2).

  Global Instance transform_intuitionistic_env_nil C : TransformIntuitionisticEnv M C Enil Enil.
Admitted.
  Global Instance transform_intuitionistic_env_snoc (C : PROP2 → PROP1 → Prop) Γ Γ' i P Q :
    C P Q →
    TransformIntuitionisticEnv M C Γ Γ' →
    TransformIntuitionisticEnv M C (Esnoc Γ i P) (Esnoc Γ' i Q).
Admitted.
  Global Instance transform_intuitionistic_env_snoc_not (C : PROP2 → PROP1 → Prop) Γ Γ' i P :
    TransformIntuitionisticEnv M C Γ Γ' →
    TransformIntuitionisticEnv M C (Esnoc Γ i P) Γ' | 100.
Admitted.

  Global Instance transform_spatial_env_nil C :
    TransformSpatialEnv M C Enil Enil false.
Admitted.
  Global Instance transform_spatial_env_snoc (C : PROP2 → PROP1 → Prop) Γ Γ' i P Q fi :
    C P Q →
    TransformSpatialEnv M C Γ Γ' fi →
    TransformSpatialEnv M C (Esnoc Γ i P) (Esnoc Γ' i Q) fi.
Admitted.

  Global Instance transform_spatial_env_snoc_not
      (C : PROP2 → PROP1 → Prop) Γ Γ' i P fi fi' :
    TransformSpatialEnv M C Γ Γ' fi →
    TCIf (TCEq fi false)
      (TCIf (Affine P) (TCEq fi' false) (TCEq fi' true))
      (TCEq fi' true) →
    TransformSpatialEnv M C (Esnoc Γ i P) Γ' fi' | 100.
Admitted.

   
  Lemma tac_modal_intro {A} φ (sel : A) Γp Γs n Γp' Γs' Q Q' fi :
    FromModal φ M sel Q' Q →
    IntoModalIntuitionisticEnv M Γp Γp' (modality_intuitionistic_action M) →
    IntoModalSpatialEnv M Γs Γs' (modality_spatial_action M) fi →
    (if fi then Absorbing Q' else TCTrue) →
    φ →
    envs_entails (Envs Γp' Γs' n) Q → envs_entails (Envs Γp Γs n) Q'.
Admitted.
End tac_modal_intro.

 
Class MaybeIntoLaterNEnvs {PROP : bi} (n : nat) (Δ1 Δ2 : envs PROP) := {
  into_later_intuitionistic :
    TransformIntuitionisticEnv (modality_laterN n) (MaybeIntoLaterN false n)
      (env_intuitionistic Δ1) (env_intuitionistic Δ2);
  into_later_spatial :
    TransformSpatialEnv (modality_laterN n)
      (MaybeIntoLaterN false n) (env_spatial Δ1) (env_spatial Δ2) false
}.

Global Instance into_laterN_envs {PROP : bi} n (Γp1 Γp2 Γs1 Γs2 : env PROP) m :
  TransformIntuitionisticEnv (modality_laterN n) (MaybeIntoLaterN false n) Γp1 Γp2 →
  TransformSpatialEnv (modality_laterN n) (MaybeIntoLaterN false n) Γs1 Γs2 false →
  MaybeIntoLaterNEnvs n (Envs Γp1 Γs1 m) (Envs Γp2 Γs2 m).
Admitted.

Lemma into_laterN_env_sound {PROP : bi} n (Δ1 Δ2 : envs PROP) :
  MaybeIntoLaterNEnvs n Δ1 Δ2 → of_envs Δ1 ⊢ ▷^n (of_envs Δ2).
Admitted.

End coq_tactics.

End iris_DOT_proofmode_DOT_coq_tactics_WRAPPED.
Module Export iris_DOT_proofmode_DOT_coq_tactics.
Module Export iris.
Module Export proofmode.
Module Export coq_tactics.
Include iris_DOT_proofmode_DOT_coq_tactics_WRAPPED.coq_tactics.
End coq_tactics.

End proofmode.

End iris.

End iris_DOT_proofmode_DOT_coq_tactics.
Import iris.proofmode.base.

Inductive token :=
  | TName : string → token
  | TNat : nat → token
  | TAnon : token
  | TFrame : token
  | TBar : token
  | TBracketL : token
  | TBracketR : token
  | TAmp : token
  | TParenL : token
  | TParenR : token
  | TBraceL : token
  | TBraceR : token
  | TPure : option string → token
  | TIntuitionistic : token
  | TModal : token
  | TPureIntro : token
  | TIntuitionisticIntro : token
  | TModalIntro : token
  | TSimpl : token
  | TDone : token
  | TForall : token
  | TAll : token
  | TMinus : token
  | TSep : token
  | TArrow : direction → token.

Inductive state :=
  | SName : string → state
  | SNat : nat → state
  | SPure : string -> state
  | SNone : state.
Definition cons_state (kn : state) (k : list token) : list token.
exact (match kn with
  | SNone => k
  | SName s => TName (string_rev s) :: k
  | SPure s => TPure (if String.eqb s "" then None else Some (string_rev s)) :: k
  | SNat n => TNat n :: k
  end).
Defined.
Fixpoint tokenize_go (s : string) (k : list token) (kn : state) : list token.
exact (match s with
  | "" => reve
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 3.8MiB file on GitHub Actions Artifacts under build.log)
ild_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/builds/coq/coq/_build_ci/perennial'
make[1]: Leaving directory '/builds/coq/coq/_build_ci/perennial'
Aggregating timing log...
No timing data
/github/workspace/builds/coq /github/workspace
::endgroup::
::group::make ci-perennial (failing)
/builds/coq/coq /github/workspace/builds/coq /github/workspace
./dev/ci/ci-wrapper.sh perennial
++ : 2
++ export NJOBS
++ which cygpath
++ OCAMLFINDSEP=:
++ export OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ '[' -n 1 ']'
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ export CI_BRANCH=
++ CI_BRANCH=
++ [[ '' =~ ^[0-9]*$ ]]
++ export CI_PULL_REQUEST=
++ CI_PULL_REQUEST=
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ ls -l /github/workspace/builds/coq/coq-failing/_install_ci/bin/
total 664756
-rwxr-xr-x 1 root root     2125 May  4 02:08 coq-tex
-rwxr-xr-x 1 root root  2754376 May  3 12:41 coq-tex.orig
-rwxr-xr-x 1 root root  8917640 May  3 12:41 coq_makefile
-rwxr-xr-x 1 root root     2122 May  4 02:08 coqc
-rwxr-xr-x 1 root root     2127 May  4 02:08 coqc.byte
-rwxr-xr-x 1 root root 41273893 May  3 12:41 coqc.byte.orig
-rwxr-xr-x 1 root root 67183512 May  3 12:41 coqc.orig
-rwxr-xr-x 1 root root 22613416 May  3 12:41 coqchk
-rwxr-xr-x 1 root root  9473312 May  3 12:41 coqdep
-rwxr-xr-x 1 root root     2124 May  4 02:08 coqdoc
-rwxr-xr-x 1 root root  9392344 May  3 12:41 coqdoc.orig
-rwxr-xr-x 1 root root     2124 May  4 02:08 coqide
-rwxr-xr-x 1 root root 21602928 May  3 12:42 coqide.orig
-rwxr-xr-x 1 root root     2132 May  4 02:08 coqidetop.byte
-rwxr-xr-x 1 root root 41836419 May  3 12:42 coqidetop.byte.orig
-rwxr-xr-x 1 root root     2131 May  4 02:08 coqidetop.opt
-rwxr-xr-x 1 root root 67900456 May  3 12:42 coqidetop.opt.orig
-rwxr-xr-x 1 root root     2127 May  4 02:08 coqnative
-rwxr-xr-x 1 root root 22718304 May  3 12:41 coqnative.orig
-rwxr-xr-x 1 root root     2123 May  4 02:08 coqpp
-rwxr-xr-x 1 root root  3430448 May  3 12:41 coqpp.orig
-rwxr-xr-x 1 root root     2133 May  4 02:08 coqtimelog2html
-rwxr-xr-x 1 root root  4633952 May  3 12:41 coqtimelog2html.orig
-rwxr-xr-x 1 root root     2124 May  4 02:08 coqtop
-rwxr-xr-x 1 root root     2129 May  4 02:08 coqtop.byte
-rwxr-xr-x 1 root root 59580852 May  3 12:41 coqtop.byte.orig
-rwxr-xr-x 1 root root     2128 May  4 02:08 coqtop.opt
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.opt.orig
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.orig
-rwxr-xr-x 1 root root     2123 May  4 02:08 coqwc
-rwxr-xr-x 1 root root  2357648 May  3 12:41 coqwc.orig
-rwxr-xr-x 1 root root     2131 May  4 02:08 coqworker.opt
-rwxr-xr-x 1 root root 67260312 May  3 12:41 coqworker.opt.orig
-rwxr-xr-x 1 root root     2128 May  4 02:08 coqworkmgr
-rwxr-xr-x 1 root root  3603640 May  3 12:41 coqworkmgr.orig
-rwxr-xr-x 1 root root     2126 May  4 02:08 csdpcert
-rwxr-xr-x 1 root root 81440368 May  3 12:41 csdpcert.orig
-rwxr-xr-x 1 root root     2129 May  4 02:08 ocamllibdep
-rwxr-xr-x 1 root root  3680048 May  3 12:41 ocamllibdep.orig
-rwxr-xr-x 1 root root     2124 May  4 02:08 votour
-rwxr-xr-x 1 root root  4405272 May  3 12:41 votour.orig
++ CI_BUILD_DIR=/github/workspace/builds/coq/coq-failing/_build_ci
++ CI_INSTALL_DIR=/github/workspace/builds/coq/coq-failing/_install_ci
++ ls -l /github/workspace/builds/coq/coq-failing/_build_ci
total 4
drwxr-xr-x 7 root root 4096 May  3 13:43 perennial
++ declare -A overlays
++ set +x
+ WITH_SUBMODULES=1
+ git_download perennial
+ local project=perennial
+ local dest=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ local giturl_var=perennial_CI_GITURL
+ local giturl=https://github.com/mit-pdos/perennial
+ local ref_var=perennial_CI_REF
+ local ref=coq/tested
+ local ov_url=
+ local ov_ref=
+ '[' -d /github/workspace/builds/coq/coq-failing/_build_ci/perennial ']'
+ echo 'Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.'
Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.
+ '[' '' ']'
+ ulimit -s
16384
+ ulimit -s 65536
+ ulimit -s
65536
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
COQC src/base_logic/lib/wsat.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src Perennial -w -ssr-search-moved -w +deprecated-hint-without-locality -w +deprecated-instance-without-locality -w -future-coercion-class-field -w +deprecated-hint-rewrite-without-locality -w -deprecated-field-instance-without-locality -w +deprecated-tactic-notation -w -notation-overridden\,-redundant-canonical-projection\,-deprecated-typeclasses-transparency-without-locality -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp stdpp -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable stdpp.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris iris -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated iris.deprecated -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable iris.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang iris.heap_lang -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil coqutil -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose Goose -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src RecordUpdate -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src Tactical -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src iris_named_props -o /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.vo src/base_logic/lib/wsat.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.IcfC3brvEr
MINIMIZER_DEBUG: files:  src/base_logic/lib/wsat.v
File "./src/base_logic/lib/wsat.v", line 627, characters 2-3:
Error: This proof is focused, but cannot be unfocused this way

Makefile:53: recipe for target 'src/base_logic/lib/wsat.vo' failed
make[1]: *** [src/base_logic/lib/wsat.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
Makefile.ci:150: recipe for target 'ci-perennial' failed
make: *** [ci-perennial] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 493KiB file on GitHub Actions Artifacts under bug.log)
s/iris_unstable iris.unstable -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_heap_lang iris.heap_lang -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/coqutil/src/coqutil coqutil -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/Goose Goose -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/record-update/src RecordUpdate -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/coq-tactical/src Tactical -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris-named-props/src iris_named_props -Q /github/workspace/builds/coq/coq-passing/_install_ci/lib/coq/user-contrib/Ltac2 Ltac2 -arg -w -arg -ssr-search-moved -arg -w -arg +deprecated-hint-without-locality -arg -w -arg +deprecated-instance-without-locality -arg -w -arg -future-coercion-class-field -arg -w -arg +deprecated-hint-rewrite-without-locality -arg -w -arg -deprecated-field-instance-without-locality -arg -w -arg +deprecated-tactic-notation -arg -w -arg -notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality -arg -w -arg -deprecated-native-compiler-option,-native-compiler-disabled -arg -native-compiler -arg ondemand bug_01.v
getting Makefile66c2mgbr.coq (/github/workspace/cwd/Makefile66c2mgbr.coq)
make -k -f Makefile66c2mgbr.coq KEEP_ERROR=1 bug_01.glob
�[92m
Succeeded in normalizing Requires.�[0m

Now, I will attempt to split up [Require] statements...
getting /github/workspace/cwd/bug_01.v
getting /github/workspace/cwd/bug_01.glob
getting /github/workspace/cwd/bug_01.glob

No Requires to split.

In order to efficiently manipulate the file, I have to break it into statements.  I will attempt to do this by matching on periods.
�[92m
Splitting successful.�[0m

I will now attempt to remove any lines after the line which generates the error.

No lines to trim.

In order to efficiently manipulate the file, I have to break it into definitions.  I will now attempt to do this.
Sending statements to coqtop...
Done.  Splitting to definitions...
�[92m
Splitting to definitions 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

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpnm_o8l4b/Top/bug_01.v", line 2530, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmpk3kd9l1m/Top/bug_01.v", line 2530, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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 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
Success!

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/tmp1pwllieq/Top/bug_01.v", line 1823, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmp_5xbgnxa/Top/bug_01.v", line 1823, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmp1pwllieq/Top/bug_01.v", line 1823, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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/tmp_5xbgnxa/Top/bug_01.v", line 1823, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module spec_pat, module intro_pat and module sel_pat
need to be closed.


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas successful
Success!

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/tmp8riba9qb/Top/bug_01.v", line 2426, characters 0-9:
Error: Could not declare a canonical structure mlistC.
Could not find its value in the global environment.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module spec_pat, module intro_pat and module sel_pat
need to be closed.


�[93mIntermediate code not saved.�[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/tmpo4arartv/Top/bug_01.v", line 2436, characters 0-8:
Error: Could not declare a canonical structure mlistC.
Expected a record or structure constructor applied to arguments.


�[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 successful

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

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

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

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories/PCUICProgress.v (from ci-metacoq) (interrupted by timeout, being automatically continued) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 45KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/utils/theories" "MetaCoq.Utils" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/common/theories" "MetaCoq.Common" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories" "MetaCoq.PCUIC" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Equations" "Equations" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Top.bug_01") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 790 lines to 51 lines, then from 64 lines to 859 lines, then from 864 lines to 91 lines, then from 104 lines to 1730 lines, then from 1735 lines to 363 lines, then from 376 lines to 2672 lines, then from 2674 lines to 453 lines, then from 466 lines to 1362 lines, then from 1366 lines to 615 lines, then from 628 lines to 1040 lines, then from 1045 lines to 617 lines, then from 630 lines to 2427 lines, then from 2426 lines to 628 lines, then from 641 lines to 2534 lines, then from 2538 lines to 1165 lines, then from 1158 lines to 803 lines, then from 816 lines to 1405 lines, then from 1408 lines to 926 lines, then from 939 lines to 2156 lines, then from 2155 lines to 942 lines, then from 955 lines to 2414 lines, then from 2415 lines to 1198 lines, then from 1211 lines to 1468 lines, then from 1473 lines to 1212 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.09.0
   coqtop version runner-5nczbzj5-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874a4b) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 3.616 sec *)
Require MetaCoq.Common.EnvironmentTyping.
Require MetaCoq.Common.Reflect.
Module Export PCUICPrimitive.
 
Import MetaCoq.Utils.utils.
Import MetaCoq.Common.Primitive.

Inductive prim_model (term : Type) : prim_tag -> Type :=
| primIntModel (i : PrimInt63.int) : prim_model term primInt
| primFloatModel (f : PrimFloat.float) : prim_model term primFloat.

Definition prim_val term := ∑ t : prim_tag, prim_model term t.
Definition prim_val_tag {term} (s : prim_val term) := s.π1.
Admit Obligations.

End PCUICPrimitive.
Import MetaCoq.Utils.utils.
Export MetaCoq.Common.Universes.
Export MetaCoq.Common.BasicAst.
Export MetaCoq.Common.Environment.

Record predicate {term} := mk_predicate {
  pparams : list term;
  puinst : Instance.t;
  pcontext : list (context_decl term);

  preturn : term;   }.
Arguments predicate : clear implicits.

Section map_predicate_k.
  Context {term : Type}.
  Context (uf : Instance.t -> Instance.t).
  Context (f : nat -> term -> term).

  Definition map_predicate_k k (p : predicate term) :=
    {| pparams := map (f k) p.(pparams);
        puinst := uf p.(puinst);
        pcontext := p.(pcontext);
        preturn := f (#|p.(pcontext)| + k) p.(preturn) |}.

  Definition test_predicate_k (instp : Instance.t -> bool)
    (p : nat -> term -> bool) k (pred : predicate term) :=
    instp pred.(puinst) && forallb (p k) pred.(pparams) &&
    test_context_k p #|pred.(pparams)| pred.(pcontext) &&
    p (#|pred.(pcontext)| + k) pred.(preturn).

End map_predicate_k.

Section Branch.
  Context {term : Type}.

  Record branch := mk_branch {
    bcontext : list (context_decl term);

    bbody : term;   }.

  Definition test_branch_k (pred : predicate term) (p : nat -> term -> bool) k (b : branch) :=
    test_context_k p #|pred.(pparams)| b.(bcontext) && p (#|b.(bcontext)| + k) b.(bbody).

End Branch.
Arguments branch : clear implicits.

Section map_branch_k.
  Context {term term' : Type}.
  Context (f : nat -> term -> term').
  Context (g : list (BasicAst.context_decl term) -> list (BasicAst.context_decl term')).
  Definition map_branch_k k (b : branch term) :=
  {| bcontext := g b.(bcontext);
     bbody := f (#|b.(bcontext)| + k) b.(bbody) |}.
End map_branch_k.

Notation map_branches_k f h k brs :=
  (List.map (map_branch_k f h k) brs).

Notation test_branches_k p test k brs :=
  (List.forallb (test_branch_k p test k) brs).

Inductive term :=
| tRel (n : nat)
| tVar (i : ident)
| tEvar (n : nat) (l : list term)
| tSort (u : Universe.t)
| tProd (na : aname) (A B : term)
| tLambda (na : aname) (A t : term)
| tLetIn (na : aname) (b B t : term)
| tApp (u v : term)
| tConst (k : kername) (ui : Instance.t)
| tInd (ind : inductive) (ui : Instance.t)
| tConstruct (ind : inductive) (n : nat) (ui : Instance.t)
| tCase (indn : case_info) (p : predicate term) (c : term) (brs : list (branch term))
| tProj (p : projection) (c : term)
| tFix (mfix : mfixpoint term) (idx : nat)
| tCoFix (mfix : mfixpoint term) (idx : nat)
| tPrim (prim : prim_val term).

Fixpoint mkApps t us :=
  match us with
  | nil => t
  | u :: us => mkApps (tApp t u) us
  end.

Definition isLambda t :=
  match t with
  | tLambda _ _ _ => true
  | _ => false
  end.

Fixpoint lift n k t : term :=
  match t with
  | tRel i => tRel (if Nat.leb k i then (n + i) else i)
  | tEvar ev args => tEvar ev (List.map (lift n k) args)
  | tLambda na T M => tLambda na (lift n k T) (lift n (S k) M)
  | tApp u v => tApp (lift n k u) (lift n k v)
  | tProd na A B => tProd na (lift n k A) (lift n (S k) B)
  | tLetIn na b t b' => tLetIn na (lift n k b) (lift n k t) (lift n (S k) b')
  | tCase ind p c brs =>
    let p' := map_predicate_k id (lift n) k p in
    let brs' := map_branches_k (lift n) id k brs in
    tCase ind p' (lift n k c) brs'
  | tProj p c => tProj p (lift n k c)
  | tFix mfix idx =>
    let k' := List.length mfix + k in
    let mfix' := List.map (map_def (lift n k) (lift n k')) mfix in
    tFix mfix' idx
  | tCoFix mfix idx =>
    let k' := List.length mfix + k in
    let mfix' := List.map (map_def (lift n k) (lift n k')) mfix in
    tCoFix mfix' idx
  | x => x
  end.

Notation lift0 n := (lift n 0).

Fixpoint subst s k u :=
  match u with
  | tRel n =>
    if Nat.leb k n then
      match nth_error s (n - k) with
      | Some b => lift0 k b
      | None => tRel (n - List.length s)
      end
    else tRel n
  | tEvar ev args => tEvar ev (List.map (subst s k) args)
  | tLambda na T M => tLambda na (subst s k T) (subst s (S k) M)
  | tApp u v => tApp (subst s k u) (subst s k v)
  | tProd na A B => tProd na (subst s k A) (subst s (S k) B)
  | tLetIn na b ty b' => tLetIn na (subst s k b) (subst s k ty) (subst s (S k) b')
  | tCase ind p c brs =>
    let p' := map_predicate_k id (subst s) k p in
    let brs' := map_branches_k (subst s) id k brs in
    tCase ind p' (subst s k c) brs'
  | tProj p c => tProj p (subst s k c)
  | tFix mfix idx =>
    let k' := List.length mfix + k in
    let mfix' := List.map (map_def (subst s k) (subst s k')) mfix in
    tFix mfix' idx
  | tCoFix mfix idx =>
    let k' := List.length mfix + k in
    let mfix' := List.map (map_def (subst s k) (subst s k')) mfix in
    tCoFix mfix' idx
  | x => x
  end.

Notation subst0 t := (subst t 0).
Definition subst1 t k u := subst [t] k u.
Notation subst10 t := (subst1 t 0).
Notation "M { j := N }" := (subst1 N j M) (at level 10, right associativity).

Fixpoint closedn k (t : term) : bool :=
  match t with
  | tRel i => Nat.ltb i k
  | tEvar ev args => List.forallb (closedn k) args
  | tLambda _ T M | tProd _ T M => closedn k T && closedn (S k) M
  | tApp u v => closedn k u && closedn k v
  | tLetIn na b t b' => closedn k b && closedn k t && closedn (S k) b'
  | tCase ind p c brs =>
    let p' := test_predicate_k (fun _ => true) closedn k p in
    let brs' := test_branches_k p closedn k brs in
    p' && closedn k c && brs'
  | tProj p c => closedn k c
  | tFix mfix idx =>
    let k' := List.length mfix + k in
    List.forallb (test_def (closedn k) (closedn k')) mfix
  | tCoFix mfix idx =>
    let k' := List.length mfix + k in
    List.forallb (test_def (closedn k) (closedn k')) mfix
  | _ => true
  end.

Fixpoint noccur_between k n (t : term) : bool :=
  match t with
  | tRel i => Nat.ltb i k || Nat.leb (k + n) i
  | tEvar ev args => List.forallb (noccur_between k n) args
  | tLambda _ T M | tProd _ T M => noccur_between k n T && noccur_between (S k) n M
  | tApp u v => noccur_between k n u && noccur_between k n v
  | tLetIn na b t b' => noccur_between k n b && noccur_between k n t && noccur_between (S k) n b'
  | tCase ind p c brs =>
    let p' := test_predicate_k (fun _ => true) (fun k' => noccur_between k' n) k p in
    let brs' := test_branches_k p (fun k => noccur_between k n) k brs in
    p' && noccur_between k n c && brs'
  | tProj p c => noccur_between k n c
  | tFix mfix idx =>
    let k' := List.length mfix + k in
    List.forallb (test_def (noccur_between k n) (noccur_between k' n)) mfix
  | tCoFix mfix idx =>
    let k' := List.length mfix + k in
    List.forallb (test_def (noccur_between k n) (noccur_between k' n)) mfix
  | _ => true
  end.
#[global]
Instance subst_instance_constr : UnivSubst term.
Admitted.

Module PCUICTerm <: Term.

  Definition term := term.

  Definition tRel := tRel.
  Definition tSort := tSort.
  Definition tProd := tProd.
  Definition tLambda := tLambda.
  Definition tLetIn := tLetIn.
  Definition tInd := tInd.
  Definition tProj := tProj.
  Definition mkApps := mkApps.

  Definition lift := lift.
  Definition subst := subst.
  Definition closedn := closedn.
  Definition noccur_between := noccur_between.
  Definition subst_instance_constr := subst_instance.
End PCUICTerm.

Module PCUICEnvironment := Environment PCUICTerm.
Export PCUICEnvironment.

Fixpoint destArity Γ (t : term) :=
  match t with
  | tProd na t b => destArity (Γ ,, vass na t) b
  | tLetIn na b b_ty b' => destArity (Γ ,, vdef na b b_ty) b'
  | tSort s => Some (Γ, s)
  | _ => None
  end.

Definition inds ind u (l : list one_inductive_body) :=
  let fix aux n :=
      match n with
      | 0 => []
      | S n => tInd (mkInd ind n) u :: aux n
      end
  in aux (List.length l).

Module PCUICTermUtils <: TermUtils PCUICTerm PCUICEnvironment.

Definition destArity := destArity.
Definition inds := inds.

End PCUICTermUtils.

Module PCUICEnvTyping := EnvironmentTyping.EnvTyping PCUICTerm PCUICEnvironment PCUICTermUtils.

Module PCUICConversion := EnvironmentTyping.Conversion PCUICTerm PCUICEnvironment PCUICTermUtils PCUICEnvTyping.

Module PCUICLookup := EnvironmentTyping.Lookup PCUICTerm PCUICEnvironment.
Include PCUICLookup.

Module PCUICGlobalMaps := EnvironmentTyping.GlobalMaps
  PCUICTerm
  PCUICEnvironment
  PCUICTermUtils
  PCUICEnvTyping
  PCUICConversion
  PCUICLookup
.

Fixpoint decompose_app_rec (t : term) l :=
  match t with
  | tApp f a => decompose_app_rec f (a :: l)
  | _ => (t, l)
  end.

Definition decompose_app t := decompose_app_rec t [].

Definition isConstruct_app t :=
  match fst (decompose_app t) with
  | tConstruct _ _ _ => true
  | _ => false
  end.
Fixpoint decompose_prod_assum (Γ : context) (t : term) : context * term.
Admitted.

Coercion ci_ind : case_info >-> inductive.

Definition ind_predicate_context ind mdecl idecl : context :=
  let ictx := (expand_lets_ctx mdecl.(ind_params) idecl.(ind_indices)) in
  let indty := mkApps (tInd ind (abstract_instance mdecl.(ind_universes)))
    (to_extended_list (smash_context [] mdecl.(ind_params) ,,, ictx)) in
  let inddecl :=
    {| decl_name :=
      {| binder_name := nNamed (ind_name idecl); binder_relevance := idecl.(ind_relevance) |};
       decl_body := None;
       decl_type := indty |}
  in (inddecl :: ictx).

Definition inst_case_context params puinst (pctx : context) :=
  subst_context (List.rev params) 0 (subst_instance puinst pctx).

Definition inst_case_predicate_context (p : predicate term) :=
  inst_case_context p.(pparams) p.(puinst) p.(pcontext).

Definition inst_case_branch_context (p : predicate term) (br : branch term) :=
  inst_case_context p.(pparams) p.(puinst) br.(bcontext).

Definition iota_red npar p args br :=
  subst (List.rev (List.skipn npar args)) 0
    (expand_lets (inst_case_branch_context p br) (bbody br)).

Definition pre_case_predicate_context_gen ind mdecl idecl params puinst : context :=
  inst_case_context params puinst (ind_predicate_context ind mdecl idecl).

Definition case_predicate_context_gen ind mdecl idecl params puinst pctx :=
  map2 set_binder_name pctx (pre_case_predicate_context_gen ind mdecl idecl params puinst).

Definition case_predicate_context ind mdecl idecl p : context :=
  case_predicate_context_gen ind mdecl idecl p.(pparams) p.(puinst) (forget_types p.(pcontext)).

Definition cstr_branch_context ind mdecl cdecl : context :=
  expand_lets_ctx mdecl.(ind_params)
    (subst_context (inds (inductive_mind ind) (abstract_instance mdecl.(ind_universes))
       mdecl.(ind_bodies)) #|mdecl.(ind_params)|
      cdecl.(cstr_args)).

Definition pre_case_branch_context_gen ind mdecl cdecl params puinst : context :=
  inst_case_context params puinst (cstr_branch_context ind mdecl cdecl).

Definition case_branch_context_gen ind mdecl params puinst pctx cdecl :=
  map2 set_binder_name pctx (pre_case_branch_context_gen ind mdecl cdecl params puinst).

Definition case_branch_type_gen ind mdecl (idecl : one_inductive_body) params puinst bctx ptm i cdecl : context * term :=
  let cstr := tConstruct ind i puinst in
  let args := to_extended_list cdecl.(cstr_args) in
  let cstrapp := mkApps cstr (map (lift0 #|cdecl.(cstr_args)|) params ++ args) in
  let brctx := case_branch_context_gen ind mdecl params puinst bctx cdecl in
  let upars := subst_instance puinst mdecl.(ind_params) in
  let indices :=
    (map (subst (List.rev params) #|cdecl.(cstr_args)|)
      (map (expand_lets_k upars #|cdecl.(cstr_args)|)
        (map (subst (inds (inductive_mind ind) puinst mdecl.(ind_bodies))
                    (#|mdecl.(ind_params)| + #|cdecl.(cstr_args)|))
          (map (subst_instance puinst) cdecl.(cstr_indices))))) in
  let ty := mkApps (lift0 #|cdecl.(cstr_args)| ptm) (indices ++ [cstrapp]) in
  (brctx, ty).

Definition case_branch_type ind mdecl idecl p (b : branch term) ptm i cdecl : context * term :=
  case_branch_type_gen ind mdecl idecl p.(pparams) p.(puinst) (forget_types b.(bcontext)) ptm i cdecl.

Definition idecl_binder idecl :=
  {| decl_name :=
    {| binder_name := nNamed idecl.(ind_name);
        binder_relevance := idecl.(ind_relevance) |};
     decl_body := None;
     decl_type := idecl.(ind_type) |}.

Definition wf_predicate_gen mdecl idecl (pparams : list term) (pcontext : list aname) : Prop :=
  let decl := idecl_binder idecl in
  (#|pparams| = mdecl.(ind_npars)) /\
  (Forall2 (fun na decl => eq_binder_annot na decl.(decl_name))
    pcontext (decl :: idecl.(ind_indices))).

Definition wf_predicate mdecl idecl (p : predicate term) : Prop :=
  wf_predicate_gen mdecl idecl p.(pparams) (forget_types p.(pcontext)).

Definition wf_branch_gen cdecl (bctx : list aname) : Prop :=
  (Forall2 (fun na decl => eq_binder_annot na decl.(decl_name))
    bctx cdecl.(cstr_args)).

Definition wf_branch cdecl (b : branch term) : Prop :=
  wf_branch_gen cdecl (forget_types b.(bcontext)).

Definition wf_branches idecl (brs : list (branch term)) : Prop :=
  Forall2 wf_branch idecl.(ind_ctors) brs.

Definition fix_subst (l : mfixpoint term) :=
  let fix aux n :=
      match n with
      | 0 => []
      | S n => tFix l n :: aux n
      end
  in aux (List.length l).

Definition unfold_fix (mfix : mfixpoint term) (idx : nat) :=
  match List.nth_error mfix idx with
  | Some d => Some (d.(rarg), subst0 (fix_subst mfix) d.(dbody))
  | None => None
  end.

Definition cofix_subst (l : mfixpoint term) :=
  let fix aux n :=
      match n with
      | 0 => []
      | S n => tCoFix l n :: aux n
      end
  in aux (List.length l).

Definition unfold_cofix (mfix : mfixpoint term) (idx : nat) :=
  match List.nth_error mfix idx with
  | Some d => Some (d.(rarg), subst0 (cofix_subst mfix) d.(dbody))
  | None => None
  end.

Definition is_constructor n ts :=
  match List.nth_error ts n with
  | Some a => isConstruct_app a
  | None => false
  end.
Import MetaCoq.Common.config.

Ltac pcuic :=
  try repeat red; cbn in *;
   try (solve [ intuition auto; eauto with pcuic || (try lia || congruence) ]).

Definition R_universe_instance R :=
  fun u u' => Forall2 R (List.map Universe.make u) (List.map Universe.make u').

Definition R_universe_variance (Re Rle : Universe.t -> Universe.t -> Prop) v u u' :=
  match v with
  | Variance.Irrelevant => True
  | Variance.Covariant => Rle (Universe.make u) (Universe.make u')
  | Variance.Invariant => Re (Universe.make u) (Universe.make u')
  end.

Fixpoint R_universe_instance_variance Re Rle v u u' :=
  match u, u' return Prop with
  | u :: us, u' :: us' =>
    match v with
    | [] => R_universe_instance_variance Re Rle v us us'

    | v :: vs => R_universe_variance Re Rle v u u' /\
        R_universe_instance_variance Re Rle vs us us'
    end
  | [], [] => True
  | _, _ => False
  end.

Definition global_variance_gen lookup gr napp :=
  match gr with
  | IndRef ind =>
    match lookup_inductive_gen lookup ind with
    | Some (mdecl, idecl) =>
      match destArity [] idecl.(ind_type) with
      | Some (ctx, _) => if (context_assumptions ctx) <=? napp then mdecl.(ind_variance)
        else None
      | None => None
      end
    | None => None
    end
  | ConstructRef ind k =>
    match lookup_constructor_gen lookup ind k with
    | Some (mdecl, idecl, cdecl) =>
      if (cdecl.(cstr_arity) + mdecl.(ind_npars))%nat <=? napp then

        Some []
      else None
    | _ => None
    end
  | _ => None
  end.

Definition R_opt_variance Re Rle v :=
  match v with
  | Some v => R_universe_instance_variance Re Rle v
  | None => R_universe_instance Re
  end.

Definition R_global_instance_gen Σ Re Rle gr napp :=
  R_opt_variance Re Rle (global_variance_gen Σ gr napp).

Notation R_global_instance Σ := (R_global_instance_gen (lookup_env Σ)).

Section compare_decls.

  Context {eq_term leq_term : term -> term -> Type}.
  Inductive compare_decls  : context_decl -> context_decl -> Type :=
  | compare_vass {na T na' T'} :
    eq_binder_annot na na' ->
    leq_term T T' ->
    compare_decls (vass na T) (vass na' T')
  | compare_vdef {na b T na' b' T'} :
    eq_binder_annot na na' ->
    eq_term b b' ->
    leq_term T T' ->
    compare_decls (vdef na b T) (vdef na' b' T').
End compare_decls.
Arguments compare_decls : clear implicits.

Notation eq_context_upto_names := (All2 (compare_decls eq eq)).

Notation eq_context_gen eq_term leq_term :=
  (All2_fold (fun _ _ => compare_decls eq_term leq_term)).

Definition eq_predicate (eq_term : term -> term -> Type) Re p p' :=
  All2 eq_term p.(pparams) p'.(pparams) *
  (R_universe_instance Re p.(puinst) p'.(puinst) *
  ((eq_context_gen eq eq p.(pcontext) p'.(pcontext)) *
    eq_term p.(preturn) p'.(preturn))).

Reserved Notation " Σ ⊢ t <==[ Rle , napp ] u" (at level 50, t, u at next level,
  format "Σ  ⊢  t  <==[ Rle , napp ]  u").

Inductive eq_term_upto_univ_napp Σ (Re Rle : Universe.t -> Universe.t -> Prop) (napp : nat) : term -> term -> Type :=
| eq_Rel : forall n,
    Σ ⊢ tRel n <==[ Rle , napp ] tRel n

| eq_Evar : forall e args args',
    All2 (eq_term_upto_univ_napp Σ Re Re 0) args args' ->
    Σ ⊢ tEvar e args <==[ Rle , napp ] tEvar e args'

| eq_Var : forall id,
    Σ ⊢ tVar id <==[ Rle , napp ] tVar id

| eq_Sort : forall s s',
    Rle s s' ->
    Σ ⊢ tSort s  <==[ Rle , napp ] tSort s'

| eq_App : forall t t' u u',
    Σ ⊢ t <==[ Rle , S napp ] t' ->
    Σ ⊢ u <==[ Re , 0 ] u' ->
    Σ ⊢ tApp t u <==[ Rle , napp ] tApp t' u'

| eq_Const : forall c u u',
    R_universe_instance Re u u' ->
    Σ ⊢ tConst c u <==[ Rle , napp ] tConst c u'

| eq_Ind : forall i u u',
    R_global_instance Σ Re Rle (IndRef i) napp u u' ->
    Σ ⊢ tInd i u <==[ Rle , napp ] tInd i u'

| eq_Construct : forall i k u u',
    R_global_instance Σ Re Rle (ConstructRef i k) napp u u' ->
    Σ ⊢ tConstruct i k u <==[ Rle , napp ] tConstruct i k u'

| eq_Lambda : forall na na' ty ty' t t',
    eq_binder_annot na na' ->
    Σ ⊢ ty <==[ Re , 0 ] ty' ->
    Σ ⊢ t <==[ Rle , 0 ] t' ->
    Σ ⊢ tLambda na ty t <==[ Rle , napp ] tLambda na' ty' t'

| eq_Prod : forall na na' a a' b b',
    eq_binder_annot na na' ->
    Σ ⊢ a <==[ Re , 0 ] a' ->
    Σ ⊢ b <==[ Rle , 0 ] b' ->
    Σ ⊢ tProd na a b <==[ Rle , napp ] tProd na' a' b'

| eq_LetIn : forall na na' t t' ty ty' u u',
    eq_binder_annot na na' ->
    Σ ⊢ t <==[ Re , 0 ] t' ->
    Σ ⊢ ty <==[ Re , 0 ] ty' ->
    Σ ⊢ u <==[ Rle , 0 ] u' ->
    Σ ⊢ tLetIn na t ty u <==[ Rle , napp ] tLetIn na' t' ty' u'

| eq_Case : forall indn p p' c c' brs brs',
    eq_predicate (eq_term_upto_univ_napp Σ Re Re 0) Re p p' ->
    Σ ⊢ c <==[ Re , 0 ] c' ->
    All2 (fun x y =>
      eq_context_gen eq eq (bcontext x) (bcontext y) *
      (Σ ⊢ x.(bbody) <==[ Re , 0 ] y.(bbody))
    ) brs brs' ->
    Σ ⊢ tCase indn p c brs <==[ Rle , napp ] tCase indn p' c' brs'

| eq_Proj : forall p c c',
    Σ ⊢ c <==[ Re , 0 ] c' ->
    Σ ⊢ tProj p c <==[ Rle , napp ] tProj p c'

| eq_Fix : forall mfix mfix' idx,
    All2 (fun x y =>
      (Σ ⊢ x.(dtype) <==[ Re , 0 ] y.(dtype)) *
      (Σ ⊢ x.(dbody) <==[ Re , 0 ] y.(dbody)) *
      (x.(rarg) = y.(rarg)) *
      eq_binder_annot x.(dname) y.(dname)
    )%type mfix mfix' ->
    Σ ⊢ tFix mfix idx <==[ Rle , napp ] tFix mfix' idx

| eq_CoFix : forall mfix mfix' idx,
    All2 (fun x y =>
      (Σ ⊢ x.(dtype) <==[ Re , 0 ] y.(dtype)) *
      (Σ ⊢ x.(dbody) <==[ Re , 0 ] y.(dbody)) *
      (x.(rarg) = y.(rarg)) *
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ⊢ tCoFix mfix idx <==[ Rle , napp ] tCoFix mfix' idx

| eq_Prim i : eq_term_upto_univ_napp Σ Re Rle napp (tPrim i) (tPrim i)
where " Σ ⊢ t <==[ Rle , napp ] u " := (eq_term_upto_univ_napp Σ _ Rle napp t u) : type_scope.

Notation eq_term_upto_univ Σ Re Rle := (eq_term_upto_univ_napp Σ Re Rle 0).

Definition compare_term `{checker_flags} (pb : conv_pb) Σ φ (t u : term) :=
  eq_term_upto_univ Σ (eq_universe φ) (compare_universe pb φ) t u.
Import Coq.ssr.ssrbool.

Definition shiftnP k p i :=
  (i <? k) || p (i - k).
Fixpoint on_free_vars (p : nat -> bool) (t : term) : bool.
Admitted.

Definition on_free_vars_decl P d :=
  test_decl (on_free_vars P) d.

Definition on_free_vars_ctx P ctx :=
  alli (fun k => (on_free_vars_decl (shiftnP k P))) 0 (List.rev ctx).

Notation is_open_term Γ := (on_free_vars (shiftnP #|Γ| xpred0)).
Notation is_closed_context := (on_free_vars_ctx xpred0).
Definition set_preturn (p : predicate term) (pret' : term) : predicate term.
Admitted.
Definition set_pparams (p : predicate term) (pars' : list term) : predicate term.
Admitted.

Module Export PCUICCumulativitySpec.

Implicit Types (cf : checker_flags).

Definition cumul_predicate (cumul : context -> term -> term -> Type) Γ Re p p' :=
  All2 (cumul Γ) p.(pparams) p'.(pparams) *
  (R_universe_instance Re p.(puinst) p'.(puinst) *
  ((eq_context_gen eq eq p.(pcontext) p'.(pcontext)) *
    cumul (Γ ,,, inst_case_predicate_context p) p.(preturn) p'.(preturn))).

Reserved Notation " Σ ;;; Γ ⊢ t ≤s[ pb ] u" (at level 50, Γ, t, u at next level,
  format "Σ  ;;;  Γ  ⊢  t  ≤s[ pb ]  u").

Definition cumul_Ind_univ {cf} (Σ : global_env_ext) pb i napp :=
  R_global_instance Σ (eq_universe Σ) (compare_universe pb Σ) (IndRef i) napp.

Definition cumul_Construct_univ {cf} (Σ : global_env_ext) pb  i k napp :=
  R_global_instance Σ (eq_universe Σ) (compare_universe pb Σ) (ConstructRef i k) napp.
Inductive cumulSpec0 {cf : checker_flags} (Σ : global_env_ext) Γ (pb : conv_pb) : term -> term -> Type :=

| cumul_Trans : forall t u v,
    is_closed_context Γ -> is_open_term Γ u ->
    Σ ;;; Γ ⊢ t ≤s[pb] u ->
    Σ ;;; Γ ⊢ u ≤s[pb] v ->
    Σ ;;; Γ ⊢ t ≤s[pb] v

| cumul_Sym : forall t u,
    Σ ;;; Γ ⊢ t ≤s[Conv] u ->
    Σ ;;; Γ ⊢ u ≤s[pb] t

| cumul_Refl : forall t,
    Σ ;;; Γ ⊢ t ≤s[pb] t

| cumul_Ind : forall i u u' args args',
    cumul_Ind_univ Σ pb i #|args| u u' ->
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ mkApps (tInd i u) args ≤s[pb] mkApps (tInd i u') args'

| cumul_Construct : forall i k u u' args args',
    cumul_Construct_univ Σ pb i k #|args| u u' ->
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ mkApps (tConstruct i k u) args ≤s[pb] mkApps (tConstruct i k u') args'

| cumul_Sort : forall s s',
    compare_universe pb Σ s s' ->
    Σ ;;; Γ ⊢ tSort s ≤s[pb] tSort s'

| cumul_Const : forall c u u',
    R_universe_instance (compare_universe Conv Σ) u u' ->
    Σ ;;; Γ ⊢ tConst c u ≤s[pb] tConst c u'

| cumul_Evar : forall e args args',
    All2 (fun t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) args args' ->
    Σ ;;; Γ ⊢ tEvar e args ≤s[pb] tEvar e args'

| cumul_App : forall t t' u u',
    Σ ;;; Γ ⊢ t ≤s[pb] t' ->
    Σ ;;; Γ ⊢ u ≤s[Conv] u' ->
    Σ ;;; Γ ⊢ tApp t u ≤s[pb] tApp t' u'

| cumul_Lambda : forall na na' ty ty' t t',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ ty ≤s[Conv] ty' ->
    Σ ;;; Γ ,, vass na ty ⊢ t ≤s[pb] t' ->
    Σ ;;; Γ ⊢ tLambda na ty t ≤s[pb] tLambda na' ty' t'

| cumul_Prod : forall na na' a a' b b',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ a ≤s[Conv] a' ->
    Σ ;;; Γ ,, vass na a ⊢ b ≤s[pb] b' ->
    Σ ;;; Γ ⊢ tProd na a b ≤s[pb] tProd na' a' b'

| cumul_LetIn : forall na na' t t' ty ty' u u',
    eq_binder_annot na na' ->
    Σ ;;; Γ ⊢ t ≤s[Conv] t' ->
    Σ ;;; Γ ⊢ ty ≤s[Conv] ty' ->
    Σ ;;; Γ ,, vdef na t ty ⊢ u ≤s[pb] u' ->
    Σ ;;; Γ ⊢ tLetIn na t ty u ≤s[pb] tLetIn na' t' ty' u'

| cumul_Case indn : forall p p' c c' brs brs',
    cumul_predicate (fun Γ t u => Σ ;;; Γ ⊢ t ≤s[Conv] u) Γ (compare_universe Conv Σ) p p' ->
    Σ ;;; Γ ⊢ c ≤s[Conv] c' ->
    All2 (fun br br' =>
      eq_context_gen eq eq (bcontext br) (bcontext br') ×
      Σ ;;; Γ ,,, inst_case_branch_context p br ⊢ bbody br ≤s[Conv] bbody br'
    ) brs brs' ->
    Σ ;;; Γ ⊢ tCase indn p c brs ≤s[pb] tCase indn p' c' brs'

| cumul_Proj : forall p c c',
    Σ ;;; Γ ⊢ c ≤s[Conv] c' ->
    Σ ;;; Γ ⊢ tProj p c ≤s[pb] tProj p c'

| cumul_Fix : forall mfix mfix' idx,
    All2 (fun x y =>
      Σ ;;; Γ ⊢ x.(dtype) ≤s[Conv] y.(dtype) ×
      Σ ;;; Γ ,,, fix_context mfix ⊢ x.(dbody) ≤s[Conv] y.(dbody) ×
      (x.(rarg) = y.(rarg)) ×
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ;;; Γ ⊢ tFix mfix idx ≤s[pb] tFix mfix' idx

| cumul_CoFix : forall mfix mfix' idx,
    All2 (fun x y =>
      Σ ;;; Γ ⊢ x.(dtype) ≤s[Conv] y.(dtype) ×
      Σ ;;; Γ ,,, fix_context mfix ⊢ x.(dbody) ≤s[Conv] y.(dbody) ×
      (x.(rarg) = y.(rarg)) ×
      eq_binder_annot x.(dname) y.(dname)
    ) mfix mfix' ->
    Σ ;;; Γ ⊢ tCoFix mfix idx ≤s[pb] tCoFix mfix' idx

| cumul_beta : forall na t b a,
    Σ ;;; Γ ⊢ tApp (tLambda na t b) a ≤s[pb] b {0 := a}

| cumul_zeta : forall na b t b',
    Σ ;;; Γ ⊢ tLetIn na b t b' ≤s[pb] b' {0 := b}

| cumul_rel i body :
    option_map decl_body (nth_error Γ i) = Some (Some body) ->
    Σ ;;; Γ ⊢ tRel i ≤s[pb] lift0 (S i) body

| cumul_iota : forall ci c u args p brs br,
    nth_error brs c = Some br ->
    #|args| = (ci.(ci_npar) + context_assumptions br.(bcontext))%nat ->
    Σ ;;; Γ ⊢ tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs  ≤s[pb] iota_red ci.(ci_npar) p args br

| cumul_fix : forall mfix idx args narg fn,
    unfold_fix mfix idx = Some (narg, fn) ->
    is_constructor narg args = true ->
    Σ ;;; Γ ⊢ mkApps (tFix mfix idx) args ≤s[pb] mkApps fn args

| cumul_cofix_case : forall ip p mfix idx args narg fn brs,
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ ⊢ tCase ip p (mkApps (tCoFix mfix idx) args) brs ≤s[pb] tCase ip p (mkApps fn args) brs

| cumul_cofix_proj : forall p mfix idx args narg fn,
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ ⊢ tProj p (mkApps (tCoFix mfix idx) args) ≤s[pb] tProj p (mkApps fn args)

| cumul_delta : forall c decl body (isdecl : declared_constant Σ c decl) u,
    decl.(cst_body) = Some body ->
    Σ ;;; Γ ⊢ tConst c u ≤s[pb] body@[u]

| cumul_proj : forall p args u arg,
    nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg ->
    Σ ;;; Γ ⊢ tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args) ≤s[pb] arg

where " Σ ;;; Γ ⊢ t ≤s[ pb ] u " := (@cumulSpec0 _ Σ Γ pb t u) : type_scope.
Definition cumulSpec `{checker_flags} (Σ : global_env_ext) Γ := cumulSpec0 Σ Γ Cumul.

Notation " Σ ;;; Γ |- t <=s u " := (@cumulSpec _ Σ Γ t u) (at level 50, Γ, t, u at next level).

Module PCUICConversionParSpec <: EnvironmentTyping.ConversionParSig PCUICTerm PCUICEnvironment PCUICTermUtils PCUICEnvTyping.
  Definition cumul_gen := @cumulSpec0.
End PCUICConversionParSpec.

End PCUICCumulativitySpec.

Reserved Notation " Σ ;;; Γ |- t ⇝ u " (at level 50, Γ, t, u at next level).

Inductive red1 (Σ : global_env) (Γ : context) : term -> term -> Type :=

| red_beta na t b a :
  Σ ;;; Γ |- tApp (tLambda na t b) a ⇝ b {0 := a}

| red_zeta na b t b' :
  Σ ;;; Γ |- tLetIn na b t b' ⇝ b' {0 := b}

| red_rel i body :
    option_map decl_body (nth_error Γ i) = Some (Some body) ->
    Σ ;;; Γ |- tRel i ⇝ lift0 (S i) body

| red_iota ci c u args p brs br :
    nth_error brs c = Some br ->
    #|args| = (ci.(ci_npar) + context_assumptions br.(bcontext))%nat ->
    Σ ;;; Γ |- tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs
        ⇝ iota_red ci.(ci_npar) p args br

| red_fix mfix idx args narg fn :
    unfold_fix mfix idx = Some (narg, fn) ->
    is_constructor narg args = true ->
    Σ ;;; Γ |- mkApps (tFix mfix idx) args ⇝ mkApps fn args

| red_cofix_case ip p mfix idx args narg fn brs :
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ |- tCase ip p (mkApps (tCoFix mfix idx) args) brs ⇝
         tCase ip p (mkApps fn args) brs

| red_cofix_proj p mfix idx args narg fn :
    unfold_cofix mfix idx = Some (narg, fn) ->
    Σ ;;; Γ |- tProj p (mkApps (tCoFix mfix idx) args) ⇝ tProj p (mkApps fn args)

| red_delta c decl body (isdecl : declared_constant Σ c decl) u :
    decl.(cst_body) = Some body ->
    Σ ;;; Γ |- tConst c u ⇝ subst_instance u body

| red_proj p args u arg:
    nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg ->
    Σ ;;; Γ |- tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args) ⇝ arg

| abs_red_l na M M' N : Σ ;;; Γ |- M ⇝ M' -> Σ ;;; Γ |- tLambda na M N ⇝ tLambda na M' N
| abs_red_r na M M' N : Σ ;;; Γ ,, vass na N |- M ⇝ M' -> Σ ;;; Γ |- tLambda na N M ⇝ tLambda na N M'

| letin_red_def na b t b' r : Σ ;;; Γ |- b ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na r t b'
| letin_red_ty na b t b' r : Σ ;;; Γ |- t ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na b r b'
| letin_red_body na b t b' r : Σ ;;; Γ ,, vdef na b t |- b' ⇝ r -> Σ ;;; Γ |- tLetIn na b t b' ⇝ tLetIn na b t r

| case_red_param ci p params' c brs :
    OnOne2 (fun t u => Σ ;;; Γ |- t ⇝ u) p.(pparams) params' ->
    Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci (set_pparams p params') c brs

| case_red_return ci p preturn' c brs :
  Σ ;;; Γ ,,, inst_case_predicate_context p |- p.(preturn) ⇝ preturn' ->
  Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci (set_preturn p preturn') c brs

| case_red_discr ci p c c' brs :
  Σ ;;; Γ |- c ⇝ c' -> Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci p c' brs

| case_red_brs ci p c brs brs' :
    OnOne2 (fun br br' =>
      on_Trel_eq (fun t u => Σ ;;; Γ ,,, inst_case_branch_context p br |- t ⇝ u) bbody bcontext br br')
      brs brs' ->
    Σ ;;; Γ |- tCase ci p c brs ⇝ tCase ci p c brs'

| proj_red p c c' : Σ ;;; Γ |- c ⇝ c' -> Σ ;;; Γ |- tProj p c ⇝ tProj p c'

| app_red_l M1 N1 M2 : Σ ;;; Γ |- M1 ⇝ N1 -> Σ ;;; Γ |- tApp M1 M2 ⇝ tApp N1 M2
| app_red_r M2 N2 M1 : Σ ;;; Γ |- M2 ⇝ N2 -> Σ ;;; Γ |- tApp M1 M2 ⇝ tApp M1 N2

| prod_red_l na M1 M2 N1 : Σ ;;; Γ |- M1 ⇝ N1 -> Σ ;;; Γ |- tProd na M1 M2 ⇝ tProd na N1 M2
| prod_red_r na M2 N2 M1 : Σ ;;; Γ ,, vass na M1 |- M2 ⇝ N2 ->
                           Σ ;;; Γ |- tProd na M1 M2 ⇝ tProd na M1 N2

| evar_red ev l l' : OnOne2 (fun t u => Σ ;;; Γ |- t ⇝ u) l l' -> Σ ;;; Γ |- tEvar ev l ⇝ tEvar ev l'

| fix_red_ty mfix0 mfix1 idx :
    OnOne2 (on_Trel_eq (fun t u => Σ ;;; Γ |- t ⇝ u) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 ->
    Σ ;;; Γ |- tFix mfix0 idx ⇝ tFix mfix1 idx

| fix_red_body 
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 4.0MiB file on GitHub Actions Artifacts under build.log)
ate-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.iWGRqQTsu6
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.idhPXMkwqN
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.Ab1IJJfTYs
MINIMIZER_DEBUG: files: 
make[4]: Nothing to be done for 'real-all'.
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.sUm54Za04Q
MINIMIZER_DEBUG: files: 
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make -f Makefile.plugin
make[3]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.rtHXqQ2uKo
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.MhmOmZaGla
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.X90YJPG7as
MINIMIZER_DEBUG: files: 
make[4]: Nothing to be done for 'real-all'.
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.sfjbumQfar
MINIMIZER_DEBUG: files: 
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make[2]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/template-coq'
make -C pcuic
make[2]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
make -f Makefile.coq
make[3]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin///coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.7ZeOJaY05T
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.Nl0tSq83H8
MINIMIZER_DEBUG: files: 
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig --print-version 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.YzCHxPwfI6
MINIMIZER_DEBUG: files: 
COQC theories/PCUICProgress.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/////coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -q -w -deprecated-native-compiler-option -native-compiler no -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/utils/theories MetaCoq.Utils -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/common/theories MetaCoq.Common -R /github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories MetaCoq.PCUIC theories/PCUICProgress.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.ahDiyrFSrp
MINIMIZER_DEBUG: files:  theories/PCUICProgress.v
File "./theories/PCUICProgress.v", line 108, characters 2-60:
Error: Cannot infer an instance of type
"Σ;;; Γ |- T : tSort s" for the variable HT in
environment:
cf : checker_flags
Σ : global_env × universes_decl
wfΣ : wf Σ.1
Γ : context
a : term
u : list term
s : Universe.t
f, T : term
IHu : forall (H : Σ;;; Γ |- mkApps (tApp f a) u : T)
        (HT : Σ;;; Γ |- T : tSort s),
      ∑
        (A : term) (Hf : Σ;;; Γ |- tApp f a : A) (s' : Universe.t) 
      (HA : Σ;;; Γ |- A : tSort s'),
        typing_size Hf <= typing_size H
        × typing_size HA <= Init.Nat.max (typing_size H) (typing_size HT)
          × typing_spine_pred Σ Γ
              (fun (x ty : term) (Hx : Σ;;; Γ |- x : ty) =>
               typing_size Hx <= typing_size H) A u T
Hf : Σ;;; Γ |- mkApps (tApp f a) u : T
Ht : Σ;;; Γ |- T : tSort s
X : forall HT : Σ;;; Γ |- T : tSort s,
    ∑
      (A : term) (Hf0 : Σ;;; Γ |- tApp f a : A) (s' : Universe.t) 
    (HA : Σ;;; Γ |- A : tSort s'),
      typing_size Hf0 <= typing_size Hf
      × typing_size HA <= Init.Nat.max (typing_size Hf) (typing_size HT)
        × typing_spine_pred Σ Γ
            (fun (x ty : term) (Hx : Σ;;; Γ |- x : ty) =>
             typing_size Hx <= typing_size Hf) A u T

Command exited with non-zero status 1
theories/PCUICProgress.vo (real: 3.91, user: 3.31, sys: 0.59, mem: 888468 ko)
Makefile.coq:809: recipe for target 'theories/PCUICProgress.vo' failed
make[4]: *** [theories/PCUICProgress.vo] Error 1
Makefile.coq:408: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
Makefile:11: recipe for target 'coq' failed
make[2]: *** [coq] Error 2
make[2]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic'
Makefile:142: recipe for target 'pcuic' failed
make[1]: *** [pcuic] Error 2
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/metacoq'
Makefile.ci:150: recipe for target 'ci-metacoq' failed
make: *** [ci-metacoq] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 208KiB file on GitHub Actions Artifacts under bug.log)

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[93mIntermediate code not saved.�[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:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[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 successful

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

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

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

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpzozan2rh/Top/bug_01.v", line 176, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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/tmpz0oj5q8t/Top/bug_01.v", line 179, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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 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/tmpzozan2rh/Top/bug_01.v", line 176, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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/tmpz0oj5q8t/Top/bug_01.v", line 179, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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 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

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmpzozan2rh/Top/bug_01.v", line 176, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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/tmpz0oj5q8t/Top/bug_01.v", line 179, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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/tmpzozan2rh/Top/bug_01.v", line 176, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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/tmpz0oj5q8t/Top/bug_01.v", line 179, characters 0-14:
Error: The field lift is missing in Top.bug_01.PCUICTerm.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[93mIntermediate code not saved.�[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:
Error: The module PCUIC, module MetaCoq and module
MetaCoq_DOT_PCUIC_DOT_PCUICTyping_WRAPPED need to be closed.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
File "/tmp/tmpxi95e6id/Top/bug_01.v", line 1194, characters 0-8:
Error:  (in proof inversion_mkApps): 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 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/tmpxi95e6id/Top/bug_01.v", line 1194, characters 0-8:
Error:  (in proof inversion_mkApps): 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

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 4, 2023

🔴 CI failures at commit 59b2ccd without any failure in the test-suite

✔️ Corresponding jobs for the base commit 65720db succeeded

❔ Ask me to try to extract minimal test cases that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following targets: ci-fiat_crypto_legacy, ci-math_classes, ci-metacoq, ci-vst
  • You can also pass me a specific list of targets to minimize as arguments.
  • If you tag me saying @coqbot ci minimize all, I will additionally minimize the following target (which I do not suggest minimizing): ci-fiat_crypto (because base job at 65720db failed)

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 5, 2023

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.v (from ci-perennial) (interrupted by timeout, being automatically continued) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 168KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-w" "-ssr-search-moved" "-w" "+deprecated-hint-without-locality" "-w" "+deprecated-instance-without-locality" "-w" "-future-coercion-class-field" "-w" "+deprecated-hint-rewrite-without-locality" "-w" "-deprecated-field-instance-without-locality" "-w" "+deprecated-tactic-notation" "-w" "-notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality" "-w" "-deprecated-native-compiler-option,-native-compiler-disabled" "-native-compiler" "ondemand" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/src" "Perennial" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp" "stdpp" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable" "stdpp.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris" "iris" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated" "iris.deprecated" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable" "iris.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang" "iris.heap_lang" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil" "coqutil" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose" "Goose" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src" "RecordUpdate" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src" "Tactical" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src" "iris_named_props" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Top.bug_01") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 1064 lines to 89 lines, then from 102 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 783 lines, then from 785 lines to 113 lines, then from 126 lines to 480 lines, then from 485 lines to 130 lines, then from 143 lines to 668 lines, then from 673 lines to 175 lines, then from 188 lines to 343 lines, then from 348 lines to 176 lines, then from 189 lines to 351 lines, then from 356 lines to 176 lines, then from 189 lines to 530 lines, then from 535 lines to 181 lines, then from 194 lines to 1498 lines, then from 1503 lines to 220 lines, then from 233 lines to 3895 lines, then from 3900 lines to 1287 lines, then from 1300 lines to 1388 lines, then from 1393 lines to 1387 lines, then from 1403 lines to 1292 lines, then from 1305 lines to 1446 lines, then from 1451 lines to 1355 lines, then from 1368 lines to 1535 lines, then from 1540 lines to 1441 lines, then from 1454 lines to 1590 lines, then from 1595 lines to 1475 lines, then from 1488 lines to 1743 lines, then from 1748 lines to 1640 lines, then from 1653 lines to 1762 lines, then from 1767 lines to 1667 lines, then from 1680 lines to 1836 lines, then from 1841 lines to 1760 lines, then from 1773 lines to 3174 lines, then from 3179 lines to 2669 lines, then from 2640 lines to 2175 lines, then from 2188 lines to 3115 lines, then from 3120 lines to 2364 lines, then from 2377 lines to 2565 lines, then from 2570 lines to 2369 lines, then from 2382 lines to 2644 lines, then from 2649 lines to 2431 lines, then from 2444 lines to 2426 lines, then from 2439 lines to 2561 lines, then from 2566 lines to 2426 lines, then from 2439 lines to 2953 lines, then from 2958 lines to 2443 lines, then from 2456 lines to 2744 lines, then from 2744 lines to 2464 lines, then from 2477 lines to 2601 lines, then from 2606 lines to 2590 lines, then from 2607 lines to 2466 lines, then from 2479 lines to 3195 lines, then from 3199 lines to 2533 lines, then from 2546 lines to 2838 lines, then from 2843 lines to 2571 lines, then from 2584 lines to 2782 lines, then from 2787 lines to 2576 lines, then from 2589 lines to 2655 lines, then from 2660 lines to 2600 lines, then from 2614 lines to 2596 lines, then from 2609 lines to 2786 lines, then from 2791 lines to 2645 lines, then from 2658 lines to 3073 lines, then from 3078 lines to 2667 lines, then from 2680 lines to 2943 lines, then from 2948 lines to 2675 lines, then from 2688 lines to 2794 lines, then from 2799 lines to 2743 lines, then from 2760 lines to 2686 lines, then from 2699 lines to 3085 lines, then from 3090 lines to 2717 lines, then from 2730 lines to 3464 lines, then from 3469 lines to 2738 lines, then from 2751 lines to 3509 lines, then from 3514 lines to 2798 lines, then from 2809 lines to 2775 lines, then from 2788 lines to 3127 lines, then from 3132 lines to 2810 lines, then from 2823 lines to 6068 lines, then from 6073 lines to 4637 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 6.009 sec *)
Require Coq.Init.Ltac.
Require Ltac2.Init.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Bool.
Require Ltac2.Array.
Require Ltac2.Char.
Require Ltac2.Constant.
Require Ltac2.Constr.
Require Ltac2.Constructor.
Require Ltac2.Std.
Require Ltac2.Env.
Require Ltac2.Evar.
Require Ltac2.Float.
Require Ltac2.List.
Require Ltac2.Fresh.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Ltac1.
Require Ltac2.Meta.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require Ltac2.Printf.
Require Ltac2.Proj.
Require Ltac2.String.
Require Ltac2.Uint63.
Require Ltac2.Notations.
Require Ltac2.Ltac2.
Require Coq.QArith.QArith_base.
Require Coq.QArith.Qcanon.
Require Coq.Sorting.Permutation.
Require Coq.Logic.EqdepFacts.
Require Coq.PArith.PArith.
Require Coq.NArith.NArith.
Require Coq.ZArith.ZArith.
Require Coq.Numbers.Natural.Peano.NPeano.
Require Coq.QArith.QArith.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Lists.List.
Require Coq.Bool.Bool.
Require Coq.Setoids.Setoid.
Require Coq.Init.Peano.
Require Coq.Unicode.Utf8.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require stdpp.options.
Require stdpp.base.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require Coq.micromega.Lia.
Require stdpp.tactics.
Require stdpp.option.
Require stdpp.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.well_founded.
Require stdpp.countable.
Require stdpp.vector.
Require stdpp.finite.
Require Coq.ssr.ssreflect.
Require stdpp.orders.
Require stdpp.sets.
Require stdpp.relations.
Require stdpp.fin_sets.
Require stdpp.listset.
Require stdpp.lexico.
Require stdpp.prelude.
Require iris.prelude.options.
Require iris.prelude.prelude.
Require iris.algebra.ofe.
Require iris.algebra.monoid.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.local_updates.
Require iris.algebra.proofmode_classes.
Require iris.algebra.frac.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require stdpp.functions.
Require Coq.Strings.Ascii.
Require Coq.Strings.String.
Require stdpp.strings.
Require stdpp.pretty.
Require stdpp.infinite.
Require stdpp.fin_maps.
Require stdpp.fin_map_dom.
Require stdpp.mapset.
Require stdpp.pmap.
Require stdpp.propset.
Require stdpp.gmap.
Require stdpp.gmultiset.
Require iris.algebra.big_op.
Require iris.algebra.view.
Require iris.algebra.auth.
Require iris.bi.notation.
Require iris.base_logic.upred.
Require stdpp.coPset.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.extensions.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
Require iris.algebra.list.
Require iris.algebra.gset.
Require iris.algebra.gmap.

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.

Module Export iris_DOT_bi_DOT_big_op_WRAPPED.
Module Export big_op.
Import stdpp.countable.
Import stdpp.fin_sets.
Import stdpp.functions.
Export iris.algebra.big_op.
Import iris.algebra.list.
Import iris.algebra.gmap.
Import iris.bi.derived_laws_later.
Import iris.prelude.options.
Import interface.bi.
Import derived_laws.bi.
Import derived_laws_later.bi.

 
Notation "'[∗' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_sep (λ k x, P%I) l) : bi_scope.
Notation "'[∗' 'list]' x ∈ l , P" :=
  (big_opL bi_sep (λ _ x, P%I) l) : bi_scope.
Notation "'[∗]' Ps" := (big_opL bi_sep (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∧' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_and (λ k x, P%I) l) : bi_scope.
Notation "'[∧' 'list]' x ∈ l , P" :=
  (big_opL bi_and (λ _ x, P%I) l) : bi_scope.
Notation "'[∧]' Ps" := (big_opL bi_and (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∨' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_or (λ k x, P%I) l) : bi_scope.
Notation "'[∨' 'list]' x ∈ l , P" :=
  (big_opL bi_or (λ _ x, P%I) l) : bi_scope.
Notation "'[∨]' Ps" := (big_opL bi_or (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∗' 'map]' k ↦ x ∈ m , P" := (big_opM bi_sep (λ k x, P%I) m) : bi_scope.
Notation "'[∗' 'map]' x ∈ m , P" := (big_opM bi_sep (λ _ x, P%I) m) : bi_scope.

Notation "'[∧' 'map]' k ↦ x ∈ m , P" := (big_opM bi_and (λ k x, P) m) : bi_scope.
Notation "'[∧' 'map]' x ∈ m , P" := (big_opM bi_and (λ _ x, P) m) : bi_scope.

Notation "'[∗' 'set]' x ∈ X , P" := (big_opS bi_sep (λ x, P%I) X) : bi_scope.

Notation "'[∗' 'mset]' x ∈ X , P" := (big_opMS bi_sep (λ x, P%I) X) : bi_scope.

 
 
Fixpoint big_sepL2 {PROP : bi} {A B}
    (Φ : nat → A → B → PROP) (l1 : list A) (l2 : list B) : PROP :=
  match l1, l2 with
  | [], [] => emp
  | x1 :: l1, x2 :: l2 => Φ 0 x1 x2 ∗ big_sepL2 (λ n, Φ (S n)) l1 l2
  | _, _ => False
  end%I.
Global Instance: Params (@big_sepL2) 3 := {}.
Global Arguments big_sepL2 {PROP A B} _ !_ !_ /.
Typeclasses Opaque big_sepL2.
Notation "'[∗' 'list]' k ↦ x1 ; x2 ∈ l1 ; l2 , P" :=
  (big_sepL2 (λ k x1 x2, P%I) l1 l2) : bi_scope.
Notation "'[∗' 'list]' x1 ; x2 ∈ l1 ; l2 , P" :=
  (big_sepL2 (λ _ x1 x2, P%I) l1 l2) : bi_scope.
Local Definition big_sepM2_def {PROP : bi} `{Countable K} {A B}
    (Φ : K → A → B → PROP) (m1 : gmap K A) (m2 : gmap K B) : PROP. exact ((⌜ ∀ k, is_Some (m1 !! k) ↔ is_Some (m2 !! k) ⌝ ∧
   [∗ map] k ↦ xy ∈ map_zip m1 m2, Φ k xy.1 xy.2)%I). Defined.
Local Definition big_sepM2_aux : seal (@big_sepM2_def).
Admitted.
Definition big_sepM2 := big_sepM2_aux.(unseal).
Global Arguments big_sepM2 {PROP K _ _ A B} _ _ _.
Local Definition big_sepM2_unseal : @big_sepM2 = _ := big_sepM2_aux.(seal_eq).
Global Instance: Params (@big_sepM2) 6 := {}.
Notation "'[∗' 'map]' k ↦ x1 ; x2 ∈ m1 ; m2 , P" :=
  (big_sepM2 (λ k x1 x2, P%I) m1 m2) : bi_scope.
Notation "'[∗' 'map]' x1 ; x2 ∈ m1 ; m2 , P" :=
  (big_sepM2 (λ _ x1 x2, P%I) m1 m2) : bi_scope.

 
Section big_op.
Context {PROP : bi}.
Implicit Types P Q : PROP.
Implicit Types Ps Qs : list PROP.
Implicit Types A : Type.

 
Section sep_list.
  Context {A : Type}.
  Implicit Types l : list A.
  Implicit Types Φ Ψ : nat → A → PROP.

  Lemma big_sepL_nil Φ : ([∗ list] k↦y ∈ nil, Φ k y) ⊣⊢ emp.
Admitted.
  Lemma big_sepL_nil' P `{!Affine P} Φ : P ⊢ [∗ list] k↦y ∈ nil, Φ k y.
Admitted.
  Lemma big_sepL_cons Φ x l :
    ([∗ list] k↦y ∈ x :: l, Φ k y) ⊣⊢ Φ 0 x ∗ [∗ list] k↦y ∈ l, Φ (S k) y.
Admitted.
  Lemma big_sepL_singleton Φ x : ([∗ list] k↦y ∈ [x], Φ k y) ⊣⊢ Φ 0 x.
Admitted.
  Lemma big_sepL_app Φ l1 l2 :
    ([∗ list] k↦y ∈ l1 ++ l2, Φ k y)
    ⊣⊢ ([∗ list] k↦y ∈ l1, Φ k y) ∗ ([∗ list] k↦y ∈ l2, Φ (length l1 + k) y).
Admitted.
  Lemma big_sepL_snoc Φ l x :
    ([∗ list] k↦y ∈ l ++ [x], Φ k y) ⊣⊢ ([∗ list] k↦y ∈ l, Φ k y) ∗ Φ (length l) x.
Admitted.

  Lemma big_sepL_take_drop Φ l n :
    ([∗ list] k ↦ x ∈ l, Φ k x) ⊣⊢
    ([∗ list] k ↦ x ∈ take n l, Φ k x) ∗ ([∗ list] k ↦ x ∈ drop n l, Φ (n + k) x).
Admitted.

  Lemma big_sepL_submseteq (Φ : A → PROP) `{!∀ x, Affine (Φ x)} l1 l2 :
    l1 ⊆+ l2 → ([∗ list] y ∈ l2, Φ y) ⊢ [∗ list] y ∈ l1, Φ y.
Admitted.

   
  Lemma big_sepL_mono Φ Ψ l :
    (∀ k y, l !! k = Some y → Φ k y ⊢ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y) ⊢ [∗ list] k ↦ y ∈ l, Ψ k y.
Admitted.
  Lemma big_sepL_ne Φ Ψ l n :
    (∀ k y, l !! k = Some y → Φ k y ≡{n}≡ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y)%I ≡{n}≡ ([∗ list] k ↦ y ∈ l, Ψ k y)%I.
Admitted.
  Lemma big_sepL_proper Φ Ψ l :
    (∀ k y, l !! k = Some y → Φ k y ⊣⊢ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y) ⊣⊢ ([∗ list] k ↦ y ∈ l, Ψ k y).
Admitted.

   
  Global Instance big_sepL_mono' :
    Proper (pointwise_relation _ (pointwise_relation _ (⊢)) ==> (=) ==> (⊢))
           (big_opL (@bi_sep PROP) (A:=A)).
Admitted.
  Global Instance big_sepL_id_mono' :
    Proper (Forall2 (⊢) ==> (⊢)) (big_opL (@bi_sep PROP) (λ _ P, P)).
Admitted.

  Global Instance big_sepL_nil_persistent Φ :
    Persistent ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_persistent Φ l :
    (∀ k x, Persistent (Φ k x)) → Persistent ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_persistent_id Ps :
    TCForall Persistent Ps → Persistent ([∗] Ps).
Admitted.

  Global Instance big_sepL_nil_affine Φ :
    Affine ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_affine Φ l :
    (∀ k x, Affine (Φ k x)) → Affine ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_affine_id Ps : TCForall Affine Ps → Affine ([∗] Ps).
Admitted.

  Global Instance big_sepL_nil_timeless `{!Timeless (emp%I : PROP)} Φ :
    Timeless ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_timeless `{!Timeless (emp%I : PROP)} Φ l :
    (∀ k x, Timeless (Φ k x)) → Timeless ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_timeless_id `{!Timeless (emp%I : PROP)} Ps :
    TCForall Timeless Ps → Timeless ([∗] Ps).
Admitted.

  Lemma big_sepL_emp l : ([∗ list] k↦y ∈ l, emp) ⊣⊢@{PROP} emp.
Admitted.

  Lemma big_sepL_insert_acc Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x ∗ (∀ y, Φ i y -∗ ([∗ list] k↦y ∈ <[i:=y]>l, Φ k y)).
Admitted.

  Lemma big_sepL_lookup_acc Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x ∗ (Φ i x -∗ ([∗ list] k↦y ∈ l, Φ k y)).
Admitted.

  Lemma big_sepL_lookup Φ l i x
    `{!TCOr (∀ j y, Affine (Φ j y)) (Absorbing (Φ i x))} :
    l !! i = Some x → ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x.
Admitted.

  Lemma big_sepL_elem_of (Φ : A → PROP) l x
    `{!TCOr (∀ y, Affine (Φ y)) (Absorbing (Φ x))} :
    x ∈ l → ([∗ list] y ∈ l, Φ y) ⊢ Φ x.
Admitted.

  Lemma big_sepL_fmap {B} (f : A → B) (Φ : nat → B → PROP) l :
    ([∗ list] k↦y ∈ f <$> l, Φ k y) ⊣⊢ ([∗ list] k↦y ∈ l, Φ k (f y)).
Admitted.

  Lemma big_sepL_omap {B} (f : A → option B) (Φ : B → PROP) l :
    ([∗ list] y ∈ omap f l, Φ y) ⊣⊢ ([∗ list] y ∈ l, from_option Φ emp (f y)).
Admitted.

  Lemma big_sepL_bind {B} (f : A → list B) (Φ : B → PROP) l :
    ([∗ list] y ∈ l ≫= f, Φ y) ⊣⊢ ([∗ list] x ∈ l, [∗ list] y ∈ f x, Φ y).
Admitted.

  Lemma big_sepL_sep Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x ∗ Ψ k x)
    ⊣⊢ ([∗ list] k↦x ∈ l, Φ k x) ∗ ([∗ list] k↦x ∈ l, Ψ k x).
Admitted.

  Lemma big_sepL_sep_2 Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    ([∗ list] k↦x ∈ l, Ψ k x) -∗
    ([∗ list] k↦x ∈ l, Φ k x ∗ Ψ k x).
Admitted.

  Lemma big_sepL_and Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x ∧ Ψ k x)
    ⊢ ([∗ list] k↦x ∈ l, Φ k x) ∧ ([∗ list] k↦x ∈ l, Ψ k x).
Admitted.

  Lemma big_sepL_pure_1 (φ : nat → A → Prop) l :
    ([∗ list] k↦x ∈ l, ⌜φ k x⌝) ⊢@{PROP} ⌜∀ k x, l !! k = Some x → φ k x⌝.
Admitted.
  Lemma big_sepL_affinely_pure_2 (φ : nat → A → Prop) l :
    <affine> ⌜∀ k x, l !! k = Some x → φ k x⌝ ⊢@{PROP} ([∗ list] k↦x ∈ l, <affine> ⌜φ k x⌝).
Admitted.
   
  Lemma big_sepL_pure `{!BiAffine PROP} (φ : nat → A → Prop) l :
    ([∗ list] k↦x ∈ l, ⌜φ k x⌝) ⊣⊢@{PROP} ⌜∀ k x, l !! k = Some x → φ k x⌝.
Admitted.

  Lemma big_sepL_persistently `{!BiAffine PROP} Φ l :
    <pers> ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ [∗ list] k↦x ∈ l, <pers> (Φ k x).
Admitted.

  Lemma big_sepL_intro Φ l :
    □ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x) ⊢ [∗ list] k↦x ∈ l, Φ k x.
Admitted.

  Lemma big_sepL_forall `{!BiAffine PROP} Φ l :
    (∀ k x, Persistent (Φ k x)) →
    ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x).
Admitted.

  Lemma big_sepL_impl Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    □ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x -∗ Ψ k x) -∗
    [∗ list] k↦x ∈ l, Ψ k x.
Admitted.

  Lemma big_sepL_wand Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    ([∗ list] k↦x ∈ l, Φ k x -∗ Ψ k x) -∗
    [∗ list] k↦x ∈ l, Ψ k x.
Admitted.

  Lemma big_sepL_dup P `{!Affine P} l :
    □ (P -∗ P ∗ P) -∗ P -∗ [∗ list] k↦x ∈ l, P.
Admitted.

  Lemma big_sepL_delete Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊣⊢
    Φ i x ∗ [∗ list] k↦y ∈ l, if decide (k = i) then emp else Φ k y.
Admitted.
  Lemma big_sepL_delete' `{!BiAffine PROP} Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊣⊢ Φ i x ∗ [∗ list] k↦y ∈ l, ⌜ k ≠ i ⌝ → Φ k y.
Admitted.

  Lemma big_sepL_lookup_acc_impl {Φ l} i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) -∗
     
    Φ i x ∗
     
    ∀ Ψ,
      □ (∀ k y, ⌜ l !! k = Some y ⌝ → ⌜ k ≠ i ⌝ → Φ k y -∗ Ψ k y) -∗
      Ψ i x -∗
      [∗ list] k↦y ∈ l, Ψ k y.
Admitted.

  Lemma big_sepL_replicate l P :
    [∗] replicate (length l) P ⊣⊢ [∗ list] y ∈ l, P.
Admitted.

  Lemma big_sepL_later `{!BiAffine PROP} Φ l :
    ▷ ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ ([∗ list] k↦x ∈ l, ▷ Φ k x).
Admitted.
  Lemma big_sepL_later_2 Φ l :
    ([∗ list] k↦x ∈ l, ▷ Φ k x) ⊢ ▷ [∗ list] k↦x ∈ l, Φ k x.
Admitted.

  Lemma big_sepL_laterN `{!BiAffine PROP} Φ n l :
    ▷^n ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ ([∗ list] k↦x ∈ l, ▷^n Φ k x).
Admitted.
  Lemma big_sepL_laterN_2 Φ n l :
    ([∗ list] k↦x ∈ l, ▷^n Φ k x) ⊢ ▷^n [∗ list] k↦x ∈ l, Φ k x.
Admitted.
End sep_list.

 
Lemma big_sepL_sep_zip_with {A B C} (f : A → B → C) (g1 : C → A) (g2 : C → B)
    (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
  (∀ x y, g1 (f x y) = x) →
  (∀ x y, g2 (f x y) = y) →
  length l1 = length l2 →
  ([∗ list] k↦xy ∈ zip_with f l1 l2, Φ1 k (g1 xy) ∗ Φ2 k (g2 xy)) ⊣⊢
  ([∗ list] k↦x ∈ l1, Φ1 k x) ∗ ([∗ list] k↦y ∈ l2, Φ2 k y).
Admitted.

Lemma big_sepL_sep_zip {A B} (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
  length l1 = length l2 →
  ([∗ list] k↦xy ∈ zip l1 l2, Φ1 k xy.1 ∗ Φ2 k xy.2) ⊣⊢
  ([∗ list] k↦x ∈ l1, Φ1 k x) ∗ ([∗ list] k↦y ∈ l2, Φ2 k y).
Admitted.

Lemma big_sepL_zip_with {A B C} (Φ : nat → A → PROP) f (l1 : list B) (l2 : list C) :
  ([∗ list] k↦x ∈ zip_with f l1 l2, Φ k x) ⊣⊢
  ([∗ list] k↦x ∈ l1, if l2 !! k is Some y then Φ k (f x y) else emp).
Admitted.

 
Lemma big_sepL2_alt {A B} (Φ : nat → A → B → PROP) l1 l2 :
  ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) ⊣⊢
  ⌜ length l1 = length l2 ⌝ ∧ [∗ list] k ↦ xy ∈ zip l1 l2, Φ k (xy.1) (xy.2).
Admitted.

Section sep_list2.
  Context {A B : Type}.
  Implicit Types Φ Ψ : nat → A → B → PROP.

  Lemma big_sepL2_nil Φ : ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2) ⊣⊢ emp.
Admitted.
  Lemma big_sepL2_nil' P `{!Affine P} Φ : P ⊢ [∗ list] k↦y1;y2 ∈ [];[], Φ k y1 y2.
Admitted.
  Lemma big_sepL2_nil_inv_l Φ l2 :
    ([∗ list] k↦y1;y2 ∈ []; l2, Φ k y1 y2) -∗ ⌜l2 = []⌝.
Admitted.
  Lemma big_sepL2_nil_inv_r Φ l1 :
    ([∗ list] k↦y1;y2 ∈ l1; [], Φ k y1 y2) -∗ ⌜l1 = []⌝.
Admitted.

  Lemma big_sepL2_cons Φ x1 x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ x1 :: l1; x2 :: l2, Φ k y1 y2)
    ⊣⊢ Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, Φ (S k) y1 y2.
Admitted.
  Lemma big_sepL2_cons_inv_l Φ x1 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ x1 :: l1; l2, Φ k y1 y2) -∗
    ∃ x2 l2', ⌜ l2 = x2 :: l2' ⌝ ∧
              Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2', Φ (S k) y1 y2.
Admitted.
  Lemma big_sepL2_cons_inv_r Φ x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; x2 :: l2, Φ k y1 y2) -∗
    ∃ x1 l1', ⌜ l1 = x1 :: l1' ⌝ ∧
              Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1';l2, Φ (S k) y1 y2.
Admitted.

  Lemma big_sepL2_singleton Φ x1 x2 :
    ([∗ list] k↦y1;y2 ∈ [x1];[x2], Φ k y1 y2) ⊣⊢ Φ 0 x1 x2.
Admitted.

  Lemma big_sepL2_length Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) -∗ ⌜ length l1 = length l2 ⌝.
Admitted.

  Lemma big_sepL2_fst_snd Φ l :
    ([∗ list] k↦y1;y2 ∈ l.*1; l.*2, Φ k y1 y2) ⊣⊢
    [∗ list] k ↦ xy ∈ l, Φ k (xy.1) (xy.2).
Admitted.

  Lemma big_sepL2_app Φ l1 l2 l1' l2' :
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k) y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2).
Admitted.
  Lemma big_sepL2_app_inv_l Φ l1' l1'' l2 :
    ([∗ list] k↦y1;y2 ∈ l1' ++ l1''; l2, Φ k y1 y2) -∗
    ∃ l2' l2'', ⌜ l2 = l2' ++ l2'' ⌝ ∧
                ([∗ list] k↦y1;y2 ∈ l1';l2', Φ k y1 y2) ∗
                ([∗ list] k↦y1;y2 ∈ l1'';l2'', Φ (length l1' + k) y1 y2).
Admitted.
  Lemma big_sepL2_app_inv_r Φ l1 l2' l2'' :
    ([∗ list] k↦y1;y2 ∈ l1; l2' ++ l2'', Φ k y1 y2) -∗
    ∃ l1' l1'', ⌜ l1 = l1' ++ l1'' ⌝ ∧
                ([∗ list] k↦y1;y2 ∈ l1';l2', Φ k y1 y2) ∗
                ([∗ list] k↦y1;y2 ∈ l1'';l2'', Φ (length l2' + k) y1 y2).
Admitted.
  Lemma big_sepL2_app_inv Φ l1 l2 l1' l2' :
    length l1 = length l1' ∨ length l2 = length l2' →
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) ∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k)%nat y1 y2).
Admitted.
  Lemma big_sepL2_app_same_length Φ l1 l2 l1' l2' :
    length l1 = length l1' ∨ length l2 = length l2' →
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2) ⊣⊢
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) ∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k)%nat y1 y2).
Admitted.

  Lemma big_sepL2_snoc Φ x1 x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1 ++ [x1]; l2 ++ [x2], Φ k y1 y2) ⊣⊢
    ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) ∗ Φ (length l1) x1 x2.
Admitted.

   
  Lemma big_sepL2_mono Φ Ψ l1 l2 :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ⊢ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ [∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.
  Lemma big_sepL2_ne Φ Ψ l1 l2 n :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ≡{n}≡ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2)%I ≡{n}≡ ([∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2)%I.
Admitted.
  Lemma big_sepL2_proper Φ Ψ l1 l2 :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ⊣⊢ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢ [∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.
  Lemma big_sepL2_proper_2 `{!Equiv A, !Equiv B} Φ Ψ l1 l2 l1' l2' :
    l1 ≡ l1' → l2 ≡ l2' →
    (∀ k y1 y1' y2 y2',
      l1 !! k = Some y1 → l1' !! k = Some y1' → y1 ≡ y1' →
      l2 !! k = Some y2 → l2' !! k = Some y2' → y2 ≡ y2' →
      Φ k y1 y2 ⊣⊢ Ψ k y1' y2') →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢ [∗ list] k ↦ y1;y2 ∈ l1';l2', Ψ k y1 y2.
Admitted.

  Global Instance big_sepL2_ne' n :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (dist n)))
      ==> (=) ==> (=) ==> (dist n))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.
  Global Instance big_sepL2_mono' :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (⊢)))
      ==> (=) ==> (=) ==> (⊢))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.
  Global Instance big_sepL2_proper' :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (⊣⊢)))
      ==> (=) ==> (=) ==> (⊣⊢))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.

  Global Instance big_sepL2_nil_persistent Φ :
    Persistent ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_persistent Φ l1 l2 :
    (∀ k x1 x2, Persistent (Φ k x1 x2)) →
    Persistent ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Global Instance big_sepL2_nil_affine Φ :
    Affine ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_affine Φ l1 l2 :
    (∀ k x1 x2, Affine (Φ k x1 x2)) →
    Affine ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Global Instance big_sepL2_nil_timeless `{!Timeless (emp%I : PROP)} Φ :
    Timeless ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_timeless `{!Timeless (emp%I : PROP)} Φ l1 l2 :
    (∀ k x1 x2, Timeless (Φ k x1 x2)) →
    Timeless ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Lemma big_sepL2_insert_acc Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢
    Φ i x1 x2 ∗ (∀ y1 y2, Φ i y1 y2 -∗ ([∗ list] k↦y1;y2 ∈ <[i:=y1]>l1;<[i:=y2]>l2, Φ k y1 y2)).
Admitted.

  Lemma big_sepL2_lookup_acc Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢
    Φ i x1 x2 ∗ (Φ i x1 x2 -∗ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2)).
Admitted.

  Lemma big_sepL2_lookup Φ l1 l2 i x1 x2
    `{!TCOr (∀ j y1 y2, Affine (Φ j y1 y2)) (Absorbing (Φ i x1 x2))} :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ Φ i x1 x2.
Admitted.

  Lemma big_sepL2_fmap_l {A'} (f : A → A') (Φ : nat → A' → B → PROP) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ f <$> l1; l2, Φ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k (f y1) y2).
Admitted.
  Lemma big_sepL2_fmap_r {B'} (g : B → B') (Φ : nat → A → B' → PROP) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; g <$> l2, Φ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 (g y2)).
Admitted.

  Lemma big_sepL2_reverse_2 (Φ : A → B → PROP) l1 l2 :
    ([∗ list] y1;y2 ∈ l1;l2, Φ y1 y2) ⊢ ([∗ list] y1;y2 ∈ reverse l1;reverse l2, Φ y1 y2).
Admitted.
  Lemma big_sepL2_reverse (Φ : A → B → PROP) l1 l2 :
    ([∗ list] y1;y2 ∈ reverse l1;reverse l2, Φ y1 y2) ⊣⊢ ([∗ list] y1;y2 ∈ l1;l2, Φ y1 y2).
Admitted.

  Lemma big_sepL2_replicate_l l x Φ n :
    length l = n →
    ([∗ list] k↦x1;x2 ∈ replicate n x; l, Φ k x1 x2) ⊣⊢ [∗ list] k↦x2 ∈ l, Φ k x x2.
Admitted.
  Lemma big_sepL2_replicate_r l x Φ n :
    length l = n →
    ([∗ list] k↦x1;x2 ∈ l;replicate n x, Φ k x1 x2) ⊣⊢ [∗ list] k↦x1 ∈ l, Φ k x1 x.
Admitted.

  Lemma big_sepL2_sep Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∗ Ψ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ∗ ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_sep_2 Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∗ Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_and Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∧ Ψ k y1 y2)
    ⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ∧ ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_pure_1 (φ : nat → A → B → Prop) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ⌜φ k y1 y2⌝) ⊢@{PROP}
      ⌜∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝.
Admitted.
  Lemma big_sepL2_affinely_pure_2 (φ : nat → A → B → Prop) l1 l2 :
    length l1 = length l2 →
    <affine> ⌜∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝ ⊢@{PROP}
    ([∗ list] k↦y1;y2 ∈ l1;l2, <affine> ⌜φ k y1 y2⌝).
Admitted.
   
  Lemma big_sepL2_pure `{!BiAffine PROP} (φ : nat → A → B → Prop) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ⌜φ k y1 y2⌝) ⊣⊢@{PROP}
      ⌜length l1 = length l2 ∧
       ∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝.
Admitted.

  Lemma big_sepL2_persistently `{!BiAffine PROP} Φ l1 l2 :
    <pers> ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2)
    ⊣⊢ [∗ list] k↦y1;y2 ∈ l1;l2, <pers> (Φ k y1 y2).
Admitted.

  Lemma big_sepL2_intro Φ l1 l2 :
    length l1 = length l2 →
    □ (∀ k x1 x2, ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2) ⊢
    [∗ list] k↦x1;x2 ∈ l1;l2, Φ k x1 x2.
Admitted.

  Lemma big_sepL2_forall `{!BiAffine PROP} Φ l1 l2 :
    (∀ k x1 x2, Persistent (Φ k x1 x2)) →
    ([∗ list] k↦x1;x2 ∈ l1;l2, Φ k x1 x2) ⊣⊢
      ⌜length l1 = length l2⌝
      ∧ (∀ k x1 x2, ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2).
Admitted.

  Lemma big_sepL2_impl Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    □ (∀ k x1 x2,
      ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2 -∗ Ψ k x1 x2) -∗
    [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_wand Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 -∗ Ψ k y1 y2) -∗
    [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_delete Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢
    Φ i x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, if decide (k = i) then emp else Φ k y1 y2.
Admitted.
  Lemma big_sepL2_delete' `{!BiAffine PROP} Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢
    Φ i x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, ⌜ k ≠ i ⌝ → Φ k y1 y2.
Admitted.

  Lemma big_sepL2_lookup_acc_impl {Φ l1 l2} i x1 x2 :
    l1 !! i = Some x1 →
    l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
     
    Φ i x1 x2 ∗
     
    ∀ Ψ,
      □ (∀ k y1 y2,
        ⌜ l1 !! k = Some y1 ⌝ → ⌜ l2 !! k = Some y2 ⌝ → ⌜ k ≠ i ⌝ →
        Φ k y1 y2 -∗ Ψ k y1 y2) -∗
      Ψ i x1 x2 -∗
      [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_later_1 `{!BiAffine PROP} Φ l1 l2 :
    (▷ [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ ◇ [∗ list] k↦y1;y2 ∈ l1;l2, ▷ Φ k y1 y2.
Admitted.

  Lemma big_sepL2_later_2 Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ▷ Φ k y1 y2) ⊢ ▷ [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2.
Admitted.

  Lemma big_sepL2_laterN_2 Φ n l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ▷^n Φ k y1 y2) ⊢ ▷^n [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2.
Admitted.

  Lemma big_sepL2_flip Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l2; l1, Φ k y2 y1) ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2).
Admitted.

  Lemma big_sepL2_sepL (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
    length l1 = length l2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ1 k y1 ∗ Φ2 k y2) ⊣⊢
    ([∗ list] k↦y1 ∈ l1, Φ1 k y1) ∗ ([∗ list] k↦y2 ∈ l2, Φ2 k y2).
Admitted.
  Lemma big
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 3.8MiB file on GitHub Actions Artifacts under build.log)
ild_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/builds/coq/coq/_build_ci/perennial'
make[1]: Leaving directory '/builds/coq/coq/_build_ci/perennial'
Aggregating timing log...
No timing data
/github/workspace/builds/coq /github/workspace
::endgroup::
::group::make ci-perennial (failing)
/builds/coq/coq /github/workspace/builds/coq /github/workspace
./dev/ci/ci-wrapper.sh perennial
++ : 2
++ export NJOBS
++ which cygpath
++ OCAMLFINDSEP=:
++ export OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ OCAMLPATH=/github/workspace/builds/coq/coq-failing/_install_ci/lib:
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ '[' -n 1 ']'
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin
++ export CI_BRANCH=
++ CI_BRANCH=
++ [[ '' =~ ^[0-9]*$ ]]
++ export CI_PULL_REQUEST=
++ CI_PULL_REQUEST=
++ export PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/github/workspace/builds/coq/coq-failing/_install_ci/bin:/github/workspace/builds/coq/coq-failing/_install_ci/bin:/root/.opamcache/4.14.1+flambda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ export COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ COQBIN=/github/workspace/builds/coq/coq-failing/_install_ci/bin/
++ ls -l /github/workspace/builds/coq/coq-failing/_install_ci/bin/
total 664728
-rwxr-xr-x 1 root root     2125 May  5 09:51 coq-tex
-rwxr-xr-x 1 root root  2754376 May  3 12:41 coq-tex.orig
-rwxr-xr-x 1 root root  8917640 May  3 12:41 coq_makefile
-rwxr-xr-x 1 root root     2122 May  5 09:51 coqc
-rwxr-xr-x 1 root root     2127 May  5 09:51 coqc.byte
-rwxr-xr-x 1 root root 41273893 May  3 12:41 coqc.byte.orig
-rwxr-xr-x 1 root root 67183512 May  3 12:41 coqc.orig
-rwxr-xr-x 1 root root 22613416 May  3 12:41 coqchk
-rwxr-xr-x 1 root root  9473312 May  3 12:41 coqdep
-rwxr-xr-x 1 root root     2124 May  5 09:51 coqdoc
-rwxr-xr-x 1 root root  9392344 May  3 12:41 coqdoc.orig
-rwxr-xr-x 1 root root     2124 May  5 09:51 coqide
-rwxr-xr-x 1 root root 21602928 May  3 12:42 coqide.orig
-rwxr-xr-x 1 root root     2132 May  5 09:51 coqidetop.byte
-rwxr-xr-x 1 root root 41836419 May  3 12:42 coqidetop.byte.orig
-rwxr-xr-x 1 root root     2131 May  5 09:51 coqidetop.opt
-rwxr-xr-x 1 root root 67900456 May  3 12:42 coqidetop.opt.orig
-rwxr-xr-x 1 root root     2127 May  5 09:51 coqnative
-rwxr-xr-x 1 root root 22718304 May  3 12:41 coqnative.orig
-rwxr-xr-x 1 root root     2123 May  5 09:51 coqpp
-rwxr-xr-x 1 root root  3430448 May  3 12:41 coqpp.orig
-rwxr-xr-x 1 root root     2133 May  5 09:51 coqtimelog2html
-rwxr-xr-x 1 root root  4633952 May  3 12:41 coqtimelog2html.orig
-rwxr-xr-x 1 root root     2124 May  5 09:51 coqtop
-rwxr-xr-x 1 root root     2129 May  5 09:51 coqtop.byte
-rwxr-xr-x 1 root root 59580852 May  3 12:41 coqtop.byte.orig
-rwxr-xr-x 1 root root     2128 May  5 09:51 coqtop.opt
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.opt.orig
-rwxr-xr-x 1 root root 67250848 May  3 12:41 coqtop.orig
-rwxr-xr-x 1 root root     2123 May  5 09:51 coqwc
-rwxr-xr-x 1 root root  2357648 May  3 12:41 coqwc.orig
-rwxr-xr-x 1 root root     2131 May  5 09:51 coqworker.opt
-rwxr-xr-x 1 root root 67260312 May  3 12:41 coqworker.opt.orig
-rwxr-xr-x 1 root root     2128 May  5 09:51 coqworkmgr
-rwxr-xr-x 1 root root  3603640 May  3 12:41 coqworkmgr.orig
-rwxr-xr-x 1 root root     2126 May  5 09:51 csdpcert
-rwxr-xr-x 1 root root 81440368 May  3 12:41 csdpcert.orig
-rwxr-xr-x 1 root root     2129 May  5 09:51 ocamllibdep
-rwxr-xr-x 1 root root  3680048 May  3 12:41 ocamllibdep.orig
-rwxr-xr-x 1 root root     2124 May  5 09:51 votour
-rwxr-xr-x 1 root root  4405272 May  3 12:41 votour.orig
++ CI_BUILD_DIR=/github/workspace/builds/coq/coq-failing/_build_ci
++ CI_INSTALL_DIR=/github/workspace/builds/coq/coq-failing/_install_ci
++ ls -l /github/workspace/builds/coq/coq-failing/_build_ci
total 4
drwxr-xr-x 7 root root 4096 May  3 13:43 perennial
++ declare -A overlays
++ set +x
+ WITH_SUBMODULES=1
+ git_download perennial
+ local project=perennial
+ local dest=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ local giturl_var=perennial_CI_GITURL
+ local giturl=https://github.com/mit-pdos/perennial
+ local ref_var=perennial_CI_REF
+ local ref=coq/tested
+ local ov_url=
+ local ov_ref=
+ '[' -d /github/workspace/builds/coq/coq-failing/_build_ci/perennial ']'
+ echo 'Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.'
Warning: download and unpacking of perennial skipped because /github/workspace/builds/coq/coq-failing/_build_ci/perennial already exists.
+ '[' '' ']'
+ ulimit -s
16384
+ ulimit -s 65536
+ ulimit -s
65536
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ make TIMED=false lite
+ '[' -z x ']'
+ command make TIMED=false lite
+ make TIMED=false lite
make[1]: Entering directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
COQC src/base_logic/lib/wsat.v
MINIMIZER_DEBUG_EXTRA: coqc: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc
MINIMIZER_DEBUG_EXTRA: coqpath: 
MINIMIZER_DEBUG_EXTRA: pwd: PWD=/github/workspace/builds/coq/coq-failing/_build_ci/perennial
MINIMIZER_DEBUG_EXTRA: exec: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src Perennial -w -ssr-search-moved -w +deprecated-hint-without-locality -w +deprecated-instance-without-locality -w -future-coercion-class-field -w +deprecated-hint-rewrite-without-locality -w -deprecated-field-instance-without-locality -w +deprecated-tactic-notation -w -notation-overridden\,-redundant-canonical-projection\,-deprecated-typeclasses-transparency-without-locality -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp stdpp -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable stdpp.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris iris -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated iris.deprecated -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable iris.unstable -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang iris.heap_lang -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil coqutil -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose Goose -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src RecordUpdate -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src Tactical -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src iris_named_props -o /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/base_logic/lib/wsat.vo src/base_logic/lib/wsat.v 
MINIMIZER_DEBUG: info: /tmp/tmp-coqbot-minimizer.vO6gd6zyAY
MINIMIZER_DEBUG: files:  src/base_logic/lib/wsat.v
File "./src/base_logic/lib/wsat.v", line 627, characters 2-3:
Error: This proof is focused, but cannot be unfocused this way

Makefile:53: recipe for target 'src/base_logic/lib/wsat.vo' failed
make[1]: *** [src/base_logic/lib/wsat.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
Makefile.ci:150: recipe for target 'ci-perennial' failed
make: *** [ci-perennial] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
Minimization Log (truncated to last 8.0KiB; full 226KiB file on GitHub Actions Artifacts under bug.log)
1:=m1; m2:=m2} ?o@{m1:=m1; m2:=m2} (gmap K A)]
          (parameter Lookup of lookup) {?Lookup0}
TYPECLASSES:?X262 ?X272 ?X277 ?X283
SHELF:
FUTURE GOALS STACK:?X285 ?X283 ?X278 ?X277 ?X272 ?X262



�[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/tmp2ei3vl_g/Top/bug_01.v", line 6407, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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

Non-fatal error: Failed to remove Contexts and preserve the error.  
The new error was:
File "/tmp/tmpqaz9nng0/Top/bug_01.v", line 4849, characters 0-75:
Error:
Unable to satisfy the following constraints:
In environment:
γ : gname
a1, a2 : ?A

?inG0 : "inG ?Σ ?A"

?inG00 : "inG ?Σ ?A"

?Op : "Op ?A"



�[93mIntermediate code not saved.�[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
Success!

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/tmpfnf2hgnz/Top/bug_01.v", line 2394, characters 4-74:
Error: Unable to satisfy the following constraints:
UNDEFINED EVARS:
 ?X262==[M K EqDecision0 H A m1 m2 |- InternalEq (uPredI M)]
          (parameter InternalEq of internal_eq) {?InternalEq}
 ?X272==[M K EqDecision0 H A m1 m2 i |- InternalEq (uPredI M)]
          (parameter InternalEq of internal_eq) {?InternalEq0}
 ?X277==[M K EqDecision0 H A m1 m2 i |-
          Lookup ?K@{m1:=m1; m2:=m2} ?o@{m1:=m1; m2:=m2} (gmap K A)]
          (parameter Lookup of lookup) {?Lookup}
 ?X283==[M K EqDecision0 H A m1 m2 i |-
          Lookup ?K@{m1:=m1; m2:=m2} ?o@{m1:=m1; m2:=m2} (gmap K A)]
          (parameter Lookup of lookup) {?Lookup0}
TYPECLASSES:?X262 ?X272 ?X277 ?X283
SHELF:
FUTURE GOALS STACK:?X285 ?X283 ?X278 ?X277 ?X272 ?X262



�[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/tmp93dn33zj/Top/bug_01.v", line 4214, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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

Non-fatal error: Failed to remove Contexts and preserve the error.  
The new error was:
File "/tmp/tmp_4sriqnd/Top/bug_01.v", line 2657, characters 0-75:
Error:
Unable to satisfy the following constraints:
In environment:
γ : gname
a1, a2 : ?A

?inG0 : "inG ?Σ ?A"

?inG00 : "inG ?Σ ?A"

?Op : "Op ?A"



�[93mIntermediate code not saved.�[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/tmpfnf2hgnz/Top/bug_01.v", line 2394, characters 4-74:
Error: Unable to satisfy the following constraints:
UNDEFINED EVARS:
 ?X262==[M K EqDecision0 H A m1 m2 |- InternalEq (uPredI M)]
          (parameter InternalEq of internal_eq) {?InternalEq}
 ?X272==[M K EqDecision0 H A m1 m2 i |- InternalEq (uPredI M)]
          (parameter InternalEq of internal_eq) {?InternalEq0}
 ?X277==[M K EqDecision0 H A m1 m2 i |-
          Lookup ?K@{m1:=m1; m2:=m2} ?o@{m1:=m1; m2:=m2} (gmap K A)]
          (parameter Lookup of lookup) {?Lookup}
 ?X283==[M K EqDecision0 H A m1 m2 i |-
          Lookup ?K@{m1:=m1; m2:=m2} ?o@{m1:=m1; m2:=m2} (gmap K A)]
          (parameter Lookup of lookup) {?Lookup0}
TYPECLASSES:?X262 ?X272 ?X277 ?X283
SHELF:
FUTURE GOALS STACK:?X285 ?X283 ?X278 ?X277 ?X272 ?X262



�[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/tmp93dn33zj/Top/bug_01.v", line 4214, characters 17-21:
Error: The reference ITrm was not found in the current environment.


�[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

Non-fatal error: Failed to remove Contexts and preserve the error.  
The new error was:
File "/tmp/tmp_4sriqnd/Top/bug_01.v", line 2657, characters 0-75:
Error:
Unable to satisfy the following constraints:
In environment:
γ : gname
a1, a2 : ?A

?inG0 : "inG ?Σ ?A"

?inG00 : "inG ?Σ ?A"

?Op : "Op ?A"



�[93mIntermediate code not saved.�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module spec_pat, module intro_pat, module sel_pat, module base,
module bi, module iris and module iris_DOT_bi_DOT_bi_WRAPPED
need to be closed.


�[93mIntermediate code not saved.�[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/tmp2ed_7qlu/Top/bug_01.v", line 2379, characters 0-9:
Error: Could not declare a canonical structure uPredI.
Could not find its value in the global environment.


�[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

Non-fatal error: Failed to admit lemmas and preserve the error.  
The new error was:
Error: The module spec_pat, module intro_pat, module sel_pat, module base,
module bi, module iris and module iris_DOT_bi_DOT_bi_WRAPPED
need to be closed.


�[93mIntermediate code not saved.�[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/tmpq4jr1hhz/Top/bug_01.v", line 2380, characters 0-8:
Error: Could not declare a canonical structure uPredI.
Expected a record or structure constructor applied to arguments.


�[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 successful

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

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

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

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 5, 2023

Minimized File (from ci-perennial) (full log on GitHub Actions)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

Minimized Coq File (truncated to 32KiB; full 168KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-w" "-ssr-search-moved" "-w" "+deprecated-hint-without-locality" "-w" "+deprecated-instance-without-locality" "-w" "-future-coercion-class-field" "-w" "+deprecated-hint-rewrite-without-locality" "-w" "-deprecated-field-instance-without-locality" "-w" "+deprecated-tactic-notation" "-w" "-notation-overridden,-redundant-canonical-projection,-deprecated-typeclasses-transparency-without-locality" "-w" "-deprecated-native-compiler-option,-native-compiler-disabled" "-native-compiler" "ondemand" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/src" "Perennial" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp" "stdpp" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/stdpp_unstable" "stdpp.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris" "iris" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_deprecated" "iris.deprecated" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_unstable" "iris.unstable" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris/iris_heap_lang" "iris.heap_lang" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coqutil/src/coqutil" "coqutil" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/Goose" "Goose" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src" "RecordUpdate" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/coq-tactical/src" "Tactical" "-Q" "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/iris-named-props/src" "iris_named_props" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Top.bug_01") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 1064 lines to 89 lines, then from 102 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 296 lines, then from 301 lines to 104 lines, then from 117 lines to 783 lines, then from 785 lines to 113 lines, then from 126 lines to 480 lines, then from 485 lines to 130 lines, then from 143 lines to 668 lines, then from 673 lines to 175 lines, then from 188 lines to 343 lines, then from 348 lines to 176 lines, then from 189 lines to 351 lines, then from 356 lines to 176 lines, then from 189 lines to 530 lines, then from 535 lines to 181 lines, then from 194 lines to 1498 lines, then from 1503 lines to 220 lines, then from 233 lines to 3895 lines, then from 3900 lines to 1287 lines, then from 1300 lines to 1388 lines, then from 1393 lines to 1387 lines, then from 1403 lines to 1292 lines, then from 1305 lines to 1446 lines, then from 1451 lines to 1355 lines, then from 1368 lines to 1535 lines, then from 1540 lines to 1441 lines, then from 1454 lines to 1590 lines, then from 1595 lines to 1475 lines, then from 1488 lines to 1743 lines, then from 1748 lines to 1640 lines, then from 1653 lines to 1762 lines, then from 1767 lines to 1667 lines, then from 1680 lines to 1836 lines, then from 1841 lines to 1760 lines, then from 1773 lines to 3174 lines, then from 3179 lines to 2669 lines, then from 2640 lines to 2175 lines, then from 2188 lines to 3115 lines, then from 3120 lines to 2364 lines, then from 2377 lines to 2565 lines, then from 2570 lines to 2369 lines, then from 2382 lines to 2644 lines, then from 2649 lines to 2431 lines, then from 2444 lines to 2426 lines, then from 2439 lines to 2561 lines, then from 2566 lines to 2426 lines, then from 2439 lines to 2953 lines, then from 2958 lines to 2443 lines, then from 2456 lines to 2744 lines, then from 2744 lines to 2464 lines, then from 2477 lines to 2601 lines, then from 2606 lines to 2590 lines, then from 2607 lines to 2466 lines, then from 2479 lines to 3195 lines, then from 3199 lines to 2533 lines, then from 2546 lines to 2838 lines, then from 2843 lines to 2571 lines, then from 2584 lines to 2782 lines, then from 2787 lines to 2576 lines, then from 2589 lines to 2655 lines, then from 2660 lines to 2600 lines, then from 2614 lines to 2596 lines, then from 2609 lines to 2786 lines, then from 2791 lines to 2645 lines, then from 2658 lines to 3073 lines, then from 3078 lines to 2667 lines, then from 2680 lines to 2943 lines, then from 2948 lines to 2675 lines, then from 2688 lines to 2794 lines, then from 2799 lines to 2743 lines, then from 2760 lines to 2686 lines, then from 2699 lines to 3085 lines, then from 3090 lines to 2717 lines, then from 2730 lines to 3464 lines, then from 3469 lines to 2738 lines, then from 2751 lines to 3509 lines, then from 3514 lines to 2798 lines, then from 2809 lines to 2775 lines, then from 2788 lines to 3127 lines, then from 3132 lines to 2810 lines, then from 2823 lines to 6068 lines, then from 6073 lines to 4637 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.14.1
   coqtop version runner-ktkhz2yw-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 6.009 sec *)
Require Coq.Init.Ltac.
Require Ltac2.Init.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Bool.
Require Ltac2.Array.
Require Ltac2.Char.
Require Ltac2.Constant.
Require Ltac2.Constr.
Require Ltac2.Constructor.
Require Ltac2.Std.
Require Ltac2.Env.
Require Ltac2.Evar.
Require Ltac2.Float.
Require Ltac2.List.
Require Ltac2.Fresh.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Ltac1.
Require Ltac2.Meta.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require Ltac2.Printf.
Require Ltac2.Proj.
Require Ltac2.String.
Require Ltac2.Uint63.
Require Ltac2.Notations.
Require Ltac2.Ltac2.
Require Coq.QArith.QArith_base.
Require Coq.QArith.Qcanon.
Require Coq.Sorting.Permutation.
Require Coq.Logic.EqdepFacts.
Require Coq.PArith.PArith.
Require Coq.NArith.NArith.
Require Coq.ZArith.ZArith.
Require Coq.Numbers.Natural.Peano.NPeano.
Require Coq.QArith.QArith.
Require Coq.Classes.Morphisms.
Require Coq.Classes.RelationClasses.
Require Coq.Lists.List.
Require Coq.Bool.Bool.
Require Coq.Setoids.Setoid.
Require Coq.Init.Peano.
Require Coq.Unicode.Utf8.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require stdpp.options.
Require stdpp.base.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require Coq.micromega.Lia.
Require stdpp.tactics.
Require stdpp.option.
Require stdpp.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.well_founded.
Require stdpp.countable.
Require stdpp.vector.
Require stdpp.finite.
Require Coq.ssr.ssreflect.
Require stdpp.orders.
Require stdpp.sets.
Require stdpp.relations.
Require stdpp.fin_sets.
Require stdpp.listset.
Require stdpp.lexico.
Require stdpp.prelude.
Require iris.prelude.options.
Require iris.prelude.prelude.
Require iris.algebra.ofe.
Require iris.algebra.monoid.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.local_updates.
Require iris.algebra.proofmode_classes.
Require iris.algebra.frac.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require stdpp.functions.
Require Coq.Strings.Ascii.
Require Coq.Strings.String.
Require stdpp.strings.
Require stdpp.pretty.
Require stdpp.infinite.
Require stdpp.fin_maps.
Require stdpp.fin_map_dom.
Require stdpp.mapset.
Require stdpp.pmap.
Require stdpp.propset.
Require stdpp.gmap.
Require stdpp.gmultiset.
Require iris.algebra.big_op.
Require iris.algebra.view.
Require iris.algebra.auth.
Require iris.bi.notation.
Require iris.base_logic.upred.
Require stdpp.coPset.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.extensions.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
Require iris.algebra.list.
Require iris.algebra.gset.
Require iris.algebra.gmap.

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.

Module Export iris_DOT_bi_DOT_big_op_WRAPPED.
Module Export big_op.
Import stdpp.countable.
Import stdpp.fin_sets.
Import stdpp.functions.
Export iris.algebra.big_op.
Import iris.algebra.list.
Import iris.algebra.gmap.
Import iris.bi.derived_laws_later.
Import iris.prelude.options.
Import interface.bi.
Import derived_laws.bi.
Import derived_laws_later.bi.

 
Notation "'[∗' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_sep (λ k x, P%I) l) : bi_scope.
Notation "'[∗' 'list]' x ∈ l , P" :=
  (big_opL bi_sep (λ _ x, P%I) l) : bi_scope.
Notation "'[∗]' Ps" := (big_opL bi_sep (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∧' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_and (λ k x, P%I) l) : bi_scope.
Notation "'[∧' 'list]' x ∈ l , P" :=
  (big_opL bi_and (λ _ x, P%I) l) : bi_scope.
Notation "'[∧]' Ps" := (big_opL bi_and (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∨' 'list]' k ↦ x ∈ l , P" :=
  (big_opL bi_or (λ k x, P%I) l) : bi_scope.
Notation "'[∨' 'list]' x ∈ l , P" :=
  (big_opL bi_or (λ _ x, P%I) l) : bi_scope.
Notation "'[∨]' Ps" := (big_opL bi_or (λ _ x, x) Ps%I) : bi_scope.

Notation "'[∗' 'map]' k ↦ x ∈ m , P" := (big_opM bi_sep (λ k x, P%I) m) : bi_scope.
Notation "'[∗' 'map]' x ∈ m , P" := (big_opM bi_sep (λ _ x, P%I) m) : bi_scope.

Notation "'[∧' 'map]' k ↦ x ∈ m , P" := (big_opM bi_and (λ k x, P) m) : bi_scope.
Notation "'[∧' 'map]' x ∈ m , P" := (big_opM bi_and (λ _ x, P) m) : bi_scope.

Notation "'[∗' 'set]' x ∈ X , P" := (big_opS bi_sep (λ x, P%I) X) : bi_scope.

Notation "'[∗' 'mset]' x ∈ X , P" := (big_opMS bi_sep (λ x, P%I) X) : bi_scope.

 
 
Fixpoint big_sepL2 {PROP : bi} {A B}
    (Φ : nat → A → B → PROP) (l1 : list A) (l2 : list B) : PROP :=
  match l1, l2 with
  | [], [] => emp
  | x1 :: l1, x2 :: l2 => Φ 0 x1 x2 ∗ big_sepL2 (λ n, Φ (S n)) l1 l2
  | _, _ => False
  end%I.
Global Instance: Params (@big_sepL2) 3 := {}.
Global Arguments big_sepL2 {PROP A B} _ !_ !_ /.
Typeclasses Opaque big_sepL2.
Notation "'[∗' 'list]' k ↦ x1 ; x2 ∈ l1 ; l2 , P" :=
  (big_sepL2 (λ k x1 x2, P%I) l1 l2) : bi_scope.
Notation "'[∗' 'list]' x1 ; x2 ∈ l1 ; l2 , P" :=
  (big_sepL2 (λ _ x1 x2, P%I) l1 l2) : bi_scope.
Local Definition big_sepM2_def {PROP : bi} `{Countable K} {A B}
    (Φ : K → A → B → PROP) (m1 : gmap K A) (m2 : gmap K B) : PROP. exact ((⌜ ∀ k, is_Some (m1 !! k) ↔ is_Some (m2 !! k) ⌝ ∧
   [∗ map] k ↦ xy ∈ map_zip m1 m2, Φ k xy.1 xy.2)%I). Defined.
Local Definition big_sepM2_aux : seal (@big_sepM2_def).
Admitted.
Definition big_sepM2 := big_sepM2_aux.(unseal).
Global Arguments big_sepM2 {PROP K _ _ A B} _ _ _.
Local Definition big_sepM2_unseal : @big_sepM2 = _ := big_sepM2_aux.(seal_eq).
Global Instance: Params (@big_sepM2) 6 := {}.
Notation "'[∗' 'map]' k ↦ x1 ; x2 ∈ m1 ; m2 , P" :=
  (big_sepM2 (λ k x1 x2, P%I) m1 m2) : bi_scope.
Notation "'[∗' 'map]' x1 ; x2 ∈ m1 ; m2 , P" :=
  (big_sepM2 (λ _ x1 x2, P%I) m1 m2) : bi_scope.

 
Section big_op.
Context {PROP : bi}.
Implicit Types P Q : PROP.
Implicit Types Ps Qs : list PROP.
Implicit Types A : Type.

 
Section sep_list.
  Context {A : Type}.
  Implicit Types l : list A.
  Implicit Types Φ Ψ : nat → A → PROP.

  Lemma big_sepL_nil Φ : ([∗ list] k↦y ∈ nil, Φ k y) ⊣⊢ emp.
Admitted.
  Lemma big_sepL_nil' P `{!Affine P} Φ : P ⊢ [∗ list] k↦y ∈ nil, Φ k y.
Admitted.
  Lemma big_sepL_cons Φ x l :
    ([∗ list] k↦y ∈ x :: l, Φ k y) ⊣⊢ Φ 0 x ∗ [∗ list] k↦y ∈ l, Φ (S k) y.
Admitted.
  Lemma big_sepL_singleton Φ x : ([∗ list] k↦y ∈ [x], Φ k y) ⊣⊢ Φ 0 x.
Admitted.
  Lemma big_sepL_app Φ l1 l2 :
    ([∗ list] k↦y ∈ l1 ++ l2, Φ k y)
    ⊣⊢ ([∗ list] k↦y ∈ l1, Φ k y) ∗ ([∗ list] k↦y ∈ l2, Φ (length l1 + k) y).
Admitted.
  Lemma big_sepL_snoc Φ l x :
    ([∗ list] k↦y ∈ l ++ [x], Φ k y) ⊣⊢ ([∗ list] k↦y ∈ l, Φ k y) ∗ Φ (length l) x.
Admitted.

  Lemma big_sepL_take_drop Φ l n :
    ([∗ list] k ↦ x ∈ l, Φ k x) ⊣⊢
    ([∗ list] k ↦ x ∈ take n l, Φ k x) ∗ ([∗ list] k ↦ x ∈ drop n l, Φ (n + k) x).
Admitted.

  Lemma big_sepL_submseteq (Φ : A → PROP) `{!∀ x, Affine (Φ x)} l1 l2 :
    l1 ⊆+ l2 → ([∗ list] y ∈ l2, Φ y) ⊢ [∗ list] y ∈ l1, Φ y.
Admitted.

   
  Lemma big_sepL_mono Φ Ψ l :
    (∀ k y, l !! k = Some y → Φ k y ⊢ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y) ⊢ [∗ list] k ↦ y ∈ l, Ψ k y.
Admitted.
  Lemma big_sepL_ne Φ Ψ l n :
    (∀ k y, l !! k = Some y → Φ k y ≡{n}≡ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y)%I ≡{n}≡ ([∗ list] k ↦ y ∈ l, Ψ k y)%I.
Admitted.
  Lemma big_sepL_proper Φ Ψ l :
    (∀ k y, l !! k = Some y → Φ k y ⊣⊢ Ψ k y) →
    ([∗ list] k ↦ y ∈ l, Φ k y) ⊣⊢ ([∗ list] k ↦ y ∈ l, Ψ k y).
Admitted.

   
  Global Instance big_sepL_mono' :
    Proper (pointwise_relation _ (pointwise_relation _ (⊢)) ==> (=) ==> (⊢))
           (big_opL (@bi_sep PROP) (A:=A)).
Admitted.
  Global Instance big_sepL_id_mono' :
    Proper (Forall2 (⊢) ==> (⊢)) (big_opL (@bi_sep PROP) (λ _ P, P)).
Admitted.

  Global Instance big_sepL_nil_persistent Φ :
    Persistent ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_persistent Φ l :
    (∀ k x, Persistent (Φ k x)) → Persistent ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_persistent_id Ps :
    TCForall Persistent Ps → Persistent ([∗] Ps).
Admitted.

  Global Instance big_sepL_nil_affine Φ :
    Affine ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_affine Φ l :
    (∀ k x, Affine (Φ k x)) → Affine ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_affine_id Ps : TCForall Affine Ps → Affine ([∗] Ps).
Admitted.

  Global Instance big_sepL_nil_timeless `{!Timeless (emp%I : PROP)} Φ :
    Timeless ([∗ list] k↦x ∈ [], Φ k x).
Admitted.
  Global Instance big_sepL_timeless `{!Timeless (emp%I : PROP)} Φ l :
    (∀ k x, Timeless (Φ k x)) → Timeless ([∗ list] k↦x ∈ l, Φ k x).
Admitted.
  Global Instance big_sepL_timeless_id `{!Timeless (emp%I : PROP)} Ps :
    TCForall Timeless Ps → Timeless ([∗] Ps).
Admitted.

  Lemma big_sepL_emp l : ([∗ list] k↦y ∈ l, emp) ⊣⊢@{PROP} emp.
Admitted.

  Lemma big_sepL_insert_acc Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x ∗ (∀ y, Φ i y -∗ ([∗ list] k↦y ∈ <[i:=y]>l, Φ k y)).
Admitted.

  Lemma big_sepL_lookup_acc Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x ∗ (Φ i x -∗ ([∗ list] k↦y ∈ l, Φ k y)).
Admitted.

  Lemma big_sepL_lookup Φ l i x
    `{!TCOr (∀ j y, Affine (Φ j y)) (Absorbing (Φ i x))} :
    l !! i = Some x → ([∗ list] k↦y ∈ l, Φ k y) ⊢ Φ i x.
Admitted.

  Lemma big_sepL_elem_of (Φ : A → PROP) l x
    `{!TCOr (∀ y, Affine (Φ y)) (Absorbing (Φ x))} :
    x ∈ l → ([∗ list] y ∈ l, Φ y) ⊢ Φ x.
Admitted.

  Lemma big_sepL_fmap {B} (f : A → B) (Φ : nat → B → PROP) l :
    ([∗ list] k↦y ∈ f <$> l, Φ k y) ⊣⊢ ([∗ list] k↦y ∈ l, Φ k (f y)).
Admitted.

  Lemma big_sepL_omap {B} (f : A → option B) (Φ : B → PROP) l :
    ([∗ list] y ∈ omap f l, Φ y) ⊣⊢ ([∗ list] y ∈ l, from_option Φ emp (f y)).
Admitted.

  Lemma big_sepL_bind {B} (f : A → list B) (Φ : B → PROP) l :
    ([∗ list] y ∈ l ≫= f, Φ y) ⊣⊢ ([∗ list] x ∈ l, [∗ list] y ∈ f x, Φ y).
Admitted.

  Lemma big_sepL_sep Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x ∗ Ψ k x)
    ⊣⊢ ([∗ list] k↦x ∈ l, Φ k x) ∗ ([∗ list] k↦x ∈ l, Ψ k x).
Admitted.

  Lemma big_sepL_sep_2 Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    ([∗ list] k↦x ∈ l, Ψ k x) -∗
    ([∗ list] k↦x ∈ l, Φ k x ∗ Ψ k x).
Admitted.

  Lemma big_sepL_and Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x ∧ Ψ k x)
    ⊢ ([∗ list] k↦x ∈ l, Φ k x) ∧ ([∗ list] k↦x ∈ l, Ψ k x).
Admitted.

  Lemma big_sepL_pure_1 (φ : nat → A → Prop) l :
    ([∗ list] k↦x ∈ l, ⌜φ k x⌝) ⊢@{PROP} ⌜∀ k x, l !! k = Some x → φ k x⌝.
Admitted.
  Lemma big_sepL_affinely_pure_2 (φ : nat → A → Prop) l :
    <affine> ⌜∀ k x, l !! k = Some x → φ k x⌝ ⊢@{PROP} ([∗ list] k↦x ∈ l, <affine> ⌜φ k x⌝).
Admitted.
   
  Lemma big_sepL_pure `{!BiAffine PROP} (φ : nat → A → Prop) l :
    ([∗ list] k↦x ∈ l, ⌜φ k x⌝) ⊣⊢@{PROP} ⌜∀ k x, l !! k = Some x → φ k x⌝.
Admitted.

  Lemma big_sepL_persistently `{!BiAffine PROP} Φ l :
    <pers> ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ [∗ list] k↦x ∈ l, <pers> (Φ k x).
Admitted.

  Lemma big_sepL_intro Φ l :
    □ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x) ⊢ [∗ list] k↦x ∈ l, Φ k x.
Admitted.

  Lemma big_sepL_forall `{!BiAffine PROP} Φ l :
    (∀ k x, Persistent (Φ k x)) →
    ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x).
Admitted.

  Lemma big_sepL_impl Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    □ (∀ k x, ⌜l !! k = Some x⌝ → Φ k x -∗ Ψ k x) -∗
    [∗ list] k↦x ∈ l, Ψ k x.
Admitted.

  Lemma big_sepL_wand Φ Ψ l :
    ([∗ list] k↦x ∈ l, Φ k x) -∗
    ([∗ list] k↦x ∈ l, Φ k x -∗ Ψ k x) -∗
    [∗ list] k↦x ∈ l, Ψ k x.
Admitted.

  Lemma big_sepL_dup P `{!Affine P} l :
    □ (P -∗ P ∗ P) -∗ P -∗ [∗ list] k↦x ∈ l, P.
Admitted.

  Lemma big_sepL_delete Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊣⊢
    Φ i x ∗ [∗ list] k↦y ∈ l, if decide (k = i) then emp else Φ k y.
Admitted.
  Lemma big_sepL_delete' `{!BiAffine PROP} Φ l i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) ⊣⊢ Φ i x ∗ [∗ list] k↦y ∈ l, ⌜ k ≠ i ⌝ → Φ k y.
Admitted.

  Lemma big_sepL_lookup_acc_impl {Φ l} i x :
    l !! i = Some x →
    ([∗ list] k↦y ∈ l, Φ k y) -∗
     
    Φ i x ∗
     
    ∀ Ψ,
      □ (∀ k y, ⌜ l !! k = Some y ⌝ → ⌜ k ≠ i ⌝ → Φ k y -∗ Ψ k y) -∗
      Ψ i x -∗
      [∗ list] k↦y ∈ l, Ψ k y.
Admitted.

  Lemma big_sepL_replicate l P :
    [∗] replicate (length l) P ⊣⊢ [∗ list] y ∈ l, P.
Admitted.

  Lemma big_sepL_later `{!BiAffine PROP} Φ l :
    ▷ ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ ([∗ list] k↦x ∈ l, ▷ Φ k x).
Admitted.
  Lemma big_sepL_later_2 Φ l :
    ([∗ list] k↦x ∈ l, ▷ Φ k x) ⊢ ▷ [∗ list] k↦x ∈ l, Φ k x.
Admitted.

  Lemma big_sepL_laterN `{!BiAffine PROP} Φ n l :
    ▷^n ([∗ list] k↦x ∈ l, Φ k x) ⊣⊢ ([∗ list] k↦x ∈ l, ▷^n Φ k x).
Admitted.
  Lemma big_sepL_laterN_2 Φ n l :
    ([∗ list] k↦x ∈ l, ▷^n Φ k x) ⊢ ▷^n [∗ list] k↦x ∈ l, Φ k x.
Admitted.
End sep_list.

 
Lemma big_sepL_sep_zip_with {A B C} (f : A → B → C) (g1 : C → A) (g2 : C → B)
    (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
  (∀ x y, g1 (f x y) = x) →
  (∀ x y, g2 (f x y) = y) →
  length l1 = length l2 →
  ([∗ list] k↦xy ∈ zip_with f l1 l2, Φ1 k (g1 xy) ∗ Φ2 k (g2 xy)) ⊣⊢
  ([∗ list] k↦x ∈ l1, Φ1 k x) ∗ ([∗ list] k↦y ∈ l2, Φ2 k y).
Admitted.

Lemma big_sepL_sep_zip {A B} (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
  length l1 = length l2 →
  ([∗ list] k↦xy ∈ zip l1 l2, Φ1 k xy.1 ∗ Φ2 k xy.2) ⊣⊢
  ([∗ list] k↦x ∈ l1, Φ1 k x) ∗ ([∗ list] k↦y ∈ l2, Φ2 k y).
Admitted.

Lemma big_sepL_zip_with {A B C} (Φ : nat → A → PROP) f (l1 : list B) (l2 : list C) :
  ([∗ list] k↦x ∈ zip_with f l1 l2, Φ k x) ⊣⊢
  ([∗ list] k↦x ∈ l1, if l2 !! k is Some y then Φ k (f x y) else emp).
Admitted.

 
Lemma big_sepL2_alt {A B} (Φ : nat → A → B → PROP) l1 l2 :
  ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) ⊣⊢
  ⌜ length l1 = length l2 ⌝ ∧ [∗ list] k ↦ xy ∈ zip l1 l2, Φ k (xy.1) (xy.2).
Admitted.

Section sep_list2.
  Context {A B : Type}.
  Implicit Types Φ Ψ : nat → A → B → PROP.

  Lemma big_sepL2_nil Φ : ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2) ⊣⊢ emp.
Admitted.
  Lemma big_sepL2_nil' P `{!Affine P} Φ : P ⊢ [∗ list] k↦y1;y2 ∈ [];[], Φ k y1 y2.
Admitted.
  Lemma big_sepL2_nil_inv_l Φ l2 :
    ([∗ list] k↦y1;y2 ∈ []; l2, Φ k y1 y2) -∗ ⌜l2 = []⌝.
Admitted.
  Lemma big_sepL2_nil_inv_r Φ l1 :
    ([∗ list] k↦y1;y2 ∈ l1; [], Φ k y1 y2) -∗ ⌜l1 = []⌝.
Admitted.

  Lemma big_sepL2_cons Φ x1 x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ x1 :: l1; x2 :: l2, Φ k y1 y2)
    ⊣⊢ Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, Φ (S k) y1 y2.
Admitted.
  Lemma big_sepL2_cons_inv_l Φ x1 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ x1 :: l1; l2, Φ k y1 y2) -∗
    ∃ x2 l2', ⌜ l2 = x2 :: l2' ⌝ ∧
              Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2', Φ (S k) y1 y2.
Admitted.
  Lemma big_sepL2_cons_inv_r Φ x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; x2 :: l2, Φ k y1 y2) -∗
    ∃ x1 l1', ⌜ l1 = x1 :: l1' ⌝ ∧
              Φ 0 x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1';l2, Φ (S k) y1 y2.
Admitted.

  Lemma big_sepL2_singleton Φ x1 x2 :
    ([∗ list] k↦y1;y2 ∈ [x1];[x2], Φ k y1 y2) ⊣⊢ Φ 0 x1 x2.
Admitted.

  Lemma big_sepL2_length Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) -∗ ⌜ length l1 = length l2 ⌝.
Admitted.

  Lemma big_sepL2_fst_snd Φ l :
    ([∗ list] k↦y1;y2 ∈ l.*1; l.*2, Φ k y1 y2) ⊣⊢
    [∗ list] k ↦ xy ∈ l, Φ k (xy.1) (xy.2).
Admitted.

  Lemma big_sepL2_app Φ l1 l2 l1' l2' :
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k) y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2).
Admitted.
  Lemma big_sepL2_app_inv_l Φ l1' l1'' l2 :
    ([∗ list] k↦y1;y2 ∈ l1' ++ l1''; l2, Φ k y1 y2) -∗
    ∃ l2' l2'', ⌜ l2 = l2' ++ l2'' ⌝ ∧
                ([∗ list] k↦y1;y2 ∈ l1';l2', Φ k y1 y2) ∗
                ([∗ list] k↦y1;y2 ∈ l1'';l2'', Φ (length l1' + k) y1 y2).
Admitted.
  Lemma big_sepL2_app_inv_r Φ l1 l2' l2'' :
    ([∗ list] k↦y1;y2 ∈ l1; l2' ++ l2'', Φ k y1 y2) -∗
    ∃ l1' l1'', ⌜ l1 = l1' ++ l1'' ⌝ ∧
                ([∗ list] k↦y1;y2 ∈ l1';l2', Φ k y1 y2) ∗
                ([∗ list] k↦y1;y2 ∈ l1'';l2'', Φ (length l2' + k) y1 y2).
Admitted.
  Lemma big_sepL2_app_inv Φ l1 l2 l1' l2' :
    length l1 = length l1' ∨ length l2 = length l2' →
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) ∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k)%nat y1 y2).
Admitted.
  Lemma big_sepL2_app_same_length Φ l1 l2 l1' l2' :
    length l1 = length l1' ∨ length l2 = length l2' →
    ([∗ list] k↦y1;y2 ∈ l1 ++ l2; l1' ++ l2', Φ k y1 y2) ⊣⊢
    ([∗ list] k↦y1;y2 ∈ l1; l1', Φ k y1 y2) ∗
    ([∗ list] k↦y1;y2 ∈ l2; l2', Φ (length l1 + k)%nat y1 y2).
Admitted.

  Lemma big_sepL2_snoc Φ x1 x2 l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1 ++ [x1]; l2 ++ [x2], Φ k y1 y2) ⊣⊢
    ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2) ∗ Φ (length l1) x1 x2.
Admitted.

   
  Lemma big_sepL2_mono Φ Ψ l1 l2 :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ⊢ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ [∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.
  Lemma big_sepL2_ne Φ Ψ l1 l2 n :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ≡{n}≡ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2)%I ≡{n}≡ ([∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2)%I.
Admitted.
  Lemma big_sepL2_proper Φ Ψ l1 l2 :
    (∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → Φ k y1 y2 ⊣⊢ Ψ k y1 y2) →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢ [∗ list] k ↦ y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.
  Lemma big_sepL2_proper_2 `{!Equiv A, !Equiv B} Φ Ψ l1 l2 l1' l2' :
    l1 ≡ l1' → l2 ≡ l2' →
    (∀ k y1 y1' y2 y2',
      l1 !! k = Some y1 → l1' !! k = Some y1' → y1 ≡ y1' →
      l2 !! k = Some y2 → l2' !! k = Some y2' → y2 ≡ y2' →
      Φ k y1 y2 ⊣⊢ Ψ k y1' y2') →
    ([∗ list] k ↦ y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢ [∗ list] k ↦ y1;y2 ∈ l1';l2', Ψ k y1 y2.
Admitted.

  Global Instance big_sepL2_ne' n :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (dist n)))
      ==> (=) ==> (=) ==> (dist n))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.
  Global Instance big_sepL2_mono' :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (⊢)))
      ==> (=) ==> (=) ==> (⊢))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.
  Global Instance big_sepL2_proper' :
    Proper (pointwise_relation _ (pointwise_relation _ (pointwise_relation _ (⊣⊢)))
      ==> (=) ==> (=) ==> (⊣⊢))
           (big_sepL2 (PROP:=PROP) (A:=A) (B:=B)).
Admitted.

  Global Instance big_sepL2_nil_persistent Φ :
    Persistent ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_persistent Φ l1 l2 :
    (∀ k x1 x2, Persistent (Φ k x1 x2)) →
    Persistent ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Global Instance big_sepL2_nil_affine Φ :
    Affine ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_affine Φ l1 l2 :
    (∀ k x1 x2, Affine (Φ k x1 x2)) →
    Affine ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Global Instance big_sepL2_nil_timeless `{!Timeless (emp%I : PROP)} Φ :
    Timeless ([∗ list] k↦y1;y2 ∈ []; [], Φ k y1 y2).
Admitted.
  Global Instance big_sepL2_timeless `{!Timeless (emp%I : PROP)} Φ l1 l2 :
    (∀ k x1 x2, Timeless (Φ k x1 x2)) →
    Timeless ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2).
Admitted.

  Lemma big_sepL2_insert_acc Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢
    Φ i x1 x2 ∗ (∀ y1 y2, Φ i y1 y2 -∗ ([∗ list] k↦y1;y2 ∈ <[i:=y1]>l1;<[i:=y2]>l2, Φ k y1 y2)).
Admitted.

  Lemma big_sepL2_lookup_acc Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢
    Φ i x1 x2 ∗ (Φ i x1 x2 -∗ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2)).
Admitted.

  Lemma big_sepL2_lookup Φ l1 l2 i x1 x2
    `{!TCOr (∀ j y1 y2, Affine (Φ j y1 y2)) (Absorbing (Φ i x1 x2))} :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ Φ i x1 x2.
Admitted.

  Lemma big_sepL2_fmap_l {A'} (f : A → A') (Φ : nat → A' → B → PROP) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ f <$> l1; l2, Φ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k (f y1) y2).
Admitted.
  Lemma big_sepL2_fmap_r {B'} (g : B → B') (Φ : nat → A → B' → PROP) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1; g <$> l2, Φ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 (g y2)).
Admitted.

  Lemma big_sepL2_reverse_2 (Φ : A → B → PROP) l1 l2 :
    ([∗ list] y1;y2 ∈ l1;l2, Φ y1 y2) ⊢ ([∗ list] y1;y2 ∈ reverse l1;reverse l2, Φ y1 y2).
Admitted.
  Lemma big_sepL2_reverse (Φ : A → B → PROP) l1 l2 :
    ([∗ list] y1;y2 ∈ reverse l1;reverse l2, Φ y1 y2) ⊣⊢ ([∗ list] y1;y2 ∈ l1;l2, Φ y1 y2).
Admitted.

  Lemma big_sepL2_replicate_l l x Φ n :
    length l = n →
    ([∗ list] k↦x1;x2 ∈ replicate n x; l, Φ k x1 x2) ⊣⊢ [∗ list] k↦x2 ∈ l, Φ k x x2.
Admitted.
  Lemma big_sepL2_replicate_r l x Φ n :
    length l = n →
    ([∗ list] k↦x1;x2 ∈ l;replicate n x, Φ k x1 x2) ⊣⊢ [∗ list] k↦x1 ∈ l, Φ k x1 x.
Admitted.

  Lemma big_sepL2_sep Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∗ Ψ k y1 y2)
    ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ∗ ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_sep_2 Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∗ Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_and Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 ∧ Ψ k y1 y2)
    ⊢ ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ∧ ([∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2).
Admitted.

  Lemma big_sepL2_pure_1 (φ : nat → A → B → Prop) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ⌜φ k y1 y2⌝) ⊢@{PROP}
      ⌜∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝.
Admitted.
  Lemma big_sepL2_affinely_pure_2 (φ : nat → A → B → Prop) l1 l2 :
    length l1 = length l2 →
    <affine> ⌜∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝ ⊢@{PROP}
    ([∗ list] k↦y1;y2 ∈ l1;l2, <affine> ⌜φ k y1 y2⌝).
Admitted.
   
  Lemma big_sepL2_pure `{!BiAffine PROP} (φ : nat → A → B → Prop) l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ⌜φ k y1 y2⌝) ⊣⊢@{PROP}
      ⌜length l1 = length l2 ∧
       ∀ k y1 y2, l1 !! k = Some y1 → l2 !! k = Some y2 → φ k y1 y2⌝.
Admitted.

  Lemma big_sepL2_persistently `{!BiAffine PROP} Φ l1 l2 :
    <pers> ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2)
    ⊣⊢ [∗ list] k↦y1;y2 ∈ l1;l2, <pers> (Φ k y1 y2).
Admitted.

  Lemma big_sepL2_intro Φ l1 l2 :
    length l1 = length l2 →
    □ (∀ k x1 x2, ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2) ⊢
    [∗ list] k↦x1;x2 ∈ l1;l2, Φ k x1 x2.
Admitted.

  Lemma big_sepL2_forall `{!BiAffine PROP} Φ l1 l2 :
    (∀ k x1 x2, Persistent (Φ k x1 x2)) →
    ([∗ list] k↦x1;x2 ∈ l1;l2, Φ k x1 x2) ⊣⊢
      ⌜length l1 = length l2⌝
      ∧ (∀ k x1 x2, ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2).
Admitted.

  Lemma big_sepL2_impl Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    □ (∀ k x1 x2,
      ⌜l1 !! k = Some x1⌝ → ⌜l2 !! k = Some x2⌝ → Φ k x1 x2 -∗ Ψ k x1 x2) -∗
    [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_wand Φ Ψ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2 -∗ Ψ k y1 y2) -∗
    [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_delete Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢
    Φ i x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, if decide (k = i) then emp else Φ k y1 y2.
Admitted.
  Lemma big_sepL2_delete' `{!BiAffine PROP} Φ l1 l2 i x1 x2 :
    l1 !! i = Some x1 → l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊣⊢
    Φ i x1 x2 ∗ [∗ list] k↦y1;y2 ∈ l1;l2, ⌜ k ≠ i ⌝ → Φ k y1 y2.
Admitted.

  Lemma big_sepL2_lookup_acc_impl {Φ l1 l2} i x1 x2 :
    l1 !! i = Some x1 →
    l2 !! i = Some x2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) -∗
     
    Φ i x1 x2 ∗
     
    ∀ Ψ,
      □ (∀ k y1 y2,
        ⌜ l1 !! k = Some y1 ⌝ → ⌜ l2 !! k = Some y2 ⌝ → ⌜ k ≠ i ⌝ →
        Φ k y1 y2 -∗ Ψ k y1 y2) -∗
      Ψ i x1 x2 -∗
      [∗ list] k↦y1;y2 ∈ l1;l2, Ψ k y1 y2.
Admitted.

  Lemma big_sepL2_later_1 `{!BiAffine PROP} Φ l1 l2 :
    (▷ [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2) ⊢ ◇ [∗ list] k↦y1;y2 ∈ l1;l2, ▷ Φ k y1 y2.
Admitted.

  Lemma big_sepL2_later_2 Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ▷ Φ k y1 y2) ⊢ ▷ [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2.
Admitted.

  Lemma big_sepL2_laterN_2 Φ n l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l1;l2, ▷^n Φ k y1 y2) ⊢ ▷^n [∗ list] k↦y1;y2 ∈ l1;l2, Φ k y1 y2.
Admitted.

  Lemma big_sepL2_flip Φ l1 l2 :
    ([∗ list] k↦y1;y2 ∈ l2; l1, Φ k y2 y1) ⊣⊢ ([∗ list] k↦y1;y2 ∈ l1; l2, Φ k y1 y2).
Admitted.

  Lemma big_sepL2_sepL (Φ1 : nat → A → PROP) (Φ2 : nat → B → PROP) l1 l2 :
    length l1 = length l2 →
    ([∗ list] k↦y1;y2 ∈ l1;l2, Φ1 k y1 ∗ Φ2 k y2) ⊣⊢
    ([∗ list] k↦y1 ∈ l1, Φ1 k y1) ∗ ([∗ list] k↦y2 ∈ l2, Φ2 k y2).
Admitted.
  Lemma bi
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 530KiB file on GitHub Actions Artifacts under build.log)
fs/pull/9852/head  -> origin/pr/9852
 * [new ref]               refs/pull/9853/head  -> origin/pr/9853
 * [new ref]               refs/pull/9854/head  -> origin/pr/9854
 * [new ref]               refs/pull/9855/head  -> origin/pr/9855
 * [new ref]               refs/pull/9856/head  -> origin/pr/9856
 * [new ref]               refs/pull/9858/head  -> origin/pr/9858
 * [new ref]               refs/pull/9859/head  -> origin/pr/9859
 * [new ref]               refs/pull/986/head   -> origin/pr/986
 * [new ref]               refs/pull/9860/head  -> origin/pr/9860
 * [new ref]               refs/pull/9861/head  -> origin/pr/9861
 * [new ref]               refs/pull/9864/head  -> origin/pr/9864
 * [new ref]               refs/pull/9866/head  -> origin/pr/9866
 * [new ref]               refs/pull/9867/head  -> origin/pr/9867
 * [new ref]               refs/pull/9869/head  -> origin/pr/9869
 * [new ref]               refs/pull/987/head   -> origin/pr/987
 * [new ref]               refs/pull/9870/head  -> origin/pr/9870
 * [new ref]               refs/pull/9871/head  -> origin/pr/9871
 * [new ref]               refs/pull/9872/head  -> origin/pr/9872
 * [new ref]               refs/pull/9873/head  -> origin/pr/9873
 * [new ref]               refs/pull/9874/head  -> origin/pr/9874
 * [new ref]               refs/pull/9875/head  -> origin/pr/9875
 * [new ref]               refs/pull/9876/head  -> origin/pr/9876
 * [new ref]               refs/pull/9878/head  -> origin/pr/9878
 * [new ref]               refs/pull/988/head   -> origin/pr/988
 * [new ref]               refs/pull/9880/head  -> origin/pr/9880
 * [new ref]               refs/pull/9881/head  -> origin/pr/9881
 * [new ref]               refs/pull/9882/head  -> origin/pr/9882
 * [new ref]               refs/pull/9883/head  -> origin/pr/9883
 * [new ref]               refs/pull/9884/head  -> origin/pr/9884
 * [new ref]               refs/pull/9887/head  -> origin/pr/9887
 * [new ref]               refs/pull/9889/head  -> origin/pr/9889
 * [new ref]               refs/pull/989/head   -> origin/pr/989
 * [new ref]               refs/pull/9890/head  -> origin/pr/9890
 * [new ref]               refs/pull/9891/head  -> origin/pr/9891
 * [new ref]               refs/pull/9895/head  -> origin/pr/9895
 * [new ref]               refs/pull/9896/head  -> origin/pr/9896
 * [new ref]               refs/pull/9897/head  -> origin/pr/9897
 * [new ref]               refs/pull/9898/head  -> origin/pr/9898
 * [new ref]               refs/pull/99/head    -> origin/pr/99
 * [new ref]               refs/pull/990/head   -> origin/pr/990
 * [new ref]               refs/pull/9900/head  -> origin/pr/9900
 * [new ref]               refs/pull/9901/head  -> origin/pr/9901
 * [new ref]               refs/pull/9903/head  -> origin/pr/9903
 * [new ref]               refs/pull/9904/head  -> origin/pr/9904
 * [new ref]               refs/pull/9905/head  -> origin/pr/9905
 * [new ref]               refs/pull/9906/head  -> origin/pr/9906
 * [new ref]               refs/pull/9908/head  -> origin/pr/9908
 * [new ref]               refs/pull/9909/head  -> origin/pr/9909
 * [new ref]               refs/pull/991/head   -> origin/pr/991
 * [new ref]               refs/pull/9910/head  -> origin/pr/9910
 * [new ref]               refs/pull/9914/head  -> origin/pr/9914
 * [new ref]               refs/pull/9915/head  -> origin/pr/9915
 * [new ref]               refs/pull/9917/head  -> origin/pr/9917
 * [new ref]               refs/pull/9918/head  -> origin/pr/9918
 * [new ref]               refs/pull/992/head   -> origin/pr/992
 * [new ref]               refs/pull/9923/head  -> origin/pr/9923
 * [new ref]               refs/pull/9924/head  -> origin/pr/9924
 * [new ref]               refs/pull/9925/head  -> origin/pr/9925
 * [new ref]               refs/pull/9926/head  -> origin/pr/9926
 * [new ref]               refs/pull/9927/head  -> origin/pr/9927
 * [new ref]               refs/pull/9928/head  -> origin/pr/9928
 * [new ref]               refs/pull/993/head   -> origin/pr/993
 * [new ref]               refs/pull/9931/head  -> origin/pr/9931
 * [new ref]               refs/pull/9933/head  -> origin/pr/9933
 * [new ref]               refs/pull/9935/head  -> origin/pr/9935
 * [new ref]               refs/pull/9938/head  -> origin/pr/9938
 * [new ref]               refs/pull/9939/head  -> origin/pr/9939
 * [new ref]               refs/pull/994/head   -> origin/pr/994
 * [new ref]               refs/pull/9941/head  -> origin/pr/9941
 * [new ref]               refs/pull/9943/head  -> origin/pr/9943
 * [new ref]               refs/pull/9946/head  -> origin/pr/9946
 * [new ref]               refs/pull/9947/head  -> origin/pr/9947
 * [new ref]               refs/pull/9949/head  -> origin/pr/9949
 * [new ref]               refs/pull/995/head   -> origin/pr/995
 * [new ref]               refs/pull/9952/head  -> origin/pr/9952
 * [new ref]               refs/pull/9953/head  -> origin/pr/9953
 * [new ref]               refs/pull/9957/head  -> origin/pr/9957
 * [new ref]               refs/pull/9959/head  -> origin/pr/9959
 * [new ref]               refs/pull/996/head   -> origin/pr/996
 * [new ref]               refs/pull/9961/head  -> origin/pr/9961
 * [new ref]               refs/pull/9962/head  -> origin/pr/9962
 * [new ref]               refs/pull/9963/head  -> origin/pr/9963
 * [new ref]               refs/pull/9964/head  -> origin/pr/9964
 * [new ref]               refs/pull/9966/head  -> origin/pr/9966
 * [new ref]               refs/pull/9968/head  -> origin/pr/9968
 * [new ref]               refs/pull/997/head   -> origin/pr/997
 * [new ref]               refs/pull/9972/head  -> origin/pr/9972
 * [new ref]               refs/pull/9973/head  -> origin/pr/9973
 * [new ref]               refs/pull/9977/head  -> origin/pr/9977
 * [new ref]               refs/pull/9978/head  -> origin/pr/9978
 * [new ref]               refs/pull/998/head   -> origin/pr/998
 * [new ref]               refs/pull/9980/head  -> origin/pr/9980
 * [new ref]               refs/pull/9981/head  -> origin/pr/9981
 * [new ref]               refs/pull/9982/head  -> origin/pr/9982
 * [new ref]               refs/pull/9983/head  -> origin/pr/9983
 * [new ref]               refs/pull/9984/head  -> origin/pr/9984
 * [new ref]               refs/pull/9985/head  -> origin/pr/9985
 * [new ref]               refs/pull/9987/head  -> origin/pr/9987
 * [new ref]               refs/pull/9988/head  -> origin/pr/9988
 * [new ref]               refs/pull/9989/head  -> origin/pr/9989
 * [new ref]               refs/pull/999/head   -> origin/pr/999
 * [new ref]               refs/pull/9990/head  -> origin/pr/9990
 * [new ref]               refs/pull/9995/head  -> origin/pr/9995
 * [new ref]               refs/pull/9996/head  -> origin/pr/9996
 * [new ref]               refs/pull/9997/head  -> origin/pr/9997
 * [new ref]               refs/pull/9998/head  -> origin/pr/9998
 * [new ref]               refs/pull/9999/head  -> origin/pr/9999
++ cp -a coq coq-failing
++ cp -a coq coq-passing
++ echo ::endgroup::
::endgroup::
++ echo '::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download'
::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download
++ echo '::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download'
::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download
++ pushd coq-failing
/github/workspace/builds/coq/coq-failing /github/workspace/builds/coq /github/workspace
++ git checkout 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
fatal: reference is not a tree: 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
Minimization Log (truncated to last 8.0KiB; full 541KiB file on GitHub Actions Artifacts under bug.log)
fs/pull/9852/head  -> origin/pr/9852
 * [new ref]               refs/pull/9853/head  -> origin/pr/9853
 * [new ref]               refs/pull/9854/head  -> origin/pr/9854
 * [new ref]               refs/pull/9855/head  -> origin/pr/9855
 * [new ref]               refs/pull/9856/head  -> origin/pr/9856
 * [new ref]               refs/pull/9858/head  -> origin/pr/9858
 * [new ref]               refs/pull/9859/head  -> origin/pr/9859
 * [new ref]               refs/pull/986/head   -> origin/pr/986
 * [new ref]               refs/pull/9860/head  -> origin/pr/9860
 * [new ref]               refs/pull/9861/head  -> origin/pr/9861
 * [new ref]               refs/pull/9864/head  -> origin/pr/9864
 * [new ref]               refs/pull/9866/head  -> origin/pr/9866
 * [new ref]               refs/pull/9867/head  -> origin/pr/9867
 * [new ref]               refs/pull/9869/head  -> origin/pr/9869
 * [new ref]               refs/pull/987/head   -> origin/pr/987
 * [new ref]               refs/pull/9870/head  -> origin/pr/9870
 * [new ref]               refs/pull/9871/head  -> origin/pr/9871
 * [new ref]               refs/pull/9872/head  -> origin/pr/9872
 * [new ref]               refs/pull/9873/head  -> origin/pr/9873
 * [new ref]               refs/pull/9874/head  -> origin/pr/9874
 * [new ref]               refs/pull/9875/head  -> origin/pr/9875
 * [new ref]               refs/pull/9876/head  -> origin/pr/9876
 * [new ref]               refs/pull/9878/head  -> origin/pr/9878
 * [new ref]               refs/pull/988/head   -> origin/pr/988
 * [new ref]               refs/pull/9880/head  -> origin/pr/9880
 * [new ref]               refs/pull/9881/head  -> origin/pr/9881
 * [new ref]               refs/pull/9882/head  -> origin/pr/9882
 * [new ref]               refs/pull/9883/head  -> origin/pr/9883
 * [new ref]               refs/pull/9884/head  -> origin/pr/9884
 * [new ref]               refs/pull/9887/head  -> origin/pr/9887
 * [new ref]               refs/pull/9889/head  -> origin/pr/9889
 * [new ref]               refs/pull/989/head   -> origin/pr/989
 * [new ref]               refs/pull/9890/head  -> origin/pr/9890
 * [new ref]               refs/pull/9891/head  -> origin/pr/9891
 * [new ref]               refs/pull/9895/head  -> origin/pr/9895
 * [new ref]               refs/pull/9896/head  -> origin/pr/9896
 * [new ref]               refs/pull/9897/head  -> origin/pr/9897
 * [new ref]               refs/pull/9898/head  -> origin/pr/9898
 * [new ref]               refs/pull/99/head    -> origin/pr/99
 * [new ref]               refs/pull/990/head   -> origin/pr/990
 * [new ref]               refs/pull/9900/head  -> origin/pr/9900
 * [new ref]               refs/pull/9901/head  -> origin/pr/9901
 * [new ref]               refs/pull/9903/head  -> origin/pr/9903
 * [new ref]               refs/pull/9904/head  -> origin/pr/9904
 * [new ref]               refs/pull/9905/head  -> origin/pr/9905
 * [new ref]               refs/pull/9906/head  -> origin/pr/9906
 * [new ref]               refs/pull/9908/head  -> origin/pr/9908
 * [new ref]               refs/pull/9909/head  -> origin/pr/9909
 * [new ref]               refs/pull/991/head   -> origin/pr/991
 * [new ref]               refs/pull/9910/head  -> origin/pr/9910
 * [new ref]               refs/pull/9914/head  -> origin/pr/9914
 * [new ref]               refs/pull/9915/head  -> origin/pr/9915
 * [new ref]               refs/pull/9917/head  -> origin/pr/9917
 * [new ref]               refs/pull/9918/head  -> origin/pr/9918
 * [new ref]               refs/pull/992/head   -> origin/pr/992
 * [new ref]               refs/pull/9923/head  -> origin/pr/9923
 * [new ref]               refs/pull/9924/head  -> origin/pr/9924
 * [new ref]               refs/pull/9925/head  -> origin/pr/9925
 * [new ref]               refs/pull/9926/head  -> origin/pr/9926
 * [new ref]               refs/pull/9927/head  -> origin/pr/9927
 * [new ref]               refs/pull/9928/head  -> origin/pr/9928
 * [new ref]               refs/pull/993/head   -> origin/pr/993
 * [new ref]               refs/pull/9931/head  -> origin/pr/9931
 * [new ref]               refs/pull/9933/head  -> origin/pr/9933
 * [new ref]               refs/pull/9935/head  -> origin/pr/9935
 * [new ref]               refs/pull/9938/head  -> origin/pr/9938
 * [new ref]               refs/pull/9939/head  -> origin/pr/9939
 * [new ref]               refs/pull/994/head   -> origin/pr/994
 * [new ref]               refs/pull/9941/head  -> origin/pr/9941
 * [new ref]               refs/pull/9943/head  -> origin/pr/9943
 * [new ref]               refs/pull/9946/head  -> origin/pr/9946
 * [new ref]               refs/pull/9947/head  -> origin/pr/9947
 * [new ref]               refs/pull/9949/head  -> origin/pr/9949
 * [new ref]               refs/pull/995/head   -> origin/pr/995
 * [new ref]               refs/pull/9952/head  -> origin/pr/9952
 * [new ref]               refs/pull/9953/head  -> origin/pr/9953
 * [new ref]               refs/pull/9957/head  -> origin/pr/9957
 * [new ref]               refs/pull/9959/head  -> origin/pr/9959
 * [new ref]               refs/pull/996/head   -> origin/pr/996
 * [new ref]               refs/pull/9961/head  -> origin/pr/9961
 * [new ref]               refs/pull/9962/head  -> origin/pr/9962
 * [new ref]               refs/pull/9963/head  -> origin/pr/9963
 * [new ref]               refs/pull/9964/head  -> origin/pr/9964
 * [new ref]               refs/pull/9966/head  -> origin/pr/9966
 * [new ref]               refs/pull/9968/head  -> origin/pr/9968
 * [new ref]               refs/pull/997/head   -> origin/pr/997
 * [new ref]               refs/pull/9972/head  -> origin/pr/9972
 * [new ref]               refs/pull/9973/head  -> origin/pr/9973
 * [new ref]               refs/pull/9977/head  -> origin/pr/9977
 * [new ref]               refs/pull/9978/head  -> origin/pr/9978
 * [new ref]               refs/pull/998/head   -> origin/pr/998
 * [new ref]               refs/pull/9980/head  -> origin/pr/9980
 * [new ref]               refs/pull/9981/head  -> origin/pr/9981
 * [new ref]               refs/pull/9982/head  -> origin/pr/9982
 * [new ref]               refs/pull/9983/head  -> origin/pr/9983
 * [new ref]               refs/pull/9984/head  -> origin/pr/9984
 * [new ref]               refs/pull/9985/head  -> origin/pr/9985
 * [new ref]               refs/pull/9987/head  -> origin/pr/9987
 * [new ref]               refs/pull/9988/head  -> origin/pr/9988
 * [new ref]               refs/pull/9989/head  -> origin/pr/9989
 * [new ref]               refs/pull/999/head   -> origin/pr/999
 * [new ref]               refs/pull/9990/head  -> origin/pr/9990
 * [new ref]               refs/pull/9995/head  -> origin/pr/9995
 * [new ref]               refs/pull/9996/head  -> origin/pr/9996
 * [new ref]               refs/pull/9997/head  -> origin/pr/9997
 * [new ref]               refs/pull/9998/head  -> origin/pr/9998
 * [new ref]               refs/pull/9999/head  -> origin/pr/9999
++ cp -a coq coq-failing
++ cp -a coq coq-passing
++ echo ::endgroup::
::endgroup::
++ echo '::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download'
::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download
++ echo '::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download'
::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735834/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736161/artifacts/download
++ pushd coq-failing
/github/workspace/builds/coq/coq-failing /github/workspace/builds/coq /github/workspace
++ git checkout 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
fatal: reference is not a tree: 59b2ccd29842ac23e2ed412feb69b87c1c8664e1

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 5, 2023

Minimized File (from ci-metacoq) (full log on GitHub Actions)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

Minimized Coq File (truncated to 32KiB; full 75KiB file on GitHub Actions Artifacts under bug.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/utils/theories" "MetaCoq.Utils" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/common/theories" "MetaCoq.Common" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/metacoq/pcuic/theories" "MetaCoq.PCUIC" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Equations" "Equations" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Top.bug_01") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 790 lines to 51 lines, then from 64 lines to 859 lines, then from 864 lines to 91 lines, then from 104 lines to 1730 lines, then from 1735 lines to 363 lines, then from 376 lines to 2672 lines, then from 2674 lines to 453 lines, then from 466 lines to 1362 lines, then from 1366 lines to 615 lines, then from 628 lines to 1040 lines, then from 1045 lines to 617 lines, then from 630 lines to 2427 lines, then from 2426 lines to 628 lines, then from 641 lines to 2534 lines, then from 2538 lines to 1165 lines, then from 1158 lines to 803 lines, then from 816 lines to 1405 lines, then from 1408 lines to 926 lines, then from 939 lines to 2156 lines, then from 2155 lines to 942 lines, then from 955 lines to 2414 lines, then from 2415 lines to 1198 lines, then from 1211 lines to 1468 lines, then from 1473 lines to 1212 lines, then from 1230 lines to 1207 lines, then from 1220 lines to 1789 lines, then from 1791 lines to 1209 lines, then from 1222 lines to 3254 lines, then from 3255 lines to 1406 lines, then from 1419 lines to 2544 lines, then from 2551 lines to 1534 lines, then from 1547 lines to 4356 lines, then from 4332 lines to 1932 lines, then from 1925 lines to 1866 lines, then from 1879 lines to 1970 lines, then from 1975 lines to 1875 lines, then from 1888 lines to 1978 lines, then from 1983 lines to 1878 lines, then from 1891 lines to 2768 lines, then from 2770 lines to 1957 lines, then from 1970 lines to 2562 lines, then from 2567 lines to 2409 lines, then from 2401 lines to 2025 lines, then from 2038 lines to 2169 lines, then from 2174 lines to 2040 lines, then from 2053 lines to 2364 lines, then from 2367 lines to 2060 lines, then from 2073 lines to 6067 lines, then from 6062 lines to 6634 lines, then from 6601 lines to 2095 lines, then from 2108 lines to 2382 lines, then from 2384 lines to 2334 lines, then from 2337 lines to 2104 lines, then from 2117 lines to 3644 lines, then from 3642 lines to 2122 lines, then from 2135 lines to 2311 lines, then from 2316 lines to 2133 lines, then from 2146 lines to 2374 lines, then from 2376 lines to 2134 lines, then from 2147 lines to 2294 lines, then from 2298 lines to 2257 lines *)
(* coqc version 8.18+alpha compiled with OCaml 4.09.0
   coqtop version runner-5nczbzj5-project-6138686-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 69a2874a4b) (69a2874a4bfab2dd4f363143378d7a21d9413771)
   Expected coqc runtime on this file: 2.691 sec *)
Require Coq.Init.Ltac.
Require Coq.Floats.FloatOps.
Require Coq.MSets.MSetAVL.
Require Coq.MSets.MSetList.
Require Coq.Strings.String.
Require Coq.ssr.ssrbool.
Require Coq.ssr.ssreflect.
Require Coq.NArith.NArith.
Require Coq.micromega.Lia.
Require Coq.extraction.Extraction.
Require Coq.Unicode.Utf8_core.
Require Equations.Init.
Require Equations.Signature.
Require Equations.CoreTactics.
Require Coq.Relations.Relation_Definitions.
Require Equations.Prop.Logic.
Require Equations.Prop.Classes.
Require Coq.Program.Tactics.
Require Equations.Prop.EqDec.
Require Equations.Prop.DepElim.
Require Coq.Relations.Relations.
Require Equations.Prop.Constants.
Require Coq.Bool.Bvector.
Require Coq.Lists.List.
Require Coq.Arith.Wf_nat.
Require Coq.Wellfounded.Wellfounded.
Require Coq.Relations.Relation_Operators.
Require Coq.Wellfounded.Lexicographic_Product.
Require Coq.Program.Wf.
Require Coq.Logic.FunctionalExtensionality.
Require Equations.Prop.Subterm.
Require Equations.Prop.FunctionalInduction.
Require Equations.Prop.Tactics.
Require Equations.Prop.NoConfusion.
Require Equations.Prop.EqDecInstances.
Require Equations.Prop.Loader.
Require Equations.Prop.Telescopes.
Require Equations.Prop.Equations.
Require Coq.Structures.OrderedType.
Require Coq.Structures.Orders.
Require MetaCoq.Utils.MCCompare.
Require MetaCoq.Utils.ReflectEq.
Require Coq.Strings.Byte.
Require Coq.NArith.BinNat.
Require MetaCoq.Utils.ByteCompare.
Require MetaCoq.Utils.ByteCompareSpec.
Require Coq.Structures.OrdersAlt.
Require MetaCoq.Utils.bytestring.
Require Coq.Bool.Bool.
Require Coq.Classes.CRelationClasses.
Require Coq.Classes.RelationClasses.

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.

Module Export MetaCoq_DOT_Utils_DOT_MCProd_WRAPPED.
Module Export MCProd.
Import Coq.Bool.Bool.
Import Coq.Classes.RelationClasses.
Import Coq.ssr.ssreflect.
Import Coq.Classes.CRelationClasses.

Local Coercion is_true : bool >-> Sortclass.

Declare Scope pair_scope.

Notation "p .1" := (fst p)
  (at level 2, left associativity, format "p .1") : pair_scope.
Notation "p .2" := (snd p)
  (at level 2, left associativity, format "p .2") : pair_scope.
Open Scope pair_scope.

Notation "x × y" := (prod x y ) (at level 80, right associativity).
Definition proj1 {A B} (x : A /\ B) : A. exact (let (a, b) := x in a). Defined.
Definition proj2 {A B} (x : A /\ B) : B. exact (let (a, b) := x in b). Defined.

Notation "p .p1" := (proj1 p) (at level 2, left associativity, format "p .p1").
Notation "p .p2" := (proj2 p) (at level 2, left associativity, format "p .p2").

Definition on_snd {A B C} (f : B -> C) (p : A * B) :=
  (fst p, f (snd p)).

Definition test_snd {A B} (f : B -> bool) (p : A * B) :=
  f (snd p).
Definition map_pair {A B C D} (f : A -> B) (g : C -> D) (p : A × C) : B × D. exact ((f p.1, g p.2)). Defined.

Lemma on_snd_on_snd {A B C D} (f : C -> D) (g : B -> C) (d : A * B) :
  on_snd f (on_snd g d) = on_snd (fun x => f (g x)) d.
Admitted.

Lemma snd_on_snd {A B C} (f : B -> C) (p : A * B) : snd (on_snd f p) = f (snd p).
Admitted.

Lemma compose_on_snd {A B C D} (f : C -> D) (g : B -> C) :
  (fun (x : A * B) => (on_snd f) (on_snd g x)) = on_snd (fun x => f (g x)).
Admitted.

Lemma on_snd_eq_spec {A B C} (f g : B -> C) (x : A * B) :
  f (snd x) = g (snd x) <->
  on_snd f x = on_snd g x.
Admitted.
Definition on_pi2 {A B C} (f : B -> B) (p : A * B * C) : A * B * C. exact ((fst (fst p), f (snd (fst p)), snd p)). Defined.

 
Lemma andb_and b b' : b && b' <-> b /\ b'.
Admitted.

Lemma andb_andI {b b'} : b && b' -> b /\ b'.
Admitted.

Definition fst_eq {A B} {x x' : A} {y y' : B}
  : (x, y) = (x', y') -> x = x'.
Admitted.

Definition snd_eq {A B} {x x' : A} {y y' : B}
  : (x, y) = (x', y') -> y = y'.
Admitted.

End MCProd.
Module Export MetaCoq.
Module Export Utils.
Module Export MCProd.
Include MetaCoq_DOT_Utils_DOT_MCProd_WRAPPED.MCProd.
End MCProd.

Notation on_Trel_eq R f g :=
  (fun x y => (R (f x) (f y) * (g x = g y)))%type.

Coercion is_true : bool >-> Sortclass.

Notation "'eta_compose'" := (fun g f x => g (f x)).

Notation "g ∘ f" := (eta_compose g f) (at level 40, left associativity).

Notation "'∑' x .. y , p" := (sigT (fun x => .. (sigT (fun y => p%type)) ..))
  (at level 200, x binder, right associativity,
   format "'[' '∑'  '/  ' x  ..  y ,  '/  ' p ']'")
  : type_scope.
Notation "x .π1" := (@projT1 _ _ x) (at level 3, format "x '.π1'").
Ltac tea := try eassumption.
Import Coq.Lists.SetoidList.

Export ListNotations.

Notation "#| l |" := (List.length l) (at level 0, l at level 99, format "#| l |").

Fixpoint mapi_rec {A B} (f : nat -> A -> B) (l : list A) (n : nat) : list B :=
  match l with
  | [] => []
  | hd :: tl => f n hd :: mapi_rec f tl (S n)
  end.

Definition mapi {A B} (f : nat -> A -> B) (l : list A) := mapi_rec f l 0.

Fixpoint map2 {A B C} (f : A -> B -> C) (l : list A) (l' : list B) : list C :=
  match l, l' with
  | hd :: tl, hd' :: tl' => f hd hd' :: map2 f tl tl'
  | _, _ => []
  end.

Fixpoint map_option_out {A} (l : list (option A)) : option (list A) :=
  match l with
  | nil => Some nil
  | hd :: tl => match hd, map_option_out tl with
                | Some hd, Some tl => Some (hd :: tl)
                | _, _ => None
                end
  end.

Inductive All {A} (P : A -> Type) : list A -> Type :=
    All_nil : All P []
  | All_cons : forall (x : A) (l : list A),
                  P x -> All P l -> All P (x :: l).

Inductive All2 {A B : Type} (R : A -> B -> Type) : list A -> list B -> Type :=
  All2_nil : All2 R [] []
| All2_cons : forall (x : A) (y : B) (l : list A) (l' : list B),
    R x y -> All2 R l l' -> All2 R (x :: l) (y :: l').

Inductive All2i {A B : Type} (R : nat -> A -> B -> Type) (n : nat)
  : list A -> list B -> Type :=
| All2i_nil : All2i R n [] []
| All2i_cons :
    forall x y l r,
      R n x y ->
      All2i R (S n) l r ->
      All2i R n (x :: l) (y :: r).

Section alli.
  Context {A} (p : nat -> A -> bool).
Fixpoint alli (n : nat) (l : list A) : bool.
Admitted.
End alli.

Inductive OnOne2 {A : Type} (P : A -> A -> Type) : list A -> list A -> Type :=
| OnOne2_hd hd hd' tl : P hd hd' -> OnOne2 P (hd :: tl) (hd' :: tl)
| OnOne2_tl hd tl tl' : OnOne2 P tl tl' -> OnOne2 P (hd :: tl) (hd :: tl').

Definition size := nat.

Inductive All2_fold {A} (P : list A -> list A -> A -> A -> Type)
            : list A -> list A -> Type :=
| All2_fold_nil : All2_fold P nil nil
| All2_fold_cons {d d' Γ Γ'} : All2_fold P Γ Γ' -> P Γ Γ' d d' -> All2_fold P (d :: Γ) (d' :: Γ').

Module Export MetaCoq_DOT_Utils_DOT_MCUtils_WRAPPED.
Module Export MCUtils.
Export MetaCoq.Utils.MCCompare.
Export MetaCoq.Utils.MCProd.
Export MetaCoq.Utils.ReflectEq.
Export MetaCoq.Utils.bytestring.

End MCUtils.
Module Export MetaCoq.
Module Export Utils.
Module Export MCUtils.
Include MetaCoq_DOT_Utils_DOT_MCUtils_WRAPPED.MCUtils.
End MCUtils.

Module Export MetaCoq_DOT_Utils_DOT_utils_WRAPPED.
Module Export utils.
Export Coq.ZArith.ZArith.
Export Coq.micromega.Lia.
Export MetaCoq.Utils.MCUtils.
Notation "A * B" := (prod A B) : type_scope2.
Global Open Scope type_scope2.

End utils.
Module Export MetaCoq.
Module Export Utils.
Module Export utils.
Include MetaCoq_DOT_Utils_DOT_utils_WRAPPED.utils.
End utils.

Definition ident   := string.

Definition dirpath := list ident.

Module IdentOT := StringOT.

Module DirPathOT := ListOrderedType IdentOT.

Inductive modpath :=
| MPfile  (dp : dirpath)
| MPbound (dp : dirpath) (id : ident) (i : nat)
| MPdot   (mp : modpath) (id : ident).

Definition kername := modpath × ident.

Module Export ModPathComp.

  Definition mpbound_compare dp id k dp' id' k' :=
    compare_cont (DirPathOT.compare dp dp')
      (compare_cont (IdentOT.compare id id') (Nat.compare k k')).

  Fixpoint compare mp mp' :=
    match mp, mp' with
    | MPfile dp, MPfile dp' => DirPathOT.compare dp dp'
    | MPbound dp id k, MPbound dp' id' k' =>
      mpbound_compare dp id k dp' id' k'
    | MPdot mp id, MPdot mp' id' =>
      compare_cont (compare mp mp') (IdentOT.compare id id')
    | MPfile _, _ => Gt
    | _, MPfile _ => Lt
    | MPbound _ _ _, _ => Gt
    | _, MPbound _ _ _ => Lt
    end.

End ModPathComp.

  Definition compare kn kn' :=
    match kn, kn' with
    | (mp, id), (mp', id') =>
      compare_cont (ModPathComp.compare mp mp') (IdentOT.compare id id')
    end.

  Definition eqb kn kn' :=
    match compare kn kn' with
    | Eq => true
    | _ => false
    end.

  #[global, program] Instance reflect_kername : ReflectEq kername := {
    eqb := eqb
  }.
Admit Obligations.

Record inductive : Set := mkInd { inductive_mind : kername ;
                                  inductive_ind : nat }.

Record projection := mkProjection
  { proj_ind : inductive;
    proj_npars : nat;
    proj_arg : nat   }.

Inductive global_reference :=
| VarRef : ident -> global_reference
| ConstRef : kername -> global_reference
| IndRef : inductive -> global_reference
| ConstructRef : inductive -> nat -> global_reference.
Module Export BasicAst.

Inductive name : Set :=
| nAnon
| nNamed (_ : ident).

Inductive relevance : Set := Relevant | Irrelevant.

Record binder_annot (A : Type) := mkBindAnn { binder_name : A; binder_relevance : relevance }.
Definition eq_binder_annot {A B} (b : binder_annot A) (b' : binder_annot B) : Prop.
Admitted.

Definition aname := binder_annot name.

Record case_info := mk_case_info {
  ci_ind : inductive;
  ci_npar : nat;

  ci_relevance : relevance }.

Inductive recursivity_kind :=
  | Finite
  | CoFinite
  | BiFinite  .

Inductive conv_pb :=
  | Conv
  | Cumul.

Record def term := mkdef {
  dname : aname;
  dtype : term;
  dbody : term;
  rarg  : nat    }.

Arguments dname {term} _.
Arguments dtype {term} _.
Arguments dbody {term} _.
Arguments rarg {term} _.

Definition map_def {A B} (tyf bodyf : A -> B) (d : def A) :=
  {| dname := d.(dname); dtype := tyf d.(dtype); dbody := bodyf d.(dbody); rarg := d.(rarg) |}.

Definition mfixpoint term := list (def term).

Variant typ_or_sort_ {term} := Typ (T : term) | Sort.
Arguments typ_or_sort_ : clear implicits.

Section Contexts.
  Context {term : Type}.

  Record context_decl := mkdecl {
    decl_name : aname ;
    decl_body : option term ;
    decl_type : term
  }.
End Contexts.

Arguments context_decl : clear implicits.
Definition map_decl {term term'} (f : term -> term') (d : context_decl term) : context_decl term'.
Admitted.
Definition test_decl {term} (f : term -> bool) (d : context_decl term) : bool.
Admitted.

Definition snoc {A} (Γ : list A) (d : A) := d :: Γ.

Notation " Γ ,, d " := (snoc Γ d) (at level 20, d at next level).

Section Contexts.
  Context {term term' term'' : Type}.

  Definition fold_context_k (f : nat -> term -> term') Γ :=
    List.rev (mapi (fun k' decl => map_decl (f k') decl) (List.rev Γ)).
Definition forget_types (c : list (BasicAst.context_decl term)) : list aname.
admit.
Defined.

End Contexts.

Variant prim_tag :=
  | primInt
  | primFloat.

Class checker_flags := {

  check_univs : bool ;

  prop_sub_type : bool ;

  indices_matter : bool ;

  lets_in_constructor_types : bool
}.
Module Export Universes.
Import Coq.MSets.MSetList.
Import MetaCoq.Utils.utils.

Record valuation :=
  { valuation_mono : string -> positive ;
    valuation_poly : nat -> nat }.

Class Evaluable (A : Type) := val : valuation -> A -> nat.

Module Level.
  Inductive t_ : Set :=
  | lzero
  | level (_ : string)
  | lvar (_ : nat)  .

  Definition t := t_.
Global Instance Evaluable : Evaluable t.
Admitted.
Definition compare (l1 l2 : t) : comparison.
Admitted.
Definition eq : t -> t -> Prop.
exact (eq).
Defined.
Definition eq_equiv : Equivalence eq.
Admitted.

  Inductive lt_ : t -> t -> Prop :=
  | ltSetLevel s : lt_ lzero (level s)
  | ltSetlvar n : lt_ lzero (lvar n)
  | ltLevelLevel s s' : StringOT.lt s s' -> lt_ (level s) (level s')
  | ltLevellvar s n : lt_ (level s) (lvar n)
  | ltlvarlvar n n' : Nat.lt n n' -> lt_ (lvar n) (lvar n').

  Definition lt := lt_.

  Definition lt_strorder : StrictOrder lt.
Admitted.

  Definition lt_compat : Proper (eq ==> eq ==> iff) lt.
Admitted.

  Definition compare_spec :
    forall x y : t, CompareSpec (x = y) (lt x y) (lt y x) (compare x y).
Admitted.
Definition eq_dec : forall (l1 l2 : t), {l1 = l2}+{l1 <> l2}.
Admitted.

End Level.

Module LevelSet := MSetAVL.Make Level.

Module LevelExpr.

  Definition t := (Level.t * nat)%type.
Definition get_level (e : t) : Level.t.
Admitted.
Definition eq : t -> t -> Prop.
exact (eq).
Defined.
Definition eq_equiv : Equivalence eq.
Admitted.

  Inductive lt_ : t -> t -> Prop :=
  | ltLevelExpr1 l n n' : (n < n')%nat -> lt_ (l, n) (l, n')
  | ltLevelExpr2 l l' b b' : Level.lt l l' -> lt_ (l, b) (l', b').

  Definition lt := lt_.

  Global Instance lt_strorder : StrictOrder lt.
Admitted.

  Definition lt_compat : Proper (Logic.eq ==> Logic.eq ==> iff) lt.
Admitted.
Definition compare (x y : t) : comparison.
Admitted.

  Definition compare_spec :
    forall x y : t, CompareSpec (x = y) (lt x y) (lt y x) (compare x y).
Admitted.
Definition eq_dec : forall (l1 l2 : t), {l1 = l2} + {l1 <> l2}.
Admitted.
Definition eq_leibniz (x y : t) : eq x y -> x = y.
Admitted.

End LevelExpr.

Module LevelExprSet := MSetList.MakeWithLeibniz LevelExpr.

Record nonEmptyLevelExprSet
  := { t_set : LevelExprSet.t ;
       t_ne  : LevelExprSet.is_empty t_set = false }.

Coercion t_set : nonEmptyLevelExprSet >-> LevelExprSet.t.

Module Export LevelAlgExpr.

  Definition t := nonEmptyLevelExprSet.
Global Instance Evaluable : Evaluable LevelAlgExpr.t.
Admitted.
Definition lt : t -> t -> Prop.
Admitted.
End LevelAlgExpr.

Inductive allowed_eliminations : Set :=
  | IntoSProp
  | IntoPropSProp
  | IntoSetPropSProp
  | IntoAny.

Module Export Universe.
  Inductive t_ :=
    lProp | lSProp | lType (_ : LevelAlgExpr.t).

  Definition t := t_.

  Definition on_sort (P: LevelAlgExpr.t -> Prop) (def: Prop) (s : t) :=
    match s with
    | lProp | lSProp => def
    | lType l => P l
    end.
Definition make (l : Level.t) : t.
Admitted.
Definition is_sprop (u : t) : bool.
Admitted.
Definition is_prop (u : t) : bool.
Admitted.
Definition type0 : t.
Admitted.
Definition super (l : t) : t.
Admitted.
Definition sup (u v : t) : t.
Admitted.

  Definition sort_of_product (domsort rangsort : t) :=

    if Universe.is_prop rangsort || Universe.is_sprop rangsort then rangsort
    else Universe.sup domsort rangsort.

  Inductive lt_ : t -> t -> Prop :=
  | ltPropSProp : lt_ lProp lSProp
  | ltPropType s : lt_ lProp (lType s)
  | ltSPropType s : lt_ lSProp (lType s)
  | ltTypeType s1 s2 : LevelAlgExpr.lt s1 s2 -> lt_ (lType s1) (lType s2).

  Definition lt := lt_.

  Module OT <: OrderedType.
    Definition t := t.
#[local] Definition eq : t -> t -> Prop.
exact (eq).
Defined.
#[local] Definition eq_equiv : Equivalence eq.
Admitted.
    Definition lt := lt.
    #[local] Instance lt_strorder : StrictOrder lt.
Admitted.

    Definition lt_compat : Proper (eq ==> eq ==> iff) lt.
Admitted.
Definition compare (x y : t) : comparison.
Admitted.
    Lemma compare_spec x y : CompareSpec (eq x y) (lt x y) (lt y x) (compare x y).
Admitted.
    Definition eq_dec (x y : t) : {x = y} + {x <> y}.
Admitted.
  End OT.
End Universe.

Definition is_propositional u :=
  Universe.is_prop u || Universe.is_sprop u.

Module Export ConstraintType.
  Inductive t_ : Set := Le (z : Z) | Eq.

  Definition t := t_.

  Inductive lt_ : t -> t -> Prop :=
  | LeLe n m : (n < m)%Z -> lt_ (Le n) (Le m)
  | LeEq n : lt_ (Le n) Eq.
  Definition lt := lt_.
End ConstraintType.

Module UnivConstraint.
Definition t : Set.
exact (Level.t * ConstraintType.t * Level.t).
Defined.
Definition eq : t -> t -> Prop.
Admitted.
Definition eq_equiv : Equivalence eq.
Admitted.

  Inductive lt_ : t -> t -> Prop :=
  | lt_Level2 l1 t l2 l2' : Level.lt l2 l2' -> lt_ (l1, t, l2) (l1, t, l2')
  | lt_Cstr l1 t t' l2 l2' : ConstraintType.lt t t' -> lt_ (l1, t, l2) (l1, t', l2')
  | lt_Level1 l1 l1' t t' l2 l2' : Level.lt l1 l1' -> lt_ (l1, t, l2) (l1', t', l2').
  Definition lt := lt_.

  Lemma lt_strorder : StrictOrder lt.
Admitted.

  Lemma lt_compat : Proper (eq ==> eq ==> iff) lt.
Admitted.
Definition compare : t -> t -> comparison.
Admitted.

  Lemma compare_spec x y
    : CompareSpec (eq x y) (lt x y) (lt y x) (compare x y).
Admitted.

  Lemma eq_dec x y : {eq x y} + {~ eq x y}.
Admitted.
End UnivConstraint.

Module ConstraintSet := MSetAVL.Make UnivConstraint.

Module Export Instance.
Definition t : Set.
exact (list Level.t).
Defined.
Definition empty : t.
Admitted.
End Instance.

Module Export UContext.
  Definition t := list name × (Instance.t × ConstraintSet.t).
Definition instance : t -> Instance.t.
Admitted.
End UContext.

Module Export AUContext.
  Definition t := list name × ConstraintSet.t.
Definition repr (x : t) : UContext.t.
Admitted.
End AUContext.

Module Export ContextSet.
  Definition t := LevelSet.t × ConstraintSet.t.
End ContextSet.

Module Export Variance.

  Inductive t :=
  | Irrelevant : t
  | Covariant : t
  | Invariant : t.

Inductive universes_decl : Type :=
| Monomorphic_ctx
| Polymorphic_ctx (cst : AUContext.t).

Section Univ.
  Context {cf: checker_flags}.

  Inductive satisfies0 (v : valuation) : UnivConstraint.t -> Prop :=
  | satisfies0_Lt (l l' : Level.t) (z : Z) : (Z.of_nat (val v l) <= Z.of_nat (val v l') - z)%Z
                         -> satisfies0 v (l, ConstraintType.Le z, l')
  | satisfies0_Eq (l l' : Level.t) : val v l = val v l'
                         -> satisfies0 v (l, ConstraintType.Eq, l').

  Definition satisfies v : ConstraintSet.t -> Prop :=
    ConstraintSet.For_all (satisfies0 v).

  Definition leq0_levelalg_n n φ (u u' : LevelAlgExpr.t) :=
    forall v, satisfies v φ -> (Z.of_nat (val v u) <= Z.of_nat (val v u') - n)%Z.

  Definition leq_levelalg_n n φ (u u' : LevelAlgExpr.t) :=
    if check_univs then leq0_levelalg_n n φ u u' else True.

  Definition leq_universe_n_ {CS} leq_levelalg_n n (φ: CS) s s' :=
    match s, s' with
    | Universe.lProp,   Universe.lProp
    | Universe.lSProp,  Universe.lSProp => (n = 0)%Z
    | Universe.lType u, Universe.lType u' => leq_levelalg_n n φ u u'
    | Universe.lProp,   Universe.lType u => prop_sub_type
    | _, _ => False
    end.

  Definition leq_universe_n := leq_universe_n_ leq_levelalg_n.

  Definition eq0_levelalg φ (u u' : LevelAlgExpr.t) :=
    forall v, satisfies v φ -> val v u = val v u'.

  Definition eq_levelalg φ (u u' : LevelAlgExpr.t) :=
    if check_univs then eq0_levelalg φ u u' else True.

  Definition eq_universe_ {CS} eq_levelalg (φ: CS) s s' :=
    match s, s' with
    | Universe.lProp,   Universe.lProp
    | Universe.lSProp,  Universe.lSProp => True
    | Universe.lType u, Universe.lType u' => eq_levelalg φ u u'
    | _, _ => False
    end.

  Definition eq_universe := eq_universe_ eq_levelalg.
  Definition leq_universe := leq_universe_n 0.

  Definition compare_universe (pb : conv_pb) :=
    match pb with
    | Conv => eq_universe
    | Cumul => leq_universe
    end.

  Definition valid_constraints0 φ ctrs
    := forall v, satisfies v φ -> satisfies v ctrs.

  Definition valid_constraints φ ctrs
    := if check_univs then valid_constraints0 φ ctrs else True.

  Definition is_lSet φ s := eq_universe φ s Universe.type0.

  Definition is_allowed_elimination φ allowed : Universe.t -> Prop :=
    match allowed with
    | IntoSProp => Universe.is_sprop
    | IntoPropSProp => is_propositional
    | IntoSetPropSProp => fun s => is_propositional s \/ is_lSet φ s
    | IntoAny => fun s => True
    end.

End Univ.

Class UnivSubst A := subst_instance : Instance.t -> A -> A.

Notation "x @[ u ]" := (subst_instance u x) (at level 3,
  format "x @[ u ]").
#[global] Instance subst_instance_cstrs : UnivSubst ConstraintSet.t.
Admitted.

Definition abstract_instance decl :=
  match decl with
  | Monomorphic_ctx => Instance.empty
  | Polymorphic_ctx auctx => UContext.instance (AUContext.repr auctx)
  end.
Import Coq.ssr.ssrbool.

Module Type Term.

  Parameter Inline term : Type.

  Parameter Inline tRel : nat -> term.
  Parameter Inline tSort : Universe.t -> term.
  Parameter Inline tLambda : aname -> term -> term -> term.
  Parameter Inline tLetIn : aname -> term -> term -> term -> term.

  Parameter Inline lift : nat -> nat -> term -> term.
  Parameter Inline subst : list term -> nat -> term -> term.
End Term.

Module Type TermDecide (Import T : Term).
End TermDecide.

Module Export Retroknowledge.

  Record t := mk_retroknowledge {
    retro_int63 : option kername;
    retro_float64 : option kername;
  }.

Module Environment (T : Term).

  Import T.

  Definition typ_or_sort := typ_or_sort_ term.

  Notation context_decl := (context_decl term).

  Definition vass x A : context_decl :=
    {| decl_name := x ; decl_body := None ; decl_type := A |}.

  Definition vdef x t A : context_decl :=
    {| decl_name := x ; decl_body := Some t ; decl_type := A |}.

  Definition context := list context_decl.

  Definition lift_context n k (Γ : context) : context :=
    fold_context_k (fun k' => lift n (k' + k)) Γ.

  Definition subst_context s k (Γ : context) : context :=
    fold_context_k (fun k' => subst s (k' + k)) Γ.

  Definition subst_telescope s k (Γ : context) : context :=
    mapi (fun k' decl => map_decl (subst s (k' + k)) decl) Γ.
Global Instance subst_instance_context : UnivSubst context.
Admitted.
Definition set_binder_name (na : aname) (x : context_decl) : context_decl.
Admitted.

  Fixpoint context_assumptions (Γ : context) :=
    match Γ with
    | [] => 0
    | d :: Γ =>
      match d.(decl_body) with
      | Some _ => context_assumptions Γ
      | None => S (context_assumptions Γ)
      end
    end.
Fixpoint smash_context (Γ Γ' : context) : context.
Admitted.

  Fixpoint extended_subst (Γ : context) (n : nat)
    :=
  match Γ with
  | nil => nil
  | cons d vs =>
    match decl_body d with
    | Some b =>

      let s := extended_subst vs n in

      let b' := lift (context_assumptions vs + n) #|s| b in

      let b' := subst s 0 b' in

      b' :: s
    | None => tRel n :: extended_subst vs (S n)
    end
  end.

  Definition expand_lets_k Γ k t :=
    (subst (extended_subst Γ 0) k (lift (context_assumptions Γ) (k + #|Γ|) t)).

  Definition expand_lets Γ t := expand_lets_k Γ 0 t.

  Definition expand_lets_k_ctx Γ k Δ :=
    (subst_context (extended_subst Γ 0) k (lift_context (context_assumptions Γ) (k + #|Γ|) Δ)).

  Definition expand_lets_ctx Γ Δ := expand_lets_k_ctx Γ 0 Δ.
Definition fix_context (m : mfixpoint term) : context.
Admitted.

  Record constructor_body := {
    cstr_name : ident;

    cstr_args : context;
    cstr_indices : list term;
    cstr_type : term;

    cstr_arity : nat;
  }.

  Record projection_body := {
    proj_name : ident;

    proj_relevance : relevance;
    proj_type : term;
  }.

  Record one_inductive_body := {
    ind_name : ident;
    ind_indices : context;
    ind_sort : Universe.t;
    ind_type : term;
    ind_kelim : allowed_eliminations;
    ind_ctors : list constructor_body;
    ind_projs : list projection_body;
    ind_relevance : relevance   }.

  Record mutual_inductive_body := {
    ind_finite : recursivity_kind;
    ind_npars : nat;
    ind_params : context;
    ind_bodies : list one_inductive_body ;
    ind_universes : universes_decl;
    ind_variance : option (list Universes.Variance.t) }.

  Record constant_body := {
    cst_type : term;
    cst_body : option term;
    cst_universes : universes_decl;
    cst_relevance : relevance }.

  Inductive global_decl :=
  | ConstantDecl : constant_body -> global_decl
  | InductiveDecl : mutual_inductive_body -> global_decl.

  Definition global_declarations := list (kername * global_decl).

  Record global_env := mk_global_env
    { universes : ContextSet.t;
      declarations : global_declarations;
      retroknowledge : Retroknowledge.t }.
Fixpoint lookup_global (Σ : global_declarations) (kn : kername) : option global_decl.
Admitted.

  Definition lookup_env (Σ : global_env) (kn : kername) := lookup_global Σ.(declarations) kn.
Definition primitive_constant (Σ : global_env) (p : prim_tag) : option kername.
Admitted.

  Definition primitive_invariants (cdecl : constant_body) :=
    ∑ s, [/\ cdecl.(cst_type) = tSort s, cdecl.(cst_body) = None &
             cdecl.(cst_universes) = Monomorphic_ctx].
Definition global_env_ext : Type.
exact (global_env * universes_decl).
Defined.
Definition fst_ctx : global_env_ext -> global_env.
Admitted.
  Coercion fst_ctx : global_env_ext >-> global_env.
Definition app_context (Γ Γ' : context) : context.
Admitted.
  Notation "Γ ,,, Γ'" :=
    (app_context Γ Γ') (at level 25, Γ' at next level, left associativity).

  Definition mkLambda_or_LetIn d t :=
    match d.(decl_body) with
    | None => tLambda d.(decl_name) d.(decl_type) t
    | Some b => tLetIn d.(decl_name) b d.(decl_type) t
    end.

  Definition it_mkLambda_or_LetIn (l : context) (t : term) :=
    List.fold_left (fun acc d => mkLambda_or_LetIn d acc) l t.
Fixpoint reln (l : list term) (p : nat) (Γ0 : list context_decl) {struct Γ0} : list term.
Admitted.

  Definition to_extended_list_k Γ k := reln [] k Γ.
  Definition to_extended_list Γ := to_extended_list_k Γ 0.

End Environment.

Module Type EnvironmentSig (T : Term).
 Include Environment T.
End EnvironmentSig.

Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T).
End EnvironmentDecide.

Module Type TermUtils (T: Term) (E: EnvironmentSig T).

End TermUtils.
Module Export EnvironmentTyping.

Module Lookup (T : Term) (E : EnvironmentSig T).
Import E.

  Definition declared_constant (Σ : global_env) id decl := In (id,ConstantDecl decl) (declarations Σ).

  Definition declared_minductive Σ mind decl := In (mind,InductiveDecl decl) (declarations Σ).

  Definition declared_inductive Σ ind mdecl decl :=
    declared_minductive Σ (inductive_mind ind) mdecl /\
    List.nth_error mdecl.(ind_bodies) (inductive_ind ind) = Some decl.

  Definition declared_constructor Σ cstr mdecl idecl cdecl :=
    declared_inductive Σ (fst cstr) mdecl idecl /\
    List.nth_error idecl.(ind_ctors) (snd cstr) = Some cdecl.

  Definition declared_projection Σ (proj : projection) mdecl idecl cdecl pdecl
  : Prop :=
    declared_constructor Σ (proj.(proj_ind), 0) mdecl idecl cdecl /\
    List.nth_error idecl.(ind_projs) proj.(proj_arg) = Some pdecl /\
    mdecl.(ind_npars) = proj.(proj_npars).

  Definition lookup_minductive_gen (lookup : kername -> option global_decl) mind :=
    match lookup mind with
    | Some (InductiveDecl decl) => Some decl
    | _ => None
    end.

  Definition lookup_inductive_gen lookup ind :=
    match lookup_minductive_gen lookup (inductive_mind ind) with
    | Some mdecl =>
      match nth_error mdecl.(ind_bodies) (inductive_ind ind) with
      | Some idecl => Some (mdecl, idecl)
      | None => None
      end
    | None => None
    end.

  Definition lookup_constructor_gen lookup ind k :=
    match lookup_inductive_gen lookup ind with
    | Some (mdecl, idecl) =>
      match nth_error idecl.(ind_ctors) k with
      | Some cdecl => Some (mdecl, idecl, cdecl)
      | None => None
      end
    | _ => None
    end.
Definition global_ext_levels (Σ : global_env_ext) : LevelSet.t.
Admitted.
Definition global_ext_constraints (Σ : global_env_ext) : ConstraintSet.t.
Admitted.

  Coercion global_ext_constraints : global_env_ext >-> ConstraintSet.t.

  Definition consistent_instance `{checker_flags} (lvs : LevelSet.t) (φ : ConstraintSet.t) uctx (u : Instance.t) :=
    match uctx with
    | Monomorphic_ctx => List.length u = 0
    | Polymorphic_ctx c =>

      forallb (fun l => LevelSet.mem l lvs) u /\
      List.length u = List.length c.1 /\
      valid_constraints φ (subst_instance_cstrs u c.2)
    end.

  Definition consistent_instance_ext `{checker_flags} Σ :=
    consistent_instance (global_ext_levels Σ) (global_ext_constraints Σ).

  Definition wf_universe Σ s : Prop :=
    Universe.on_sort
      (fun u => forall l, LevelExprSet.In l u -> LevelSet.In (LevelExpr.get_level l) (global_ext_levels Σ))
      True s.

End Lookup.

Module Type LookupSig (T : Term) (E : EnvironmentSig T).
End LookupSig.

Module EnvTyping (T : Term) (E : EnvironmentSig T) (TU : TermUtils T E).
Import T.
Import E.

  Section TypeLocal.
    Context (typing : forall (Γ : context), term -> typ_or_sort -> Type).

    Inductive All_local_env : context -> Type :=
    | localenv_nil :
        All_local_env []

    | localenv_cons_abs Γ na t :
        All_local_env Γ ->
        typing Γ t Sort ->
        All_local_env (Γ ,, vass na t)

    | localenv_cons_def Γ na b t :
        All_local_env Γ ->
        typing Γ t Sort ->
        typing Γ b (Typ t) ->
        All_local_env (Γ ,, vdef na b t).
  End TypeLocal.

  Definition lift_judgment
    (check : global_env_ext -> context -> term -> term -> Type)
    (infer_sort : global_env_ext -> context -> term -> Type) :
    (global_env_ext -> context -> term -> typ_or_sort -> Type).
admit.
Defined.

  Definition infer_sort (sorting : global_env_ext -> context -> term -> Universe.t -> Type) := (fun Σ Γ T => { s : Universe.t & sorting Σ Γ T s }).
  Notation typing_sort typing := (fun Σ Γ T s => typing Σ Γ T (tSort s)).

  Definition lift_typing typing := lift_judgment typing (infer_sort (typing_sort typing)).

  Section TypeCtxInst.
    Context (typing : forall (
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 530KiB file on GitHub Actions Artifacts under build.log)
fs/pull/9852/head  -> origin/pr/9852
 * [new ref]               refs/pull/9853/head  -> origin/pr/9853
 * [new ref]               refs/pull/9854/head  -> origin/pr/9854
 * [new ref]               refs/pull/9855/head  -> origin/pr/9855
 * [new ref]               refs/pull/9856/head  -> origin/pr/9856
 * [new ref]               refs/pull/9858/head  -> origin/pr/9858
 * [new ref]               refs/pull/9859/head  -> origin/pr/9859
 * [new ref]               refs/pull/986/head   -> origin/pr/986
 * [new ref]               refs/pull/9860/head  -> origin/pr/9860
 * [new ref]               refs/pull/9861/head  -> origin/pr/9861
 * [new ref]               refs/pull/9864/head  -> origin/pr/9864
 * [new ref]               refs/pull/9866/head  -> origin/pr/9866
 * [new ref]               refs/pull/9867/head  -> origin/pr/9867
 * [new ref]               refs/pull/9869/head  -> origin/pr/9869
 * [new ref]               refs/pull/987/head   -> origin/pr/987
 * [new ref]               refs/pull/9870/head  -> origin/pr/9870
 * [new ref]               refs/pull/9871/head  -> origin/pr/9871
 * [new ref]               refs/pull/9872/head  -> origin/pr/9872
 * [new ref]               refs/pull/9873/head  -> origin/pr/9873
 * [new ref]               refs/pull/9874/head  -> origin/pr/9874
 * [new ref]               refs/pull/9875/head  -> origin/pr/9875
 * [new ref]               refs/pull/9876/head  -> origin/pr/9876
 * [new ref]               refs/pull/9878/head  -> origin/pr/9878
 * [new ref]               refs/pull/988/head   -> origin/pr/988
 * [new ref]               refs/pull/9880/head  -> origin/pr/9880
 * [new ref]               refs/pull/9881/head  -> origin/pr/9881
 * [new ref]               refs/pull/9882/head  -> origin/pr/9882
 * [new ref]               refs/pull/9883/head  -> origin/pr/9883
 * [new ref]               refs/pull/9884/head  -> origin/pr/9884
 * [new ref]               refs/pull/9887/head  -> origin/pr/9887
 * [new ref]               refs/pull/9889/head  -> origin/pr/9889
 * [new ref]               refs/pull/989/head   -> origin/pr/989
 * [new ref]               refs/pull/9890/head  -> origin/pr/9890
 * [new ref]               refs/pull/9891/head  -> origin/pr/9891
 * [new ref]               refs/pull/9895/head  -> origin/pr/9895
 * [new ref]               refs/pull/9896/head  -> origin/pr/9896
 * [new ref]               refs/pull/9897/head  -> origin/pr/9897
 * [new ref]               refs/pull/9898/head  -> origin/pr/9898
 * [new ref]               refs/pull/99/head    -> origin/pr/99
 * [new ref]               refs/pull/990/head   -> origin/pr/990
 * [new ref]               refs/pull/9900/head  -> origin/pr/9900
 * [new ref]               refs/pull/9901/head  -> origin/pr/9901
 * [new ref]               refs/pull/9903/head  -> origin/pr/9903
 * [new ref]               refs/pull/9904/head  -> origin/pr/9904
 * [new ref]               refs/pull/9905/head  -> origin/pr/9905
 * [new ref]               refs/pull/9906/head  -> origin/pr/9906
 * [new ref]               refs/pull/9908/head  -> origin/pr/9908
 * [new ref]               refs/pull/9909/head  -> origin/pr/9909
 * [new ref]               refs/pull/991/head   -> origin/pr/991
 * [new ref]               refs/pull/9910/head  -> origin/pr/9910
 * [new ref]               refs/pull/9914/head  -> origin/pr/9914
 * [new ref]               refs/pull/9915/head  -> origin/pr/9915
 * [new ref]               refs/pull/9917/head  -> origin/pr/9917
 * [new ref]               refs/pull/9918/head  -> origin/pr/9918
 * [new ref]               refs/pull/992/head   -> origin/pr/992
 * [new ref]               refs/pull/9923/head  -> origin/pr/9923
 * [new ref]               refs/pull/9924/head  -> origin/pr/9924
 * [new ref]               refs/pull/9925/head  -> origin/pr/9925
 * [new ref]               refs/pull/9926/head  -> origin/pr/9926
 * [new ref]               refs/pull/9927/head  -> origin/pr/9927
 * [new ref]               refs/pull/9928/head  -> origin/pr/9928
 * [new ref]               refs/pull/993/head   -> origin/pr/993
 * [new ref]               refs/pull/9931/head  -> origin/pr/9931
 * [new ref]               refs/pull/9933/head  -> origin/pr/9933
 * [new ref]               refs/pull/9935/head  -> origin/pr/9935
 * [new ref]               refs/pull/9938/head  -> origin/pr/9938
 * [new ref]               refs/pull/9939/head  -> origin/pr/9939
 * [new ref]               refs/pull/994/head   -> origin/pr/994
 * [new ref]               refs/pull/9941/head  -> origin/pr/9941
 * [new ref]               refs/pull/9943/head  -> origin/pr/9943
 * [new ref]               refs/pull/9946/head  -> origin/pr/9946
 * [new ref]               refs/pull/9947/head  -> origin/pr/9947
 * [new ref]               refs/pull/9949/head  -> origin/pr/9949
 * [new ref]               refs/pull/995/head   -> origin/pr/995
 * [new ref]               refs/pull/9952/head  -> origin/pr/9952
 * [new ref]               refs/pull/9953/head  -> origin/pr/9953
 * [new ref]               refs/pull/9957/head  -> origin/pr/9957
 * [new ref]               refs/pull/9959/head  -> origin/pr/9959
 * [new ref]               refs/pull/996/head   -> origin/pr/996
 * [new ref]               refs/pull/9961/head  -> origin/pr/9961
 * [new ref]               refs/pull/9962/head  -> origin/pr/9962
 * [new ref]               refs/pull/9963/head  -> origin/pr/9963
 * [new ref]               refs/pull/9964/head  -> origin/pr/9964
 * [new ref]               refs/pull/9966/head  -> origin/pr/9966
 * [new ref]               refs/pull/9968/head  -> origin/pr/9968
 * [new ref]               refs/pull/997/head   -> origin/pr/997
 * [new ref]               refs/pull/9972/head  -> origin/pr/9972
 * [new ref]               refs/pull/9973/head  -> origin/pr/9973
 * [new ref]               refs/pull/9977/head  -> origin/pr/9977
 * [new ref]               refs/pull/9978/head  -> origin/pr/9978
 * [new ref]               refs/pull/998/head   -> origin/pr/998
 * [new ref]               refs/pull/9980/head  -> origin/pr/9980
 * [new ref]               refs/pull/9981/head  -> origin/pr/9981
 * [new ref]               refs/pull/9982/head  -> origin/pr/9982
 * [new ref]               refs/pull/9983/head  -> origin/pr/9983
 * [new ref]               refs/pull/9984/head  -> origin/pr/9984
 * [new ref]               refs/pull/9985/head  -> origin/pr/9985
 * [new ref]               refs/pull/9987/head  -> origin/pr/9987
 * [new ref]               refs/pull/9988/head  -> origin/pr/9988
 * [new ref]               refs/pull/9989/head  -> origin/pr/9989
 * [new ref]               refs/pull/999/head   -> origin/pr/999
 * [new ref]               refs/pull/9990/head  -> origin/pr/9990
 * [new ref]               refs/pull/9995/head  -> origin/pr/9995
 * [new ref]               refs/pull/9996/head  -> origin/pr/9996
 * [new ref]               refs/pull/9997/head  -> origin/pr/9997
 * [new ref]               refs/pull/9998/head  -> origin/pr/9998
 * [new ref]               refs/pull/9999/head  -> origin/pr/9999
++ cp -a coq coq-failing
++ cp -a coq coq-passing
++ echo ::endgroup::
::endgroup::
++ echo '::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download'
::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download
++ echo '::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download'
::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download
++ pushd coq-failing
/github/workspace/builds/coq/coq-failing /github/workspace/builds/coq /github/workspace
++ git checkout 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
fatal: reference is not a tree: 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
Minimization Log (truncated to last 8.0KiB; full 541KiB file on GitHub Actions Artifacts under bug.log)
fs/pull/9852/head  -> origin/pr/9852
 * [new ref]               refs/pull/9853/head  -> origin/pr/9853
 * [new ref]               refs/pull/9854/head  -> origin/pr/9854
 * [new ref]               refs/pull/9855/head  -> origin/pr/9855
 * [new ref]               refs/pull/9856/head  -> origin/pr/9856
 * [new ref]               refs/pull/9858/head  -> origin/pr/9858
 * [new ref]               refs/pull/9859/head  -> origin/pr/9859
 * [new ref]               refs/pull/986/head   -> origin/pr/986
 * [new ref]               refs/pull/9860/head  -> origin/pr/9860
 * [new ref]               refs/pull/9861/head  -> origin/pr/9861
 * [new ref]               refs/pull/9864/head  -> origin/pr/9864
 * [new ref]               refs/pull/9866/head  -> origin/pr/9866
 * [new ref]               refs/pull/9867/head  -> origin/pr/9867
 * [new ref]               refs/pull/9869/head  -> origin/pr/9869
 * [new ref]               refs/pull/987/head   -> origin/pr/987
 * [new ref]               refs/pull/9870/head  -> origin/pr/9870
 * [new ref]               refs/pull/9871/head  -> origin/pr/9871
 * [new ref]               refs/pull/9872/head  -> origin/pr/9872
 * [new ref]               refs/pull/9873/head  -> origin/pr/9873
 * [new ref]               refs/pull/9874/head  -> origin/pr/9874
 * [new ref]               refs/pull/9875/head  -> origin/pr/9875
 * [new ref]               refs/pull/9876/head  -> origin/pr/9876
 * [new ref]               refs/pull/9878/head  -> origin/pr/9878
 * [new ref]               refs/pull/988/head   -> origin/pr/988
 * [new ref]               refs/pull/9880/head  -> origin/pr/9880
 * [new ref]               refs/pull/9881/head  -> origin/pr/9881
 * [new ref]               refs/pull/9882/head  -> origin/pr/9882
 * [new ref]               refs/pull/9883/head  -> origin/pr/9883
 * [new ref]               refs/pull/9884/head  -> origin/pr/9884
 * [new ref]               refs/pull/9887/head  -> origin/pr/9887
 * [new ref]               refs/pull/9889/head  -> origin/pr/9889
 * [new ref]               refs/pull/989/head   -> origin/pr/989
 * [new ref]               refs/pull/9890/head  -> origin/pr/9890
 * [new ref]               refs/pull/9891/head  -> origin/pr/9891
 * [new ref]               refs/pull/9895/head  -> origin/pr/9895
 * [new ref]               refs/pull/9896/head  -> origin/pr/9896
 * [new ref]               refs/pull/9897/head  -> origin/pr/9897
 * [new ref]               refs/pull/9898/head  -> origin/pr/9898
 * [new ref]               refs/pull/99/head    -> origin/pr/99
 * [new ref]               refs/pull/990/head   -> origin/pr/990
 * [new ref]               refs/pull/9900/head  -> origin/pr/9900
 * [new ref]               refs/pull/9901/head  -> origin/pr/9901
 * [new ref]               refs/pull/9903/head  -> origin/pr/9903
 * [new ref]               refs/pull/9904/head  -> origin/pr/9904
 * [new ref]               refs/pull/9905/head  -> origin/pr/9905
 * [new ref]               refs/pull/9906/head  -> origin/pr/9906
 * [new ref]               refs/pull/9908/head  -> origin/pr/9908
 * [new ref]               refs/pull/9909/head  -> origin/pr/9909
 * [new ref]               refs/pull/991/head   -> origin/pr/991
 * [new ref]               refs/pull/9910/head  -> origin/pr/9910
 * [new ref]               refs/pull/9914/head  -> origin/pr/9914
 * [new ref]               refs/pull/9915/head  -> origin/pr/9915
 * [new ref]               refs/pull/9917/head  -> origin/pr/9917
 * [new ref]               refs/pull/9918/head  -> origin/pr/9918
 * [new ref]               refs/pull/992/head   -> origin/pr/992
 * [new ref]               refs/pull/9923/head  -> origin/pr/9923
 * [new ref]               refs/pull/9924/head  -> origin/pr/9924
 * [new ref]               refs/pull/9925/head  -> origin/pr/9925
 * [new ref]               refs/pull/9926/head  -> origin/pr/9926
 * [new ref]               refs/pull/9927/head  -> origin/pr/9927
 * [new ref]               refs/pull/9928/head  -> origin/pr/9928
 * [new ref]               refs/pull/993/head   -> origin/pr/993
 * [new ref]               refs/pull/9931/head  -> origin/pr/9931
 * [new ref]               refs/pull/9933/head  -> origin/pr/9933
 * [new ref]               refs/pull/9935/head  -> origin/pr/9935
 * [new ref]               refs/pull/9938/head  -> origin/pr/9938
 * [new ref]               refs/pull/9939/head  -> origin/pr/9939
 * [new ref]               refs/pull/994/head   -> origin/pr/994
 * [new ref]               refs/pull/9941/head  -> origin/pr/9941
 * [new ref]               refs/pull/9943/head  -> origin/pr/9943
 * [new ref]               refs/pull/9946/head  -> origin/pr/9946
 * [new ref]               refs/pull/9947/head  -> origin/pr/9947
 * [new ref]               refs/pull/9949/head  -> origin/pr/9949
 * [new ref]               refs/pull/995/head   -> origin/pr/995
 * [new ref]               refs/pull/9952/head  -> origin/pr/9952
 * [new ref]               refs/pull/9953/head  -> origin/pr/9953
 * [new ref]               refs/pull/9957/head  -> origin/pr/9957
 * [new ref]               refs/pull/9959/head  -> origin/pr/9959
 * [new ref]               refs/pull/996/head   -> origin/pr/996
 * [new ref]               refs/pull/9961/head  -> origin/pr/9961
 * [new ref]               refs/pull/9962/head  -> origin/pr/9962
 * [new ref]               refs/pull/9963/head  -> origin/pr/9963
 * [new ref]               refs/pull/9964/head  -> origin/pr/9964
 * [new ref]               refs/pull/9966/head  -> origin/pr/9966
 * [new ref]               refs/pull/9968/head  -> origin/pr/9968
 * [new ref]               refs/pull/997/head   -> origin/pr/997
 * [new ref]               refs/pull/9972/head  -> origin/pr/9972
 * [new ref]               refs/pull/9973/head  -> origin/pr/9973
 * [new ref]               refs/pull/9977/head  -> origin/pr/9977
 * [new ref]               refs/pull/9978/head  -> origin/pr/9978
 * [new ref]               refs/pull/998/head   -> origin/pr/998
 * [new ref]               refs/pull/9980/head  -> origin/pr/9980
 * [new ref]               refs/pull/9981/head  -> origin/pr/9981
 * [new ref]               refs/pull/9982/head  -> origin/pr/9982
 * [new ref]               refs/pull/9983/head  -> origin/pr/9983
 * [new ref]               refs/pull/9984/head  -> origin/pr/9984
 * [new ref]               refs/pull/9985/head  -> origin/pr/9985
 * [new ref]               refs/pull/9987/head  -> origin/pr/9987
 * [new ref]               refs/pull/9988/head  -> origin/pr/9988
 * [new ref]               refs/pull/9989/head  -> origin/pr/9989
 * [new ref]               refs/pull/999/head   -> origin/pr/999
 * [new ref]               refs/pull/9990/head  -> origin/pr/9990
 * [new ref]               refs/pull/9995/head  -> origin/pr/9995
 * [new ref]               refs/pull/9996/head  -> origin/pr/9996
 * [new ref]               refs/pull/9997/head  -> origin/pr/9997
 * [new ref]               refs/pull/9998/head  -> origin/pr/9998
 * [new ref]               refs/pull/9999/head  -> origin/pr/9999
++ cp -a coq coq-failing
++ cp -a coq coq-passing
++ echo ::endgroup::
::endgroup::
++ echo '::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download'
::group::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download
++ echo '::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download'
::warning::download failing artifacts @ 59b2ccd29842ac23e2ed412feb69b87c1c8664e1 https://gitlab.com/coq/coq/-/jobs/4218735823/artifacts/download https://gitlab.com/coq/coq/-/jobs/4218736151/artifacts/download
++ pushd coq-failing
/github/workspace/builds/coq/coq-failing /github/workspace/builds/coq /github/workspace
++ git checkout 59b2ccd29842ac23e2ed412feb69b87c1c8664e1
fatal: reference is not a tree: 59b2ccd29842ac23e2ed412feb69b87c1c8664e1

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.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 6, 2023

🔴 CI failure at commit edca56e without any failure in the test-suite

✔️ Corresponding job for the base commit a85232c succeeded

❔ Ask me to try to extract a minimal test case that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following target: ci-vst
  • You can also pass me a specific list of targets to minimize as arguments.

andrew-appel added a commit to PrincetonUniversity/VST that referenced this pull request May 9, 2023
We only use ecase to interpret split intropatterns for eintros and instead
use case when used with intros.
We preemptively pose all dependent metas as evars and instead rely on
tclWITHHOLES to check that they were resolved by unification. This might
change the return clause a bit since legacy unification does not handle
metas exactly like evars.
We pose them as proper goals before calling case_pf.
@ppedrot ppedrot added the request: full CI Use this label when you want your next push to trigger a full CI. label May 9, 2023
@ppedrot ppedrot force-pushed the case-pf-pose-dependent-metas branch from edca56e to 8583ab4 Compare May 9, 2023 15:34
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label May 9, 2023
@ppedrot ppedrot marked this pull request as ready for review May 9, 2023 15:34
@ppedrot ppedrot requested review from a team as code owners May 9, 2023 15:34
@ppedrot
Copy link
Member Author

ppedrot commented May 9, 2023

just in case @coqbot bench

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 10, 2023

🏁 Bench results:

┌──────────────────────────────┬─────────────────────────┬───────────────────────────────────────┬───────────────────────────────────────┬─────────────────────────┐
│                              │      user time [s]      │              CPU cycles               │           CPU instructions            │  max resident mem [KB]  │
│                              │                         │                                       │                                       │                         │
│         package_name         │   NEW      OLD    PDIFF │      NEW             OLD        PDIFF │      NEW             OLD        PDIFF │   NEW      OLD    PDIFF │
├──────────────────────────────┼─────────────────────────┼───────────────────────────────────────┼───────────────────────────────────────┼─────────────────────────┤
│  coq-rewriter-perf-SuperFast │  730.94   740.32  -1.27 │  3326340425283   3366704505648  -1.20 │  5799152111069   5805358208196  -0.11 │ 1445800  1426820   1.33 │
│                     coq-hott │  147.02   148.15  -0.76 │   667909306264    667376829571   0.08 │  1062648488578   1064632423334  -0.19 │  618524   620808  -0.37 │
│          coq-category-theory │  716.24   721.33  -0.71 │  3268525336299   3293320304599  -0.75 │  5627646761497   5642926485920  -0.27 │  941648   944848  -0.34 │
│                  coq-bignums │   27.53    27.69  -0.58 │   125167923131    126299489991  -0.90 │   180616161926    180683892340  -0.04 │  484564   484908  -0.07 │
│   coq-performance-tests-lite │  752.50   756.84  -0.57 │  3407603073471   3428665091573  -0.61 │  6048284149901   6046927000725   0.02 │ 1868972  1869080  -0.01 │
│ coq-fiat-crypto-with-bedrock │ 6093.55  6125.61  -0.52 │ 27684930954068  27824655539421  -0.50 │ 51041430432969  51104836862069  -0.12 │ 2443140  2404308   1.62 │
│      coq-metacoq-safechecker │  373.34   375.03  -0.45 │  1707775469354   1714891495258  -0.41 │  2868910048655   2876512022820  -0.26 │ 2002316  2002936  -0.03 │
│               coq-verdi-raft │  557.70   559.58  -0.34 │  2543327851380   2551592762589  -0.32 │  3984631417941   3992225489180  -0.19 │  821268   818592   0.33 │
│        coq-mathcomp-fingroup │   21.61    21.68  -0.32 │    98765841886     98766288407  -0.00 │   144725092814    144598220138   0.09 │  489488   491156  -0.34 │
│       coq-mathcomp-character │   63.66    63.80  -0.22 │   290359494802    291309294594  -0.33 │   441739805808    441593430036   0.03 │  712004   710540   0.21 │
│          coq-metacoq-erasure │  332.52   333.24  -0.22 │  1511093333993   1512253510776  -0.08 │  2437237224289   2445928543444  -0.36 │ 2620112  2613736   0.24 │
│                 coq-compcert │  283.03   283.60  -0.20 │  1281399323892   1285922266321  -0.35 │  1949021993591   1962020638092  -0.66 │ 1129000  1128712   0.03 │
│            coq-iris-examples │  477.61   478.51  -0.19 │  2168269135769   2172420296550  -0.19 │  3346153649594   3346651427484  -0.01 │ 1072588  1070980   0.15 │
│                    coq-color │  222.87   223.17  -0.13 │  1008114656628   1008256857109  -0.01 │  1471657707569   1477707753785  -0.41 │ 1169772  1172512  -0.23 │
│                 coq-coqprime │   45.13    45.19  -0.13 │   203841211234    203778149312   0.03 │   313369047583    312428017127   0.30 │  776728   779592  -0.37 │
│                 coq-bedrock2 │  312.23   312.47  -0.08 │  1424970940022   1427824576137  -0.20 │  2806934252281   2808644133112  -0.06 │  865000   864412   0.07 │
│                  coq-unimath │ 1467.34  1468.04  -0.05 │  6686780142692   6692572782049  -0.09 │ 12617864661828  12618472964598  -0.00 │ 1315720  1315864  -0.01 │
│                coq-fourcolor │ 1469.02  1468.22   0.05 │  6702597641128   6698509817254   0.06 │ 12123268193475  12125915554623  -0.02 │ 1278360  1278432  -0.01 │
│                     coq-corn │  774.33   772.93   0.18 │  3526658139656   3519088570855   0.22 │  5507885782741   5508817486817  -0.02 │  850044   849788   0.03 │
│        coq-mathcomp-solvable │   76.27    76.11   0.21 │   347887060854    346885818904   0.29 │   535038874014    535240920632  -0.04 │  743532   738792   0.64 │
│            coq-metacoq-pcuic │  620.47   618.94   0.25 │  2820866211365   2812786681301   0.29 │  4189372060960   4195368873777  -0.14 │ 1979416  1975772   0.18 │
│             coq-fiat-parsers │  327.44   326.57   0.27 │  1468714563354   1466168692523   0.17 │  2455116007155   2455508979527  -0.02 │ 3460220  3463036  -0.08 │
│                coq-perennial │ 5729.01  5710.89   0.32 │ 26122742662861  26044028562777   0.30 │ 43556836317898  43576645099210  -0.05 │ 2335436  2317964   0.75 │
│         coq-metacoq-template │  164.69   164.16   0.32 │   736594619552    733996176208   0.35 │  1169596674292   1171578745818  -0.17 │ 1271580  1286288  -1.14 │
│           coq-mathcomp-field │   78.01    77.75   0.33 │   355869925607    354660417864   0.34 │   577892550802    577811075326   0.01 │  926308   926716  -0.04 │
│                   coq-stdlib │  410.53   409.09   0.35 │  1761385691374   1756849337690   0.26 │  1446089350433   1448469488276  -0.16 │  647648   647824  -0.03 │
│                 coq-rewriter │  350.14   348.91   0.35 │  1593925487170   1589803818530   0.26 │  2633225027980   2638853900249  -0.21 │ 1326256  1345204  -1.41 │
│                   coq-geocoq │  601.85   599.49   0.39 │  2736290509595   2727768901907   0.31 │  4335338105914   4327974692724   0.17 │  902608   909424  -0.75 │
│                    coq-verdi │   47.05    46.86   0.41 │   213309948325    212520554628   0.37 │   325336092005    326820381541  -0.45 │  526732   525448   0.24 │
│               coq-coquelicot │   36.54    36.39   0.41 │   162881697486    162651139450   0.14 │   224742763671    224844844250  -0.05 │  785752   784968   0.10 │
│        coq-engine-bench-lite │  156.97   156.30   0.43 │   673479903036    670236627380   0.48 │  1255919011886   1254758509459   0.09 │ 1209688  1209600   0.01 │
│                     coq-core │  113.57   112.91   0.58 │   477729570096    475903073433   0.38 │   484354648061    484254145901   0.02 │  289780   289304   0.16 │
│       coq-mathcomp-odd-order │  400.67   398.19   0.62 │  1831613310251   1820008610848   0.64 │  3056643989079   3055442603784   0.04 │ 1570340  1570412  -0.00 │
│                coq-fiat-core │   59.61    59.21   0.68 │   256302972247    254826684319   0.58 │   377544553192    377992652074  -0.12 │  492296   491768   0.11 │
│         coq-mathcomp-algebra │   61.65    61.21   0.72 │   280884301344    278638468325   0.81 │   391815851845    391725590589   0.02 │  579252   579388  -0.02 │
│       coq-mathcomp-ssreflect │   27.23    27.02   0.78 │   123587153391    122029389836   1.28 │   160688830459    160546847079   0.09 │  578744   576236   0.44 │
│             coq-math-classes │   85.32    84.66   0.78 │   385139505259    383419116926   0.45 │   539435588020    539301370326   0.02 │  519900   519920  -0.00 │
│     coq-metacoq-translations │   17.72    17.57   0.85 │    79228925646     78507774943   0.92 │   128540222440    128795870888  -0.20 │  913884   912200   0.18 │
│                  coq-coqutil │   39.16    38.78   0.98 │   175530778753    174140658357   0.80 │   253454926937    253598127334  -0.06 │  558228   558204   0.00 │
│                      coq-vst │  872.55   860.27   1.43 │  3966354528349   3909953873679   1.44 │  6574750645926   6471619840234   1.59 │ 2270668  2134872   6.36 │
└──────────────────────────────┴─────────────────────────┴───────────────────────────────────────┴───────────────────────────────────────┴─────────────────────────┘

🐢 Top 25 slow downs
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                              TOP 25 SLOW DOWNS                                                               │
│                                                                                                                                              │
│   OLD      NEW     DIFF      %DIFF     Ln                     FILE                                                                           │
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│  4.4170  16.6260  12.2090    276.41%    84  coq-vst/veric/binop_lemmas2.v.html                                                               │
│ 43.0770  44.5950   1.5180      3.52%   236  coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html                       │
│ 19.3480  20.5320   1.1840      6.12%  2061  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/compiler/src/compiler/FlatToRiscvFunctions.v.html │
│  3.5730   4.4430   0.8700     24.35%   937  coq-vst/veric/binop_lemmas2.v.html                                                               │
│  7.1660   7.7900   0.6240      8.71%   881  coq-vst/veric/binop_lemmas4.v.html                                                               │
│  6.5000   7.1180   0.6180      9.51%   477  coq-vst/veric/expr_lemmas3.v.html                                                                │
│  5.7970   6.3230   0.5260      9.07%     5  coq-fiat-crypto-with-bedrock/src/Assembly/Parse/Examples/fiat_p256_mul_optimised_seed12.v.html   │
│  1.4340   1.8780   0.4440     30.96%    60  coq-vst/veric/binop_lemmas2.v.html                                                               │
│  0.6370   1.0220   0.3850     60.44%  1763  coq-perennial/src/program_proof/simplepb/apps/eesm_proof.v.html                                  │
│  6.4700   6.8100   0.3400      5.26%   629  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/bedrock2/src/bedrock2Examples/LAN9250.v.html      │
│  4.2400   4.5700   0.3300      7.78%   237  coq-fiat-parsers/src/Parsers/ParserFromParserADT.v.html                                          │
│ 10.6870  11.0060   0.3190      2.98%    55  coq-category-theory/Construction/Comma/Natural/Transformation.v.html                             │
│ 29.4070  29.7070   0.3000      1.02%    12  coq-fourcolor/theories/job399to438.v.html                                                        │
│  0.7580   1.0430   0.2850     37.60%    16  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/New/WordByWordMontgomery.v.html         │
│  0.0030   0.2760   0.2730   9100.00%   371  coq-fiat-crypto-with-bedrock/src/CLI.v.html                                                      │
│ 23.3450  23.6110   0.2660      1.14%    12  coq-fourcolor/theories/job511to516.v.html                                                        │
│  0.7600   1.0250   0.2650     34.87%     9  coq-fiat-crypto-with-bedrock/src/Bedrock/End2End/X25519/Field25519.v.html                        │
│  0.0000   0.2640   0.2640       inf%   164  coq-metacoq-erasure/erasure/theories/Typed/ErasureCorrectness.v.html                             │
│  1.6360   1.8960   0.2600     15.89%   716  coq-vst/veric/expr_lemmas.v.html                                                                 │
│  0.0010   0.2590   0.2580  25800.00%   473  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/New/Signature.v.html                    │
│  3.0160   3.2730   0.2570      8.52%   492  coq-perennial/src/program_proof/examples/async_mem_alloc_inode_proof.v.html                      │
│  0.0450   0.3010   0.2560    568.89%   144  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Translation/Proofs/ValidComputable/Cmd.v.html     │
│  0.3890   0.6370   0.2480     63.75%   238  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Translation/Proofs/Cmd.v.html                     │
│  9.6870   9.9340   0.2470      2.55%   446  coq-mathcomp-odd-order/theories/PFsection12.v.html                                               │
│  0.0020   0.2460   0.2440  12200.00%   327  coq-metacoq-pcuic/pcuic/theories/PCUICFirstorder.v.html                                          │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
🐇 Top 25 speed ups
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                  TOP 25 SPEED UPS                                                                   │
│                                                                                                                                                     │
│   OLD       NEW      DIFF     %DIFF    Ln                      FILE                                                                                 │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│  43.4110   41.6410  -1.7700   -4.08%   236  coq-rewriter-perf-SuperFast/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html               │
│  42.2740   40.5060  -1.7680   -4.18%   224  coq-performance-tests-lite/PerformanceExperiments/rewrite_lift_lets_map.v.html                          │
│ 158.6580  157.1250  -1.5330   -0.97%   233  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/deps/riscv-coq/src/riscv/Proofs/DecodeByExtension.v.html │
│ 126.0000  124.7160  -1.2840   -1.02%    22  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/ArithWithCasts.v.html                                  │
│  18.4410   17.1770  -1.2640   -6.85%   376  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/compiler/src/compiler/FlatToRiscvMetric.v.html           │
│  40.9120   39.7270  -1.1850   -2.90%   827  coq-vst/veric/binop_lemmas4.v.html                                                                      │
│ 142.7180  141.5910  -1.1270   -0.79%  1190  coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html                           │
│ 128.7230  127.7680  -0.9550   -0.74%   999  coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html                         │
│ 128.8330  127.8930  -0.9400   -0.73%   968  coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html                         │
│  59.9890   59.0790  -0.9100   -1.52%    27  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/ToFancyWithCasts.v.html                                │
│  25.1210   24.2370  -0.8840   -3.52%    25  coq-fiat-crypto-with-bedrock/src/Spec/Test/X25519.v.html                                                │
│  25.1450   24.2710  -0.8740   -3.48%    20  coq-fiat-crypto-with-bedrock/src/Spec/Test/X25519.v.html                                                │
│  20.0320   19.1820  -0.8500   -4.24%   420  coq-perennial/src/program_proof/simplepb/pb_setstate_proof.v.html                                       │
│  53.0680   52.3060  -0.7620   -1.44%    50  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html                    │
│  34.3760   33.6230  -0.7530   -2.19%   548  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/compiler/src/compiler/MMIO.v.html                        │
│  32.0870   31.3670  -0.7200   -2.24%  1333  coq-fiat-crypto-with-bedrock/rupicola/bedrock2/compiler/src/compiler/FlatToRiscvFunctions.v.html        │
│  65.2180   64.5140  -0.7040   -1.08%   103  coq-fiat-crypto-with-bedrock/src/Arithmetic/BarrettReduction.v.html                                     │
│  30.4150   29.7130  -0.7020   -2.31%   515  coq-metacoq-erasure/erasure/theories/ErasureFunction.v.html                                             │
│ 212.6850  212.0160  -0.6690   -0.31%   141  coq-fiat-crypto-with-bedrock/src/UnsaturatedSolinasHeuristics/Tests.v.html                              │
│   4.7210    4.0540  -0.6670  -14.13%    22  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/ArithWithCasts.v.html                                  │
│  19.7000   19.0440  -0.6560   -3.33%    28  coq-fiat-crypto-with-bedrock/src/Spec/Test/X25519.v.html                                                │
│  12.0020   11.3850  -0.6170   -5.14%   126  coq-vst/veric/binop_lemmas6.v.html                                                                      │
│  28.6810   28.1010  -0.5800   -2.02%  1387  coq-fourcolor/theories/cfmap.v.html                                                                     │
│  27.6940   27.1320  -0.5620   -2.03%    79  coq-rewriter-perf-SuperFast/src/Rewriter/Rewriter/Examples/PerfTesting/SieveOfEratosthenes.v.html       │
│  79.9330   79.3970  -0.5360   -0.67%   618  coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html                                             │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

@ppedrot
Copy link
Member Author

ppedrot commented May 10, 2023

The VST slowdowns in the binop files are real, but funnily enough it's somewhat an indirect bug. They happen with well-known degenerate examples of nested destruct calls that generate a gazillion subgoals. Since we're now checking that intropatterns are not introducing unshelved evars, we observe the bad algorithmic behaviour of Tacticals.is_undefined_up_to_restriction. This is not a new behaviour, the very same problem was already there with these lines, it's just that we perform the evar check even more after this PR so we add a multiplicative factor.

I don't think it's really worth being concerned about. First, I've had these destruct lines on my radar for a while and I was already aware of the evar check issue. The total time added to VST is neglectible, the problem is really in a handful of extremely localized calls to destruct. Second, forgetting about the algorithmic issue with the check for a second, this PR cannot be tweaked insofar as we must indeed check for these evars whatsoever.

So, from my point of view, this PR is ready.

ppedrot added a commit to ppedrot/coq that referenced this pull request May 10, 2023
We only care about the difference between undefined evars, so whenever the
new evarmap has physically the same undefined evars as the original one, we return
immediately.

This seriously alleviates the slowdowns introduced in coq#17564.
@ppedrot
Copy link
Member Author

ppedrot commented May 10, 2023

See #17590 for a workaround. On my machine, that PR seems to be enough to eliminate the slowdown.

@SkySkimmer SkySkimmer self-assigned this May 10, 2023
@SkySkimmer
Copy link
Contributor

@coqbot merge now

@coqbot-app coqbot-app bot merged commit 056eedd into coq:master May 12, 2023
5 checks passed
@ppedrot ppedrot deleted the case-pf-pose-dependent-metas branch May 12, 2023 11:39
@Zimmi48 Zimmi48 mentioned this pull request Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: cleanup Code removal, deprecation, refactorings, etc. kind: fix This fixes a bug or incorrect documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants