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

Do not consider scrutinees of projections and cases as heads for hint mode "!" #14392

Merged
merged 2 commits into from
May 30, 2021

Conversation

mattam82
Copy link
Member

@mattam82 mattam82 commented May 26, 2021

This reverts a change that made Proj (p, ?X) and match ?X with not be considered as not headed by evars for matching a hint mode. Experience shows (e.g. in Iris) that these partial terms can usefully be considered as indices in proof search. Now, only ?X u1 ... un is considered headed by an evar.

Kind: feature

  • Added / updated test-suite

@mattam82 mattam82 requested a review from a team as a code owner May 26, 2021 15:05
@RalfJung
Copy link
Contributor

I think this question came up before, about what the "head" of a primitive projection is. IMO it would make most sense that this be treated consistently (for mode !, for simpl annotations, and anywhere else the "head" of an expression is relevant).

This reverts a change that made Proj (p, ?X) and match ?X with not be considered as not headed by evars for matching a hint mode.

This sentence has too many negations for me to be able to parse it.^^

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 26, 2021

Hey, I have detected that there were CI failures at commit f4d758f without any failure in the test-suite.
I checked that the corresponding jobs for the base commit ac9a310 succeeded. You can ask me to try to extract a minimal test case from this so that it can be added to the test-suite.
If you tag me saying @coqbot ci minimize, I will minimize the following target: ci-perennial.

@JasonGross
Copy link
Member

@coqbot ci minimize

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 26, 2021

I have initiated minimization at commit f4d758f for the suggested target ci-perennial as requested.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 26, 2021

Error: Could not minimize file (from ci-perennial) (full log on GitHub Actions)

build log (truncated to last 26KiB; full 2.1MiB file on GitHub Actions Artifacts under build.log)
logic/crash_adequacy.vos  
  inflating: _build_ci/perennial/src/program_logic/crash_lang.v  
  inflating: _build_ci/perennial/src/program_logic/crash_lang.vo  
  inflating: _build_ci/perennial/src/program_logic/crash_lang.vok  
  inflating: _build_ci/perennial/src/program_logic/crash_lang.vos  
  inflating: _build_ci/perennial/src/program_logic/crash_weakestpre.v  
  inflating: _build_ci/perennial/src/program_logic/crash_weakestpre.vo  
  inflating: _build_ci/perennial/src/program_logic/crash_weakestpre.vok  
  inflating: _build_ci/perennial/src/program_logic/crash_weakestpre.vos  
  inflating: _build_ci/perennial/src/program_logic/dist_adequacy.v  
  inflating: _build_ci/perennial/src/program_logic/dist_adequacy.vo  
  inflating: _build_ci/perennial/src/program_logic/dist_adequacy.vok  
  inflating: _build_ci/perennial/src/program_logic/dist_adequacy.vos  
  inflating: _build_ci/perennial/src/program_logic/dist_lang.v  
  inflating: _build_ci/perennial/src/program_logic/dist_lang.vo  
  inflating: _build_ci/perennial/src/program_logic/dist_lang.vok  
  inflating: _build_ci/perennial/src/program_logic/dist_lang.vos  
  inflating: _build_ci/perennial/src/program_logic/dist_weakestpre.v  
  inflating: _build_ci/perennial/src/program_logic/dist_weakestpre.vo  
  inflating: _build_ci/perennial/src/program_logic/dist_weakestpre.vok  
  inflating: _build_ci/perennial/src/program_logic/dist_weakestpre.vos  
  inflating: _build_ci/perennial/src/program_logic/ectx_language.v  
  inflating: _build_ci/perennial/src/program_logic/ectx_language.vo  
  inflating: _build_ci/perennial/src/program_logic/ectx_language.vok  
  inflating: _build_ci/perennial/src/program_logic/ectx_language.vos  
  inflating: _build_ci/perennial/src/program_logic/ectx_lifting.v  
  inflating: _build_ci/perennial/src/program_logic/ectx_lifting.vo  
  inflating: _build_ci/perennial/src/program_logic/ectx_lifting.vok  
  inflating: _build_ci/perennial/src/program_logic/ectx_lifting.vos  
  inflating: _build_ci/perennial/src/program_logic/ectxi_language.v  
  inflating: _build_ci/perennial/src/program_logic/ectxi_language.vo  
  inflating: _build_ci/perennial/src/program_logic/ectxi_language.vok  
  inflating: _build_ci/perennial/src/program_logic/ectxi_language.vos  
  inflating: _build_ci/perennial/src/program_logic/gen_dir.v  
  inflating: _build_ci/perennial/src/program_logic/invariants_mutable.v  
  inflating: _build_ci/perennial/src/program_logic/language.v  
  inflating: _build_ci/perennial/src/program_logic/language.vo  
  inflating: _build_ci/perennial/src/program_logic/language.vok  
  inflating: _build_ci/perennial/src/program_logic/language.vos  
  inflating: _build_ci/perennial/src/program_logic/language_ctx.v  
  inflating: _build_ci/perennial/src/program_logic/lifting.v  
  inflating: _build_ci/perennial/src/program_logic/lifting.vo  
  inflating: _build_ci/perennial/src/program_logic/lifting.vok  
  inflating: _build_ci/perennial/src/program_logic/lifting.vos  
  inflating: _build_ci/perennial/src/program_logic/na_crash_inv.v  
  inflating: _build_ci/perennial/src/program_logic/na_crash_inv.vo  
  inflating: _build_ci/perennial/src/program_logic/na_crash_inv.vok  
  inflating: _build_ci/perennial/src/program_logic/na_crash_inv.vos  
  inflating: _build_ci/perennial/src/program_logic/ncinv.v  
  inflating: _build_ci/perennial/src/program_logic/ncinv.vo  
  inflating: _build_ci/perennial/src/program_logic/ncinv.vok  
  inflating: _build_ci/perennial/src/program_logic/ncinv.vos  
  inflating: _build_ci/perennial/src/program_logic/recovery_adequacy.v  
  inflating: _build_ci/perennial/src/program_logic/recovery_adequacy.vo  
  inflating: _build_ci/perennial/src/program_logic/recovery_adequacy.vok  
  inflating: _build_ci/perennial/src/program_logic/recovery_adequacy.vos  
  inflating: _build_ci/perennial/src/program_logic/recovery_weakestpre.v  
  inflating: _build_ci/perennial/src/program_logic/recovery_weakestpre.vo  
  inflating: _build_ci/perennial/src/program_logic/recovery_weakestpre.vok  
  inflating: _build_ci/perennial/src/program_logic/recovery_weakestpre.vos  
  inflating: _build_ci/perennial/src/program_logic/refinement_adequacy.v  
  inflating: _build_ci/perennial/src/program_logic/simulation.v  
  inflating: _build_ci/perennial/src/program_logic/spec_assert.v  
  inflating: _build_ci/perennial/src/program_logic/staged_invariant.v  
  inflating: _build_ci/perennial/src/program_logic/staged_invariant.vo  
  inflating: _build_ci/perennial/src/program_logic/staged_invariant.vok  
  inflating: _build_ci/perennial/src/program_logic/staged_invariant.vos  
  inflating: _build_ci/perennial/src/program_logic/staged_wpc.v  
  inflating: _build_ci/perennial/src/program_logic/staged_wpc.vo  
  inflating: _build_ci/perennial/src/program_logic/staged_wpc.vok  
  inflating: _build_ci/perennial/src/program_logic/staged_wpc.vos  
  inflating: _build_ci/perennial/src/program_logic/step_fupd_extra.v  
  inflating: _build_ci/perennial/src/program_logic/step_fupd_extra.vo  
  inflating: _build_ci/perennial/src/program_logic/step_fupd_extra.vok  
  inflating: _build_ci/perennial/src/program_logic/step_fupd_extra.vos  
  inflating: _build_ci/perennial/src/program_logic/weakestpre.v  
  inflating: _build_ci/perennial/src/program_logic/weakestpre.vo  
  inflating: _build_ci/perennial/src/program_logic/weakestpre.vok  
  inflating: _build_ci/perennial/src/program_logic/weakestpre.vos  
  inflating: _build_ci/perennial/src/program_logic/weakestpre_notation.v  
  inflating: _build_ci/perennial/src/program_logic/weakestpre_notation.vo  
  inflating: _build_ci/perennial/src/program_logic/weakestpre_notation.vok  
  inflating: _build_ci/perennial/src/program_logic/weakestpre_notation.vos  
   creating: _build_ci/perennial/src/program_proof/
  inflating: _build_ci/perennial/src/program_proof/.append_log_proof.aux  
   creating: _build_ci/perennial/src/program_proof/.coq-native/
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_append_log_proof.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_append_log_proof.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_append_log_proof.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_append_log_proof.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_lib.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_lib.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_lib.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_lib.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_prelude.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_prelude.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_prelude.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_disk_prelude.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_dist_prelude.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_dist_prelude.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_dist_prelude.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_dist_prelude.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_block.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_block.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_block.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_block.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_proof.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_proof.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_proof.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_marshal_proof.o  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_proof_prelude.cmi  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_proof_prelude.cmx  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_proof_prelude.cmxs  
  inflating: _build_ci/perennial/src/program_proof/.coq-native/NPerennial_program_proof_proof_prelude.o  
  inflating: _build_ci/perennial/src/program_proof/.disk_lib.aux  
  inflating: _build_ci/perennial/src/program_proof/.disk_prelude.aux  
  inflating: _build_ci/perennial/src/program_proof/.dist_prelude.aux  
  inflating: _build_ci/perennial/src/program_proof/.marshal_block.aux  
  inflating: _build_ci/perennial/src/program_proof/.marshal_proof.aux  
  inflating: _build_ci/perennial/src/program_proof/.proof_prelude.aux  
   creating: _build_ci/perennial/src/program_proof/addr/
  inflating: _build_ci/perennial/src/program_proof/addr/addr_proof.v  
   creating: _build_ci/perennial/src/program_proof/alloc/
  inflating: _build_ci/perennial/src/program_proof/alloc/alloc_proof.v  
  inflating: _build_ci/perennial/src/program_proof/append_log_hocap.v  
  inflating: _build_ci/perennial/src/program_proof/append_log_proof.v  
  inflating: _build_ci/perennial/src/program_proof/append_log_proof.vo  
  inflating: _build_ci/perennial/src/program_proof/append_log_proof.vok  
  inflating: _build_ci/perennial/src/program_proof/append_log_proof.vos  
  inflating: _build_ci/perennial/src/program_proof/append_log_refinement.v  
  inflating: _build_ci/perennial/src/program_proof/append_log_refinement_triples.v  
   creating: _build_ci/perennial/src/program_proof/buf/
  inflating: _build_ci/perennial/src/program_proof/buf/buf_proof.v  
  inflating: _build_ci/perennial/src/program_proof/buf/defs.v  
  inflating: _build_ci/perennial/src/program_proof/crash_example.v  
  inflating: _build_ci/perennial/src/program_proof/crash_lockmap_proof.v  
  inflating: _build_ci/perennial/src/program_proof/disk_lib.v  
  inflating: _build_ci/perennial/src/program_proof/disk_lib.vo  
  inflating: _build_ci/perennial/src/program_proof/disk_lib.vok  
  inflating: _build_ci/perennial/src/program_proof/disk_lib.vos  
  inflating: _build_ci/perennial/src/program_proof/disk_prelude.v  
  inflating: _build_ci/perennial/src/program_proof/disk_prelude.vo  
  inflating: _build_ci/perennial/src/program_proof/disk_prelude.vok  
  inflating: _build_ci/perennial/src/program_proof/disk_prelude.vos  
  inflating: _build_ci/perennial/src/program_proof/dist_prelude.v  
  inflating: _build_ci/perennial/src/program_proof/dist_prelude.vo  
  inflating: _build_ci/perennial/src/program_proof/dist_prelude.vok  
  inflating: _build_ci/perennial/src/program_proof/dist_prelude.vos  
   creating: _build_ci/perennial/src/program_proof/examples/
  inflating: _build_ci/perennial/src/program_proof/examples/.alloc_addrset.aux  
  inflating: _build_ci/perennial/src/program_proof/examples/.alloc_crash_proof.aux  
   creating: _build_ci/perennial/src/program_proof/examples/.coq-native/
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_addrset.cmi  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_addrset.cmx  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_addrset.cmxs  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_addrset.o  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_crash_proof.cmi  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_crash_proof.cmx  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_crash_proof.cmxs  
  inflating: _build_ci/perennial/src/program_proof/examples/.coq-native/NPerennial_program_proof_examples_alloc_crash_proof.o  
  inflating: _build_ci/perennial/src/program_proof/examples/.inode_proof.aux  
  inflating: _build_ci/perennial/src/program_proof/examples/all_examples.v  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_addrset.v  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_addrset.vo  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_addrset.vok  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_addrset.vos  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_crash_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_crash_proof.vo  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_crash_proof.vok  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_crash_proof.vos  
  inflating: _build_ci/perennial/src/program_proof/examples/alloc_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/async_inode_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/dir_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/indirect_inode_append_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/indirect_inode_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/inode_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/print_assumptions.v  
  inflating: _build_ci/perennial/src/program_proof/examples/replicated_block_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/single_async_inode_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/single_inode_proof.v  
  inflating: _build_ci/perennial/src/program_proof/examples/toy_proof.v  
   creating: _build_ci/perennial/src/program_proof/jrnl/
  inflating: _build_ci/perennial/src/program_proof/jrnl/jrnl_proof.v  
  inflating: _build_ci/perennial/src/program_proof/jrnl/sep_jrnl_invariant.v  
  inflating: _build_ci/perennial/src/program_proof/jrnl/sep_jrnl_ops.v  
  inflating: _build_ci/perennial/src/program_proof/jrnl/sep_jrnl_proof.v  
  inflating: _build_ci/perennial/src/program_proof/jrnl/sep_jrnl_recovery_proof.v  
   creating: _build_ci/perennial/src/program_proof/jrnl_replication/
  inflating: _build_ci/perennial/src/program_proof/jrnl_replication/jrnl_replication_proof.v  
   creating: _build_ci/perennial/src/program_proof/kvs/
  inflating: _build_ci/perennial/src/program_proof/kvs/specs.v  
  inflating: _build_ci/perennial/src/program_proof/lockmap_proof.v  
   creating: _build_ci/perennial/src/program_proof/lockservice/
  inflating: _build_ci/perennial/src/program_proof/lockservice/aof_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/bank_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/common_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/fmcounter_map.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/gokv_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/incr_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/incr_proxy_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/kv_durable.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/kv_logatom.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/kv_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/lockservice_nocrash.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/lockservice_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/movers.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/nondet.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/rpc.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/rpc_durable_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/rpc_logatom.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/rpc_logatom_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/rpc_proof.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/scratch.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/two_pc_example.v  
  inflating: _build_ci/perennial/src/program_proof/lockservice/wpc_proofmode.v  
  inflating: _build_ci/perennial/src/program_proof/marshal_block.v  
  inflating: _build_ci/perennial/src/program_proof/marshal_block.vo  
  inflating: _build_ci/perennial/src/program_proof/marshal_block.vok  
  inflating: _build_ci/perennial/src/program_proof/marshal_block.vos  
  inflating: _build_ci/perennial/src/program_proof/marshal_proof.v  
  inflating: _build_ci/perennial/src/program_proof/marshal_proof.vo  
  inflating: _build_ci/perennial/src/program_proof/marshal_proof.vok  
  inflating: _build_ci/perennial/src/program_proof/marshal_proof.vos  
   creating: _build_ci/perennial/src/program_proof/memkv/
  inflating: _build_ci/perennial/src/program_proof/memkv/closed.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/common_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_clerk_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_conditional_put_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_coord_clerk_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_coord_definitions.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_coord_ghost_init.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_coord_make_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_coord_start_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_get_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_getcid_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_ghost.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_install_shard_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_conditional_put_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_get_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_getcid_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_install_shard_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_move_shard_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_marshal_put_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_move_shard_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_put_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_shard_clerk_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_shard_definitions.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_shard_ghost_init.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_shard_make_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/memkv_shard_start_proof.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/print_assumptions.v  
  inflating: _build_ci/perennial/src/program_proof/memkv/rpc_proof.v  
   creating: _build_ci/perennial/src/program_proof/obj/
  inflating: _build_ci/perennial/src/program_proof/obj/commit_proof.v  
  inflating: _build_ci/perennial/src/program_proof/obj/invariant.v  
  inflating: _build_ci/perennial/src/program_proof/obj/load_proof.v  
  inflating: _build_ci/perennial/src/program_proof/obj/map_helpers.v  
  inflating: _build_ci/perennial/src/program_proof/obj/obj_proof.v  
  inflating: _build_ci/perennial/src/program_proof/obj/recovery_proof.v  
  inflating: _build_ci/perennial/src/program_proof/proof_prelude.v  
  inflating: _build_ci/perennial/src/program_proof/proof_prelude.vo  
  inflating: _build_ci/perennial/src/program_proof/proof_prelude.vok  
  inflating: _build_ci/perennial/src/program_proof/proof_prelude.vos  
   creating: _build_ci/perennial/src/program_proof/simple/
  inflating: _build_ci/perennial/src/program_proof/simple/common.v  
  inflating: _build_ci/perennial/src/program_proof/simple/example.v  
  inflating: _build_ci/perennial/src/program_proof/simple/getattr.v  
  inflating: _build_ci/perennial/src/program_proof/simple/invariant.v  
  inflating: _build_ci/perennial/src/program_proof/simple/iread.v  
  inflating: _build_ci/perennial/src/program_proof/simple/iwrite.v  
  inflating: _build_ci/perennial/src/program_proof/simple/print_assumptions.v  
  inflating: _build_ci/perennial/src/program_proof/simple/proofs.v  
  inflating: _build_ci/perennial/src/program_proof/simple/read.v  
  inflating: _build_ci/perennial/src/program_proof/simple/recovery.v  
  inflating: _build_ci/perennial/src/program_proof/simple/setattr.v  
  inflating: _build_ci/perennial/src/program_proof/simple/spec.v  
  inflating: _build_ci/perennial/src/program_proof/simple/write.v  
   creating: _build_ci/perennial/src/program_proof/single/
  inflating: _build_ci/perennial/src/program_proof/single/election.v  
  inflating: _build_ci/perennial/src/program_proof/single/replica_proof.v  
  inflating: _build_ci/perennial/src/program_proof/single/single_proof.v  
  inflating: _build_ci/perennial/src/program_proof/single/try_decide_proof.v  
   creating: _build_ci/perennial/src/program_proof/txn/
  inflating: _build_ci/perennial/src/program_proof/txn/README.md  
  inflating: _build_ci/perennial/src/program_proof/txn/op_wrappers.v  
  inflating: _build_ci/perennial/src/program_proof/txn/twophase_refinement_defs.v  
  inflating: _build_ci/perennial/src/program_proof/txn/twophase_refinement_proof.v  
  inflating: _build_ci/perennial/src/program_proof/txn/twophase_refinement_thm.v  
  inflating: _build_ci/perennial/src/program_proof/txn/twophase_sub_logical_reln_defs.v  
  inflating: _build_ci/perennial/src/program_proof/txn/txn_proof.v  
  inflating: _build_ci/perennial/src/program_proof/txn/typed_translate.v  
  inflating: _build_ci/perennial/src/program_proof/txn/typed_translate_facts.v  
  inflating: _build_ci/perennial/src/program_proof/txn/wrapper_init_proof.v  
  inflating: _build_ci/perennial/src/program_proof/txn/wrapper_proof.v  
  inflating: _build_ci/perennial/src/program_proof/util_proof.v  
   creating: _build_ci/perennial/src/program_proof/wal/
  inflating: _build_ci/perennial/src/program_proof/wal/abstraction.v  
  inflating: _build_ci/perennial/src/program_proof/wal/circ_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/circ_proof_crash.v  
  inflating: _build_ci/perennial/src/program_proof/wal/common_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/flush_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/heapspec.v  
  inflating: _build_ci/perennial/src/program_proof/wal/heapspec_lib.v  
  inflating: _build_ci/perennial/src/program_proof/wal/heapspec_list.v  
  inflating: _build_ci/perennial/src/program_proof/wal/highest.v  
  inflating: _build_ci/perennial/src/program_proof/wal/installer_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/invariant.v  
  inflating: _build_ci/perennial/src/program_proof/wal/lib.v  
  inflating: _build_ci/perennial/src/program_proof/wal/logger_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/read_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/recovery_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/sliding.v  
  inflating: _build_ci/perennial/src/program_proof/wal/sliding_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wal/specs.v  
  inflating: _build_ci/perennial/src/program_proof/wal/thread_owned.v  
  inflating: _build_ci/perennial/src/program_proof/wal/transitions.v  
  inflating: _build_ci/perennial/src/program_proof/wal/txns_ctx.v  
  inflating: _build_ci/perennial/src/program_proof/wal/write_proof.v  
  inflating: _build_ci/perennial/src/program_proof/wp_to_wpc.v  
   creating: _build_ci/perennial/src/tutorial/
  inflating: _build_ci/perennial/src/tutorial/ipm_extensions.org  
  inflating: _build_ci/perennial/src/tutorial/ipm_extensions.v  
++ popd
/github/workspace/builds/coq /github/workspace
++ echo ::endgroup::
::endgroup::
++ echo '::group::download passing artifacts'
::group::download passing artifacts
++ pushd coq-passing
/github/workspace/builds/coq/coq-passing /github/workspace/builds/coq /github/workspace
++ git checkout ac9a31046f82a4a489452b82c56a9d8cb7efc77c
Note: checking out 'ac9a31046f82a4a489452b82c56a9d8cb7efc77c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at ac9a31046f Merge PR #14387: [docgram] Fix list of excluded files.
++ for i in ${PASSING_ARTIFACT_URLS}
++ wget https://gitlab.com/coq/coq/-/jobs/1295312177/artifacts/download -O artifact.zip
--2021-05-26 20:58:28--  https://gitlab.com/coq/coq/-/jobs/1295312177/artifacts/download
Resolving gitlab.com (gitlab.com)... 172.65.251.78, 2606:4700:90:0:f22e:fbec:5bed:a9b9
Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-05-26 20:58:29 ERROR 404: Not Found.
minimizer log

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.

@JasonGross
Copy link
Member

Let's try again now that the base check has finished

@coqbot ci minimize

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 26, 2021

I have initiated minimization at commit f4d758f for the suggested target ci-perennial as requested.
However, you may want to try again once the pipeline for the base commit (ac9a310) finishes.

@mattam82
Copy link
Member Author

mattam82 commented May 26, 2021

Said otherwise, in mode !, an index term of a constraint matches except if it is of the shape ?X t1 ... tn. Before this PR, ?X.(p) and match ?X with ... would not match "!". For simpl, the head would rather be the name of the constant/projection rather than the discriminee, so this PR is more consistent with this view.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 26, 2021

Minimized File /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.v (from ci-perennial) (full log on GitHub Actions)

Minimized Coq File (truncated to 32KiB; full 45KiB file on GitHub Actions Artifacts under bug.v)
Declare ML Module "ltac_plugin".
Module Export AdmitTactic.
Module Import LocalFalse.
Inductive False := .
End LocalFalse.
Axiom proof_admitted : False.
Tactic Notation "admit" := abstract case proof_admitted.
End AdmitTactic.
Require RecordUpdate.RecordSet.
Require Coq.ssr.ssreflect.
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.Sorting.Permutation.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require stdpp.options.
Require stdpp.base.
Require Coq.micromega.Lia.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require stdpp.tactics.
Require stdpp.orders.
Require stdpp.option.
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.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.countable.
Require stdpp.vector.
Require Coq.Arith.Wf_nat.
Require stdpp.finite.
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.bi.notation.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
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.list.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.local_updates.
Require iris.algebra.proofmode_classes.
Require iris.algebra.gmap.
Require iris.bi.big_op.
Require stdpp.coPset.
Require iris.bi.internal_eq.
Require iris.bi.plainly.
Require iris.bi.updates.
Require iris.bi.embedding.
Require iris.bi.bi.
Require stdpp.telescopes.
Require iris.bi.telescopes.
Require iris.proofmode.base.
Require iris.proofmode.environments.
Require iris.proofmode.reduction.
Require iris.bi.monpred.
Require stdpp.namespaces.
Require stdpp.hlist.
Require iris.proofmode.tokens.
Require iris.proofmode.sel_patterns.
Require iris.proofmode.intro_patterns.
Require iris.proofmode.spec_patterns.
Require iris.proofmode.ident_name.
Require iris.proofmode.modalities.
Require iris.proofmode.classes.
Require iris.proofmode.modality_instances.
Require iris.proofmode.coq_tactics.
Require Ltac2.Init.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Bool.
Require Ltac2.Array.
Require Ltac2.Char.
Require Ltac2.Constr.
Require Ltac2.Std.
Require Ltac2.Env.
Require Ltac2.List.
Require Ltac2.Fresh.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Ltac1.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require Ltac2.Printf.
Require Ltac2.String.
Require Ltac2.Notations.
Require Ltac2.Ltac2.
Require Coq.Init.Byte.
Require iris.proofmode.string_ident.
Require iris.proofmode.notation.
Require iris.proofmode.ltac_tactics.
Require stdpp.nat_cancel.
Require iris.proofmode.class_instances.
Require iris.proofmode.class_instances_later.
Require iris.proofmode.class_instances_updates.
Require iris.proofmode.class_instances_embedding.
Require iris.proofmode.class_instances_plainly.
Require iris.proofmode.class_instances_internal_eq.
Require iris.proofmode.frame_instances.
Require iris.proofmode.tactics.
Require iris.proofmode.monpred.
Require Perennial.Helpers.ipm.
Require iris_named_props.named_props.
Require Perennial.Helpers.NamedProps.
Require iris.algebra.frac.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require iris.algebra.view.
Require iris.algebra.auth.
Require iris.algebra.excl.
Require iris.bi.lib.fractional.
Require iris.algebra.gset.
Require iris.algebra.coPset.
Require iris.algebra.functions.
Require iris.algebra.cofe_solver.
Require iris.base_logic.upred.
Require iris.base_logic.bi.
Require iris.base_logic.derived.
Require iris.base_logic.proofmode.
Require iris.algebra.csum.
Require iris.algebra.lib.excl_auth.
Require iris.algebra.lib.gmap_view.
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 iris.algebra.vector.
Require Perennial.base_logic.lib.iprop.
Require Perennial.algebra.auth_frac.
Require Perennial.algebra.mlist.
Require Perennial.base_logic.lib.wsat.
Require Perennial.base_logic.lib.fancy_updates.
Require Perennial.base_logic.lib.crash_token.
Require Perennial.base_logic.lib.ncfupd.
Require Perennial.program_logic.language.
Require Perennial.program_logic.weakestpre_notation.
Require Perennial.base_logic.lib.fupd_level.
Require Perennial.base_logic.lib.ae_invariants.
Require Perennial.base_logic.lib.invariants.
Require Perennial.program_logic.step_fupd_extra.
Require Perennial.program_logic.ae_invariants_mutable.
Require Perennial.base_logic.base_logic.
Require Perennial.algebra.laterN.
Require Perennial.algebra.atleast.
Require Perennial.algebra.big_op.big_sepL.
Require Perennial.algebra.own_discrete.
Require Perennial.program_logic.ectx_language.
Require Perennial.program_logic.crash_weakestpre.
Require Perennial.program_logic.weakestpre.
Require Perennial.program_logic.lifting.
Require Perennial.program_logic.ectx_lifting.
Require Perennial.Helpers.Transitions.
Require Coq.Arith.Min.
Require iris.algebra.reservation_map.
Require iris.algebra.cmra_big_op.
Require iris.algebra.numbers.
Require Perennial.algebra.blocks.
Require Perennial.algebra.na_heap.
Require Coq.Program.Equality.
Require stdpp.binders.
Require Perennial.program_logic.ectxi_language.
Require Perennial.Helpers.CountableTactics.
Require Perennial.program_logic.crash_lang.
Require Perennial.goose_lang.locations.
Require coqutil.Datatypes.PrimitivePair.
Require coqutil.Datatypes.HList.
Require coqutil.Z.Lia.
Require Coq.btauto.Btauto.
Require coqutil.Z.bitblast.
Require Coq.ZArith.BinInt.
Require coqutil.Z.div_mod_to_equations.
Require coqutil.Z.BitOps.
Require Coq.ZArith.BinIntDef.
Require coqutil.sanity.
Require coqutil.Word.Interface.
Require Coq.ZArith.Zpow_facts.
Require coqutil.Z.PushPullMod.
Require Coq.setoid_ring.Ring_theory.
Require coqutil.Tactics.autoforward.
Require Coq.Arith.PeanoNat.
Require Coq.Arith.Compare_dec.
Require coqutil.Decidable.
Require coqutil.Word.Properties.
Require coqutil.Word.Naive.
Require Perennial.Helpers.LittleEndian.
Require Perennial.Helpers.Integers.
Require Perennial.goose_lang.lang.
Require Perennial.goose_lang.tactics.
Require Perennial.goose_lang.notation.
Require Perennial.goose_lang.lib.control.impl.
Require Perennial.goose_lang.lib.map.impl.
Require Perennial.goose_lang.lib.list.impl.
Require Perennial.goose_lang.typing.
Require Perennial.goose_lang.lifting.
Require Perennial.goose_lang.crash_modality.
Require Perennial.algebra.abs_laterable.
Require Perennial.program_logic.atomic.
Require Perennial.goose_lang.lib.typed_mem.impl.
Require Perennial.goose_lang.lib.struct.impl.
Require Perennial.goose_lang.lib.loop.impl.
Require Perennial.goose_lang.lib.slice.impl.
Require Perennial.goose_lang.lib.encoding.impl.
Require Perennial.goose_lang.lib.lock.impl.
Require Perennial.goose_lang.prelude.
Require iris.base_logic.lib.ghost_map.
Require iris.base_logic.lib.gen_heap.
Require Perennial.base_logic.lib.gen_heap.
Require Perennial.Helpers.gset.
Require Perennial.Helpers.Map.
Require Perennial.base_logic.lib.ghost_map.
Require Perennial.algebra.gen_heap_names.
Require Perennial.Helpers.List.
Require Coq.micromega.Psatz.
Require Perennial.Helpers.Qextra.
Require Perennial.Helpers.Fractional.
Require Perennial.goose_lang.proofmode.
Require iris.base_logic.lib.wsat.
Require iris.base_logic.lib.fancy_updates.
Require iris.base_logic.lib.invariants.
Require Perennial.Helpers.iris.
Require Perennial.goose_lang.lib.persistent_readonly.
Require Perennial.goose_lang.lib.typed_mem.typed_mem.
Require Perennial.goose_lang.array.
Require Perennial.goose_lang.lib.control.control.
Require Perennial.goose_lang.lib.slice.slice.
Require iris.base_logic.lib.proph_map.
Require Perennial.base_logic.lib.proph_map.
Require Perennial.goose_lang.adequacy.
Require Perennial.goose_lang.ffi.disk.
Require Perennial.goose_lang.ffi.disk_prelude.
Require Goose.github_com.mit_pdos.perennial_examples.alloc.
Require Goose.github_com.tchajed.marshal.
Require Goose.github_com.mit_pdos.perennial_examples.inode.
Require iris.base_logic.lib.saved_prop.
Require Perennial.base_logic.lib.saved_prop.
Require Perennial.program_logic.staged_invariant.
Require iris.bi.lib.laterable.
Require Perennial.program_logic.staged_wpc.
Require Perennial.program_logic.na_crash_inv.
Require Perennial.program_logic.ncinv.
Require Perennial.algebra.big_op.big_sepS.
Require Perennial.algebra.big_op.big_sepM.
Require Perennial.iris_lib.conflicting.
Require Perennial.algebra.big_op.big_sepML.
Require Perennial.algebra.big_op.
Require Perennial.Helpers.Tactics.
Require Perennial.Helpers.ListLen.
Require Perennial.Helpers.BigOp.
Require iris.algebra.lib.frac_agree.
Require iris.base_logic.lib.ghost_var.
Require Perennial.base_logic.lib.ghost_var.
Require Perennial.goose_lang.lib.struct.struct.
Require Perennial.Helpers.ProofCaching.
Require Perennial.goose_lang.wpc_proofmode.
Require Perennial.goose_lang.lib.into_val.
Require Perennial.goose_lang.lib.loop.loop.
Require Perennial.goose_lang.lib.lock.lock.
Require Perennial.goose_lang.lib.map.map.
Require Perennial.goose_lang.lib.map.typed_map.
Require Perennial.program_proof.proof_prelude.
Require Perennial.program_proof.disk_prelude.
Require Perennial.goose_lang.lib.slice.typed_slice.
Require Perennial.Helpers.range_set.
Require Perennial.program_proof.examples.alloc_addrset.
Require Perennial.program_proof.examples.alloc_crash_proof.
Require Perennial.goose_lang.lib.lock.crash_lock.
Require Perennial.program_proof.disk_lib.
Require Perennial.goose_lang.lib.encoding.encoding.
Require Perennial.program_proof.marshal_proof.
Require Perennial.program_proof.marshal_block.

Import RecordUpdate.RecordSet.
Import Perennial.goose_lang.crash_modality.
Import Perennial.program_logic.atomic.
Import Goose.github_com.mit_pdos.perennial_examples.inode.

(* TODO: alloc_crash_proof must be imported early since otherwise it messes up a
bunch of things, like Z_scope, encode, and val *)
Import Perennial.algebra.own_discrete.
Import Perennial.program_proof.examples.alloc_crash_proof.
Import Perennial.goose_lang.lib.lock.crash_lock.
Import Perennial.program_proof.disk_prelude.
Import Perennial.goose_lang.lib.into_val Perennial.goose_lang.lib.slice.typed_slice.
Import Perennial.program_proof.marshal_block Perennial.program_proof.disk_lib.

Definition InodeMaxBlocks: Z := 511.

Remove Hints fractional.into_sep_fractional : typeclass_instances.

Module inode.
  Record t :=
    mk { (* addresses consumed by this inode *)
         addrs: gset u64;
         blocks: list Block; }.
  Global Instance _eta: Settable _ := settable! mk <addrs; blocks>.
  Global Instance _witness: Inhabited t := populate!.

  Definition wf σ := length σ.(blocks) ≤ InodeMaxBlocks.
  Definition size σ := length σ.(blocks).
End inode.

Hint Unfold inode.wf InodeMaxBlocks : word.

Section goose.
Context `{!heapG Σ}.
Context `{!stagedG Σ}.
Context `{!allocG Σ}.

(* The client picks the namespaces that we use for everything. *)
Context (inodeN allocN: namespace).

Implicit Types (σ: inode.t) (addr: u64).
Implicit Types (l:loc) (γ:gname) (P: inode.t → iProp Σ).

Definition is_inode_durable addr σ (addrs: list u64) : iProp Σ :=
  ∃ (hdr: Block),
    "%Hwf" ∷ ⌜inode.wf σ⌝ ∗
    "%Hencoded" ∷ ⌜block_encodes hdr ([EncUInt64 (length addrs)] ++ (EncUInt64 <$> addrs))⌝ ∗
    "%Haddrs_set" ∷ ⌜list_to_set addrs = σ.(inode.addrs)⌝ ∗
    "Hhdr" ∷ int.Z addr d↦ hdr ∗
    (* TODO: this does not support reading lock-free; we could make it [∃ q,
    int.Z a d↦{q} b], but that wouldn't support lock-free writes if we
    implemented those *)
    "Hdata" ∷ [∗ list] a;b ∈ addrs;σ.(inode.blocks), int.Z a d↦ b
.
Local Hint Extern 1 (environments.envs_entails _ (is_inode_durable _ _ _)) => unfold is_inode_durable : core.

Theorem is_inode_durable_read addr σ addrs :
  is_inode_durable addr σ addrs -∗
    ∃ hdr,
      "%Hwf" ∷ ⌜inode.wf σ⌝ ∗
      "%Hencoded" ∷ ⌜block_encodes hdr ([EncUInt64 (length addrs)] ++ (EncUInt64 <$> addrs))⌝ ∗
      "%Haddrs_set" ∷ ⌜list_to_set addrs = σ.(inode.addrs)⌝ ∗
      "Hhdr" ∷ int.Z addr d↦ hdr ∗
      "Hdata" ∷ ([∗ list] a;b ∈ addrs;σ.(inode.blocks), int.Z a d↦ b) ∗
      "Hdurable" ∷ □(int.Z addr d↦ hdr -∗
                    ([∗ list] a;b ∈ addrs;σ.(inode.blocks), int.Z a d↦ b) -∗
                   is_inode_durable addr σ addrs).
Proof.
  iNamed 1.
  iExists _; iFrame "∗ %".
  iIntros "!> Hhdr Hdata".
  iExists _; iFrame "∗ %".
Qed.

Definition inode_linv (l:loc) (addr:u64) σ : iProp Σ :=
  ∃ (addr_s: Slice.t) (addrs: list u64),
    "%Hwf" ∷ ⌜inode.wf σ⌝ ∗
    "Hdurable" ∷ is_inode_durable addr σ addrs ∗
    "addrs" ∷ l ↦[Inode :: "addrs"] (slice_val addr_s) ∗
    "Haddrs" ∷ is_slice addr_s uint64T 1 addrs
.
Local Hint Extern 1 (environments.envs_entails _ (inode_linv _ _ _)) => unfold inode_linv : core.

Definition inode_cinv addr σ: iProp Σ :=
  ∃ addrs, is_inode_durable addr σ addrs.
Local Hint Extern 1 (environments.envs_entails _ (inode_cinv _ _)) => unfold inode_cinv : core.

Existing Instance persistent_discretizable.
Instance inode_cinv_discretizable addr σ:
  Discretizable (inode_cinv addr σ).
Proof. apply _. Qed.

Instance into_disc_inode_linv l addr σ:
  IntoDiscrete (inode_linv l addr σ) (inode_cinv addr σ).
Proof. rewrite /IntoDiscrete. iIntros "H". iNamed "H". iModIntro. iExists _; eauto. Qed.

Definition inode_state l d (lref: loc) addr : iProp Σ :=
  "#d" ∷ readonly (l ↦[Inode :: "d"] (disk_val d)) ∗
  "#m" ∷ readonly (l ↦[Inode :: "m"] #lref) ∗
  "#addr" ∷ readonly (l ↦[Inode :: "addr"] #addr).

Definition is_inode l k P (addr: u64) : iProp Σ :=
  ∃ d (lref: loc),
    "Hro_state" ∷ inode_state l d lref addr ∗
    "#Hlock" ∷ is_crash_lock inodeN k #lref
              (∃ σ, "Hlockinv" ∷ inode_linv l addr σ ∗ "HP" ∷ P σ)
              (∃ σ, "Hlockcinv" ∷ inode_cinv addr σ ∗ "HP" ∷ P σ).

Definition pre_inode l addr σ : iProp Σ :=
  ∃ d (lref: loc),
    "Hro_state" ∷ inode_state l d lref addr ∗
    "Hfree_lock" ∷ is_free_lock lref ∗
    "Hlockinv" ∷ inode_linv l addr σ.

Global Instance into_disc_pre_inode l addr σ :
  IntoDiscrete (pre_inode l addr σ) (inode_cinv addr σ).
Proof. rewrite /IntoDiscrete. iNamed 1. iModIntro. iFrame. Qed. 

Global Instance is_inode_crash l addr σ :
  IntoCrash (inode_linv l addr σ) (λ _, ∃ addrs, is_inode_durable addr σ addrs)%I.
Proof.
  hnf; iIntros "Hinv".
  iNamed "Hinv".
  iExists addrs.
  iFrame.
  auto.
Qed.

Theorem inode_linv_to_cinv l addr σ :
  inode_linv l addr σ -∗ inode_cinv addr σ.
Proof.
  iNamed 1.
  iExists _; iFrame.
Qed.

Theorem pre_inode_to_cinv l addr σ :
  pre_inode l addr σ -∗ inode_cinv addr σ.
Proof.
  iNamed 1.
  iApply inode_linv_to_cinv; iFrame.
Qed.

Global Instance is_inode_Persistent l k P addr :
  Persistent (is_inode l k P addr).
Proof. apply _. Qed.

(* to initialize the system, we use this theorem to turn a zero block into a
valid post-crash inode state, which we can then recover with the usual [Open]
recovery procedure. *)
Theorem init_inode addr :
  int.Z addr d↦ block0 -∗ inode_cinv addr (inode.mk ∅ []).
Proof.
  iIntros "Hhdr".
  iExists [], block0.
  cbv [inode.blocks big_sepL2].
  iFrame "Hhdr".
  iPureIntro.
  split_and!.
  - rewrite /inode.wf /=.
    cbv; congruence.
  - reflexivity.
  - reflexivity.
Qed.

Theorem is_inode_alloc {k} l P addr σ :
  ▷ P σ -∗
  pre_inode l addr σ ={⊤}=∗
  is_inode l (S k) P addr ∗
  <disc> |C={⊤}_(S k)=> ▷ (∃ σ', inode_cinv addr σ' ∗ P σ').
   (* Crash condition has [P] without extra ▷ because [alloc_crash_lock] strips that later for us. *)
Proof.
  iIntros "HP Hinode"; iNamed "Hinode".
  iMod (alloc_crash_lock_cfupd inodeN k
                           (∃ σ, "Hlockinv" ∷ inode_linv l addr σ ∗ "HP" ∷ P σ)%I
                           (∃ σ, "Hlockcinv" ∷ inode_cinv addr σ ∗ "HP" ∷ P σ)%I
            with "Hfree_lock [] [Hlockinv HP]") as "[His_lock $]".
  { iIntros "!> Hlock !> !>"; iNamed "Hlock".
    iExists _; iFrame.
    iApply inode_linv_to_cinv; auto. }
  { eauto with iFrame. }
  iFrame.
  iModIntro.
  iExists _, _; iFrame.
Qed.

Theorem wpc_Open k {d} {addr σ} :
  {{{ inode_cinv addr σ }}}
    inode.Open (disk_val d) #addr @ k; ⊤
  {{{ l, RET #l; pre_inode l addr σ }}}
  {{{ inode_cinv addr σ }}}.
Proof.
  iIntros (Φ Φc) "Hinode HΦ"; iNamed "Hinode".
  iAssert (□ (int.Z addr d↦ hdr ∗
              ([∗ list] a;b ∈ addrs;σ.(inode.blocks), int.Z a d↦ b) -∗
              inode_cinv addr σ))%I as "#Hinode".
  { eauto 10 with iFrame. }
  iDestruct (big_sepL2_length with "Hdata") as %Hblocklen.
  rewrite /Open.
  wpc_pures.
  { iLeft in "HΦ". iModIntro. iApply "HΦ". iApply ("Hinode" with "[$]"). }
  iCache with "HΦ Hhdr Hdata".
  { crash_case. iApply ("Hinode" with "[$]"). }
  wpc_pures.
  wpc_apply (wpc_Read with "Hhdr").
  iSplit; [ | iNext ].
  { iLeft in "HΦ". iModIntro. iIntros "Hhdr". iApply "HΦ". iApply ("Hinode" with "[$]"). }
  iIntros (s) "(Hhdr&Hs)".
  wpc_frame.
  wp_pures.
  iDestruct (slice.is_slice_to_small with "Hs") as "Hs".
  wp_apply (wp_new_dec with "Hs"); first eauto.
  iIntros (dec) "Hdec".
  wp_apply (wp_Dec__GetInt with "Hdec"); iIntros "Hdec".
  wp_pures.
  wp_apply (wp_Dec__GetInts _ _ _ addrs [] with "[Hdec]").
  { rewrite Hblocklen. word. }
  { rewrite app_nil_r; iFrame. }
  iIntros (addr_s) "[_ Haddrs]".
  wp_pures.
  rewrite -wp_fupd.
  wp_apply wp_new_free_lock.
  iIntros (lref) "Hlock".
  wp_apply wp_allocStruct; auto.
  iIntros (l) "inode".
  iDestruct (struct_fields_split with "inode") as "(d&m&addr&addrs&_)".
  iMod (readonly_alloc_1 with "d") as "#d".
  iMod (readonly_alloc_1 with "m") as "#m".
  iMod (readonly_alloc_1 with "addr") as "#addr".
  iModIntro.
  iNamed 1.
  iApply "HΦ".
  iExists _, _; iFrame.
  iSplitR.
  { iFrame "#". }
  iExists _, _; iFrame "% ∗".
  iExists _; iFrame "% ∗".
Qed.

Theorem is_inode_durable_addrs addr σ addrs :
  is_inode_durable addr σ addrs -∗
  ⌜list_to_set addrs = σ.(inode.addrs)⌝.
Proof.
  iNamed 1.
  iFrame "%".
Qed.

Theorem is_inode_durable_size addr σ addrs :
  is_inode_durable addr σ addrs -∗ ⌜length addrs = length σ.(inode.blocks)⌝.
Proof.
  iNamed 1.
  iDestruct (big_sepL2_length with "Hdata") as "$".
Qed.

Definition used_blocks_pre l σ addrs: iProp Σ :=
  ∃ addr_s,
    "%Haddr_set" ∷ ⌜list_to_set addrs = σ.(inode.addrs)⌝ ∗
    "addrs" ∷ l ↦[Inode :: "addrs"] (slice_val addr_s) ∗
    "Haddrs" ∷ is_slice addr_s uint64T 1 addrs.

(* this lets the caller frame out the durable state for the crash invariant and
the memory state for UsedBlocks *)
Theorem pre_inode_read_addrs l addr σ :
  pre_inode l addr σ -∗
  ∃ addrs, used_blocks_pre l σ addrs ∗
           is_inode_durable addr σ addrs ∗
           (used_blocks_pre l σ addrs -∗
            is_inode_durable addr σ addrs -∗
            pre_inode l addr σ).
Proof.
  iNamed 1.
  iNamed "Hlockinv".
  iDestruct (is_inode_durable_addrs with "Hdurable") as "%Haddr_set".
  iExists addrs.
  iSplitL "addrs Haddrs".
  { iExists _; iFrame "% ∗". }
  iFrame.
  iNamed 1.
  iIntros "Hdurable".
  iExists _, _; iFrame.
  iExists _, _; iFrame "∗ %".
Qed.

Theorem wp_Inode__UsedBlocks {l σ addrs} :
  {{{ used_blocks_pre l σ addrs }}}
    Inode__UsedBlocks #l
  {{{ (s:Slice.t), RET (slice_val s);
      is_slice s uint64T 1 addrs ∗
      ⌜list_to_set addrs = σ.(inode.addrs)⌝ ∗
      (is_slice s uint64T 1 addrs -∗ used_blocks_pre l σ addrs) }}}.
Proof.
  iIntros (Φ) "Hinode HΦ"; iNamed "Hinode".
  wp_call.
  wp_loadField.
  iApply "HΦ".
  iFrame "∗ %".
  iIntros "Haddrs".
  iExists _; iFrame.
Qed.

Theorem wpc_Inode__UsedBlocks {k } {l σ addr} :
  {{{ pre_inode l addr σ  }}}
    Inode__UsedBlocks #l @ k; ⊤
  {{{ (s:Slice.t) (addrs: list u64), RET (slice_val s);
      is_slice s uint64T 1 addrs ∗
      ⌜list_to_set addrs = σ.(inode.addrs)⌝ ∗
      (is_slice s uint64T 1 addrs -∗ pre_inode l addr σ) ∧ inode_cinv addr σ }}}
  {{{ inode_cinv addr σ }}}.
Proof.
  iIntros (Φ Φc) "Hinode HΦ"; iNamed "Hinode".
  (* TODO: wpc_call is broken here (maybe because the only redex is an App) *)
  rewrite /Inode__UsedBlocks.
  wpc_pures.
  { iLeft in "HΦ". iModIntro. by iApply "HΦ". }
  iNamed "Hlockinv".
  wpc_frame "HΦ Hdurable".
  { crash_case. eauto with iFrame. }
  wp_loadField.
  iNamed 1.
  iApply "HΦ".
  iFrame "Haddrs".
  iDestruct (is_inode_durable_addrs with "Hdurable") as "%Haddr_set".
  iSplitR; first auto.
  iSplit.
  - iIntros "Haddrs".
    iExists _, _; iFrame.
    iExists _, _; iFrame "∗ %".
  - iExists _; eauto.
Qed.

Theorem wpc_Inode__Read {k} {l k' P addr} {off: u64} :
  (S k < k')%nat →
  ⊢ {{{ "Hinode" ∷ is_inode l (S k') P addr }}}
    <<{ ∀∀ σ mb, ⌜mb = σ.(inode.blocks) !! int.nat off⌝ ∗ ▷ P σ }>>
      Inode__Read #l #off @ S k; ⊤
    <<{ ▷ P σ }>>
    {{{ s, RET (slice_val s); match mb with Some b => is_block s 1 b | None => ⌜s = Slice.nil⌝ end }}}
    {{{ True }}}.
Proof.
  iIntros (? Φ Φc ?) "!# Hpre Hfupd"; iNamed "Hpre".
  iNamed "Hinode". iNamed "Hro_state".
  wpc_call; [done..|].
  iCache with "Hfupd"; first by crash_case.
  wpc_pures.
  wpc_bind_seq.
  wpc_frame.
  wp_loadField.
  wp_apply (crash_lock.acquire_spec with "Hlock"); first by set_solver.
  iIntros "His_locked".
  iNamed 1.
  wpc_pures.
  wpc_bind_seq.
Ltac crash_lock_open H :=
  lazymatch goal with
  | [ |- envs_entails _ (wpc _ ?k _ _ _ _) ] =>
    match iTypeOf H with
    | Some (_, crash_locked _ _ _ _ _) =>
      iApply (use_crash_locked with H);
      [ try lia (* LVL inequality *)
      | iSplit; [ try iFromCache | ]
      ]
    | Some (_, crash_locked _ _ _ _ _ _) =>
      fail 1 "crash_lock_open:" H "does not have correct LVL"
    | Some (_, _) => fail 1 "crash_lock_open:" H "is not a crash_locked fact"
    | None => fail 1 "crash_lock_open:" H "not found"
    end
  | _ => fail 1 "crash_lock_open: not a wpc"
  end.
  crash_lock_open "His_locked".
  (* XXX: todo, iNamed needs to be better about later *)
  iIntros "H". iDestruct "H" as (?) "(>H1&HP)". iNamed "H1".
  iEval (rewrite /named) in "HP".
  iMod (fupd_later_to_disc with "HP") as "HP".

  iEval (rewrite ->(left_id True bi_wand)%I) in "Hfupd".
  iCache with "Hfupd Hlockinv HP".
  { iLeft in "Hfupd". eauto with iFrame. }
  wpc_call.
  wpc_bind (_ ≥ _)%E.
  iNamed "Hlockinv".
  iCache with "Hfupd HP Hdurable".
  { iLeft in "Hfupd". eauto 10 with iFrame. }
  iDestruct (is_inode_durable_size with "Hdurable") as %Hlen1.
  wpc_frame.
  wp_loadField.
  iDestruct (is_slice_sz with "Haddrs") as %Hlen2.
  autorewrite with len in Hlen2.
  wp_apply wp_slice_len.
  wp_pures. iModIntro.
  iNamed 1.
  wpc_if_destruct.
  - iApply ncfupd_wpc.
    iSplit.
    { iLeft in "Hfupd". eauto 12 with iFrame. }
    iRight in "Hfupd".
    iMod (own_disc_fupd_elim with "HP") as "HP".

    iMod ("Hfupd" $! σ None with "[$HP]") as "[HP HQ]".
    { iPureIntro.
      rewrite lookup_ge_None_2 //.
      lia. }
    iMod (fupd_later_to_disc with "HP") as "HP".
    iModIntro.
    iEval (rewrite ->(left_id True bi_wand)%I) in "HQ".
    wpc_pures.
    { iLeft in "HQ". eauto 12 with iFrame. }
    iMod (own_disc_fupd_elim with "HP") as "HP".
    iModIntro.
    iSplitR "HP addrs Haddrs Hdurable"; last first.
    { eauto 10 with iFrame. }
    iIntros "His_locked".
    iSplit; first by iLeft in "HQ". (* TODO(Ralf): can we avoid this double-proof? *)
    iCache with "HQ"; first by iLeft in "HQ".
    wpc_pures.
    wpc_frame "HQ".
    wp_loadField.
    wp_apply (crash_lock.release_spec with "His_locked"); auto.
    wp_pures. iModIntro.
    iNamed 1.
    iRight in "HQ".
    change slice.nil with (slice_val Slice.nil).
    iApply "HQ"; by iFrame.
  - destruct (list_lookup_lt _ addrs (int.nat off)) as [addr' Hlookup].
    { word. }
    iDestruct (is_slice_split with "Haddrs") as "[Haddrs_small Haddrs]".
    wpc_pures.
    wpc_frame_seq.
    wp_loadField.
    wp_apply (wp_SliceGet _ _ _ _ _ addrs with "[$Haddrs_small //]").
    iIntros "Haddrs_small"; iNamed 1.
    wpc_pures.
    iApply ncfupd_wpc.
    iSplit.
    { iLeft in "Hfupd". eauto 10 with iFrame. }
    iDestruct (is_inode_durable_read with "Hdurable") as "H"; iNamed "H".
    iDestruct (big_sepL2_lookup_1_some with "Hdata") as "%Hblock_lookup"; eauto.
    destruct Hblock_lookup as [b0 Hlookup2].
    iDestruct (is_slice_split with "[$Haddrs_small $Haddrs]") as "Haddrs".
    iDestruct (big_sepL2_lookup_acc_disc with "Hdata") as "[Hb Hdata]"; eauto.
    iRight in "Hfupd".
    iMod (own_disc_fupd_elim with "HP") as "HP".
    iMod ("Hfupd" $! σ with "[$HP]") as "[HP HQ]".
    { iPureIntro; eauto. }
    iEval (rewrite ->(left_id True bi_wand)%I) in "HQ".
    iMod (fupd_later_to_disc with "HP") as "HP".
    iApply wpc_fupd. iModIntro.
    wpc_apply (wpc_Read with "Hb").
    iSplit.
    { iLeft in "HQ". iModIntro. iIntros "Hda".
      iSpecialize ("Hdata" with "Hda").
      iSpecialize ("Hdurable" with "Hhdr Hdata").
      eauto 10 with iFrame. }
    iIntros "!>" (s) "[Hda Hb]".
    iDestruct (own_discrete_elim with "Hdata") as "Hdata".
    iSpecialize ("Hdata" with "Hda").
    iSpecialize ("Hdurable" with "Hhdr Hdata").
    iSplitR "Hdurable addrs Haddrs HP"; last first.
    { iMod (own_disc_fupd_elim with "HP"). eauto 10 with iFrame. }
    iModIntro.
    iIntros "His_locked".
    iSplit; first by iLeft in "HQ". (* TODO(Ralf): can we avoid this double-proof? *)
    iCache with "HQ"; first by iLeft in "HQ".
    wpc_frame.
    wp_loadField.
    wp_apply (crash_lock.release_spec with "His_locked"); auto.
    wp_pures. iModIntro.
    iNamed 1.
    iApply "HQ".
    iFrame.
    rewrite Hlookup2.
    iDestruct (slice.is_slice_to_small with "Hb") as "Hb".
    by iFrame.
Qed.

Theorem wpc_Inode__Read_triple {k} {l k' P addr} {off: u64} Q :
  (S k < k')%nat →
  {{{ "Hinode" ∷ is_inode l (S k') P addr ∗
      "Hfupd" ∷ (∀ σ σ' mb,
        ⌜σ' = σ ∧ mb = σ.(inode.blocks) !! int.nat off⌝ ∗
        ▷ P σ ={⊤}=∗ ▷ P σ' ∗ Q mb)
  }}}
    Inode__Read #l #off @ (S k); ⊤
  {{{ s mb, RET slice_val s;
      (match mb with
       | Some b => is_block s 1 b
       | None => ⌜s = Slice.nil⌝
       end) ∗ Q mb }}}
  {{{ True }}}.
Proof.
  iIntros (? Φ Φc) "Hpre HΦ"; iNamed "Hpre".
  iApply (wpc_step_strong_mono _ _ _ _ _ _ _
         (λ v, (∃ s mb, ⌜ v = slice_val s ⌝ ∗
                match mb with
                | Some b => is_block s 1 b
                | None => ⌜s = Slice.nil⌝
                end ∗ Q mb))%I _ True with "[-HΦ] [HΦ]"); auto.
  2: { iSplit.
       * iNext. iIntros (?) "H". iDestruct "H" as (??) "(%&?)". subst.
         iModIntro. iRight in "HΦ". by iApply "HΦ". 
       * iLeft in "HΦ".  iModIntro. iIntros. iModIntro. by iApply "HΦ". }
  iApply (wpc_Inode__Read with "[] Hinode"); first done.
  { iPureIntro; apply _. }
  iSplit.
  { eauto. }
  iNext. iIntros (σ mb) "[%Hσ HP]". iMod ("Hfupd" with "[$HP //]") as "[HP HQ]".
  iModIntro. iFrame "HP". iSplit.
  { eauto. }
  iIntros (s) "Hblock". iExists _, _; iSplit; first done. iFrame. iApply "Hblock".
Qed.

Theorem wpc_Inode__Size {k} {l k' P addr}:
  (S k < k')%nat →
  ⊢ {{{ "Hinode" ∷ is_inode l (S k') P addr }}}
    <<{ ∀∀ σ (sz: u64), ⌜int.nat sz = inode.size σ⌝ ∗ ▷ P σ }>>
      Inode__Size #l @ S k; ⊤
    <<{ ▷ P σ }>>
    {{{ RET #sz; True }}}
    {{{ True }}}.
Proof.
  iIntros (? Φ Φc Habs) "!# Hpre Hfupd"; iNamed "Hpre".
  iNamed "Hinode". iNamed "Hro_state".
  iEval (rewrite ->(left_id True bi_wand)%I) in "Hfupd".
  rewrite /Inode__Size.
  wpc_pures; first by iLeft in "Hfupd".
  iCache with "Hfupd"; first by iLeft in "Hfupd".
  wpc_frame_seq.
  wp_loadField.
  wp_apply (crash_lock.acquire_spec with "Hlock"); auto.
  iIntros "His_locked".
  iNamed 1.
  wpc_pures.
  wpc_bind_seq.
  crash_lock_open "His_locked".
  iDestruct 1 as (σ) "(>Hlockinv&HP)".
  iMod (fupd_later_to_disc with "HP") as "HP".
  iApply ncfupd_wpc.
  iSplit.
  { iLeft in "Hfupd". eauto 10 with iFrame. }
  iEval (rewrite /named) in "HP".
  iNamed "Hlockinv".
  iNamed "Hlockinv".
  iDestruct (is_slice_sz with "Haddrs") as %Haddrs_sz.
  iDestruct (is_inode_durable_size with "Hdurable") as %Hblocks_length.

  iRight in "Hfupd".
  iMod (own_disc_fupd_elim with "HP") as "HP".
  iMod ("Hfupd" $! σ addr_s.(Slice.sz) with "[$HP]") as "[HP HQ]".
  { iPureIntro.
    rewrite /inode.size.
    autorewrite with len in Haddrs_sz.
    rewrite -Haddrs_sz //. }

  iMod (fupd_later_to_disc with "HP") as "HP".
  iModIntro.
  iEval (rewrite ->!(left_id True bi_wand)%I) in "HQ".
  iCache with "HQ Hdurable HP".
  { iLeft in "HQ". eauto 10 with iFrame. }
  iApply wpc_fupd.
  wpc_frame.
  wp_loadField.
  wp_apply wp_slice_len.
  iNamed 1.
  iSplitR "HP addrs Haddrs Hdurable"; last first.
  { iMod (own_disc_fupd_elim with "HP") as "HP". eauto 10 with iFrame.  }
  iIntros "!> His_locked".
  iSplit; first by iLeft in "HQ".
  iCache with "HQ"; first by iLeft in "HQ".
  wpc_pures.
  wpc_frame.
  wp_loadField.
  wp_apply (crash_lock.release_spec with "His_locked"); auto.
  wp_pures.
  iModIntro. iNamed 1.
  iRight in "HQ". by iApply "HQ".
Qed.

Theorem wpc_Inode__Size_triple {k} {l k' P addr} (Q: u64 -> iProp Σ) (Qc: iProp Σ) `{AbsLaterable _ Qc} :
  (S k < k')%nat →
  {{{ "Hinode" ∷ is_inode l (S k') P addr ∗
      "HQc" ∷ (∀ a, Q a -∗ <disc> Qc) ∗
      "Hfupd" ∷ (<disc> Qc ∧ (∀ σ σ' sz,
          ⌜σ' = σ ∧ int.nat sz = inode.size σ⌝ ∗
          ▷ P σ ={⊤}=∗ ▷ P σ' ∗ Q sz))
  }}}
    Inode__Size #l @ (S k); ⊤
  {{{ sz, RET #sz; Q sz }}}
  {{{ Qc }}}.
Proof.
  iIntros (? Φ Φc) "Hpre HΦ"; iNamed "Hpre".
  iApply (wpc_step_strong_mono _ _ _ _ _ _ _
         (λ v, ∃ (sz : u64), ⌜ v = #sz ⌝ ∗ Q sz)%I _ Qc with "[-HΦ] [HΦ]"); auto.
  2: { iSplit.
       * iNext. iIntros (?) "H". iDestruct "H" as (?) "(%&?)". subst.
         iModIntro. iRight in "HΦ". by iApply "HΦ".
       * iLeft in "HΦ".  iModIntro. iIntros. iModIntro. by iApply "HΦ". }
  iApply (wpc_Inode__Size with "[//] Hinode"); first done.
  iSplit.
  { iLeft in "Hfupd". iIntros "!> _". eauto. }
  iNext. iIntros (σ mb) "[%Hσ HP]". iMod ("Hfupd" with "[$HP //]") as "[HP HQ]".
  iModIntro. iFrame "HP". iSplit.
  { iSpecialize ("HQc" with "[$]"). iIntros "!> _". eauto. }
  iIntros "_". eauto.
Qed.

Theorem wp_Inode__mkHdr {stk} l addr_s addrs :
  length addrs ≤ InodeMaxBlocks ->
  {{{ "addrs" ∷ l ↦[Inode :: "addrs"] (slice_val addr_s) ∗
      "Haddrs" ∷ is_slice addr_s uint64T 1 addrs
  }}}
    Inode__mkHdr #l @ stk
  {{{ s b, RET (slice_val s);
      is_block s 1 b ∗
      ⌜block_encodes b ([EncUInt64 (U64 $ length addrs)] ++ (EncUInt64 <$> addrs))⌝ ∗
      "addrs" ∷ l ↦[Inode :: "addrs"] (slice_val addr_s) ∗
      "Haddrs" ∷ is_slice addr_s uint64T 1 addrs
  }}}.
Proof.
  iIntros (Hbound Φ) "Hpre HΦ"; iNamed "Hpre".
  wp_call.
  wp_apply wp_new_enc; iIntros (enc) "Henc".
  wp_pures.
  wp_loadField.
  iDestruct (is_slice_sz with "Haddrs") as %Hlen.
  wp_apply wp_slice_len.
  wp_apply (wp_Enc__PutInt with "Henc").
  { word. }
  iIntros "Henc".
  wp_loadField.
  iDestruct (is_slice_split with "Haddrs") as "[Haddrs Hcap]".
  wp_apply (wp_Enc__PutInts with "[$Henc $Haddrs]").
  { word. }
  iIntros "[Henc Haddrs]".
  iDestruct (is_slice_split with "[$Haddrs $Hcap]") as "Haddrs".
  wp_apply (wp_Enc__Finish with "Henc").
  iIntros (??) "(%Henc&Hs)".
  wp_pures.
  iApply "HΦ".
  iFrame.
  iPureIntro.
  eapply block_encodes_eq; eauto.
  rewrite app_nil_l.
  repeat (f_equal; try word).
Qed.

Theorem wlog_assume_l {PROP:bi} (φ: Prop) (P: PROP) :
  φ →
  (⌜φ⌝ -∗ P) -∗
  ⌜φ⌝ ∗ P.
Proof.
  iIntros (H) "Himpl".
  iSplitR;
Intermediate Coq File (useful for debugging if minimization did not go as far as you wanted) (truncated to 8.0KiB; full 46KiB file on GitHub Actions Artifacts under cwd/tmp.v)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-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/theories" "stdpp" "-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_staging" "iris.staging" "-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" "inode_proof") -*- *)
(* File reduced by coq-bug-finder from original input, then from 0 lines to 1315 lines *)
(* coqc version 8.14+alpha compiled with OCaml 4.12.0
   coqtop version 8.14+alpha *)
Declare ML Module "ltac_plugin".
Module Export AdmitTactic.
Module Import LocalFalse.
Inductive False := .
End LocalFalse.
Axiom proof_admitted : False.
Tactic Notation "admit" := abstract case proof_admitted.
End AdmitTactic.
Require RecordUpdate.RecordSet.
Require Coq.ssr.ssreflect.
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.Sorting.Permutation.
Require Coq.Program.Basics.
Require Coq.Program.Syntax.
Require stdpp.options.
Require stdpp.base.
Require Coq.micromega.Lia.
Require stdpp.proof_irrel.
Require stdpp.decidable.
Require stdpp.tactics.
Require stdpp.orders.
Require stdpp.option.
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.numbers.
Require stdpp.list.
Require stdpp.list_numbers.
Require stdpp.fin.
Require stdpp.countable.
Require stdpp.vector.
Require Coq.Arith.Wf_nat.
Require stdpp.finite.
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.bi.notation.
Require iris.bi.interface.
Require iris.bi.derived_connectives.
Require iris.bi.derived_laws.
Require iris.bi.derived_laws_later.
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.list.
Require iris.algebra.cmra.
Require iris.algebra.updates.
Require iris.algebra.local_updates.
Require iris.algebra.proofmode_classes.
Require iris.algebra.gmap.
Require iris.bi.big_op.
Require stdpp.coPset.
Require iris.bi.internal_eq.
Require iris.bi.plainly.
Require iris.bi.updates.
Require iris.bi.embedding.
Require iris.bi.bi.
Require stdpp.telescopes.
Require iris.bi.telescopes.
Require iris.proofmode.base.
Require iris.proofmode.environments.
Require iris.proofmode.reduction.
Require iris.bi.monpred.
Require stdpp.namespaces.
Require stdpp.hlist.
Require iris.proofmode.tokens.
Require iris.proofmode.sel_patterns.
Require iris.proofmode.intro_patterns.
Require iris.proofmode.spec_patterns.
Require iris.proofmode.ident_name.
Require iris.proofmode.modalities.
Require iris.proofmode.classes.
Require iris.proofmode.modality_instances.
Require iris.proofmode.coq_tactics.
Require Ltac2.Init.
Require Ltac2.Int.
Require Ltac2.Message.
Require Ltac2.Control.
Require Ltac2.Bool.
Require Ltac2.Array.
Require Ltac2.Char.
Require Ltac2.Constr.
Require Ltac2.Std.
Require Ltac2.Env.
Require Ltac2.List.
Require Ltac2.Fresh.
Require Ltac2.Ident.
Require Ltac2.Ind.
Require Ltac2.Ltac1.
Require Ltac2.Option.
Require Ltac2.Pattern.
Require Ltac2.Printf.
Require Ltac2.String.
Require Ltac2.Notations.
Require Ltac2.Ltac2.
Require Coq.Init.Byte.
Require iris.proofmode.string_ident.
Require iris.proofmode.notation.
Require iris.proofmode.ltac_tactics.
Require stdpp.nat_cancel.
Require iris.proofmode.class_instances.
Require iris.proofmode.class_instances_later.
Require iris.proofmode.class_instances_updates.
Require iris.proofmode.class_instances_embedding.
Require iris.proofmode.class_instances_plainly.
Require iris.proofmode.class_instances_internal_eq.
Require iris.proofmode.frame_instances.
Require iris.proofmode.tactics.
Require iris.proofmode.monpred.
Require Perennial.Helpers.ipm.
Require iris_named_props.named_props.
Require Perennial.Helpers.NamedProps.
Require iris.algebra.frac.
Require iris.algebra.dfrac.
Require iris.algebra.agree.
Require iris.algebra.view.
Require iris.algebra.auth.
Require iris.algebra.excl.
Require iris.bi.lib.fractional.
Require iris.algebra.gset.
Require iris.algebra.coPset.
Require iris.algebra.functions.
Require iris.algebra.cofe_solver.
Require iris.base_logic.upred.
Require iris.base_logic.bi.
Require iris.base_logic.derived.
Require iris.base_logic.proofmode.
Require iris.algebra.csum.
Require iris.algebra.lib.excl_auth.
Require iris.algebra.lib.gmap_view.
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 iris.algebra.vector.
Require Perennial.base_logic.lib.iprop.
Require Perennial.algebra.auth_frac.
Require Perennial.algebra.mlist.
Require Perennial.base_logic.lib.wsat.
Require Perennial.base_logic.lib.fancy_updates.
Require Perennial.base_logic.lib.crash_token.
Require Perennial.base_logic.lib.ncfupd.
Require Perennial.program_logic.language.
Require Perennial.program_logic.weakestpre_notation.
Require Perennial.base_logic.lib.fupd_level.
Require Perennial.base_logic.lib.ae_invariants.
Require Perennial.base_logic.lib.invariants.
Require Perennial.program_logic.step_fupd_extra.
Require Perennial.program_logic.ae_invariants_mutable.
Require Perennial.base_logic.base_logic.
Require Perennial.algebra.laterN.
Require Perennial.algebra.atleast.
Require Perennial.algebra.big_op.big_sepL.
Require Perennial.algebra.own_discrete.
Require Perennial.program_logic.ectx_language.
Require Perennial.program_logic.crash_weakestpre.
Require Perennial.program_logic.weakestpre.
Require Perennial.program_logic.lifting.
Require Perennial.program_logic.ectx_lifting.
Require Perennial.Helpers.Transitions.
Require Coq.Arith.Min.
Require iris.algebra.reservation_map.
Require iris.algebra.cmra_big_op.
Require iris.algebra.numbers.
Require Perennial.algebra.blocks.
Require Perennial.algebra.na_heap.
Require Coq.Program.Equality.
Require stdpp.binders.
Require Perennial.program_logic.ectxi_language.
Require Perennial.Helpers.CountableTactics.
Require Perennial.program_logic.crash_lang.
Require Perennial.goose_lang.locations.
Require coqutil.Datatypes.PrimitivePair.
Require coqutil.Datatypes.HList.
Require coqutil.Z.Lia.
Require Coq.btauto.Btauto.
Require coqutil.Z.bitblast.
Require Coq.ZArith.BinInt.
Require coqutil.Z.div_mod_to_equations.
Require coqutil.Z.BitOps.
Require Coq.ZArith.BinIntDef.
Require coqutil.sanity.
Require coqutil.Word.Interface.
Require Coq.ZArith.Zpow_facts.
Require coqutil.Z.PushPullMod.
Require Coq.setoid_ring.Ring_theory.
Require coqutil.Tactics.autoforward.
Require Coq.Ar
Build Log (truncated to last 8.0KiB; full 3.8MiB file on GitHub Actions Artifacts under build.log)
ace/builds/coq/coq-passing/_build_ci/perennial'
make[1]: Leaving directory '/github/workspace/builds/coq/coq-passing/_build_ci/perennial'
Aggregating timing log...
No timing data
/github/workspace/builds/coq /github/workspace
::endgroup::
::group::make ci-perennial (failing)
/github/workspace/builds/coq/coq-failing /github/workspace/builds/coq /github/workspace
./dev/ci/ci-wrapper.sh perennial
++ : 2
++ export NJOBS
++ 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.12.0+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.12.0+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.12.0+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.12.0+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 681100
-rwxr-xr-x 1 root root     1400 May 26 22:39 coq-tex
-rwxr-xr-x 1 root root  2576112 May 26 15:28 coq-tex.orig
-rwxr-xr-x 1 root root  5221160 May 26 15:28 coq_makefile
-rwxr-xr-x 1 root root     1397 May 26 22:39 coqc
-rwxr-xr-x 1 root root     1402 May 26 22:39 coqc.byte
-rwxr-xr-x 1 root root 38453475 May 26 15:28 coqc.byte.orig
-rwxr-xr-x 1 root root 63196288 May 26 15:28 coqc.orig
-rwxr-xr-x 1 root root 22116032 May 26 15:28 coqchk
-rwxr-xr-x 1 root root  8771832 May 26 15:28 coqdep
-rwxr-xr-x 1 root root     1399 May 26 22:39 coqdoc
-rwxr-xr-x 1 root root  8406192 May 26 15:28 coqdoc.orig
-rwxr-xr-x 1 root root     1399 May 26 22:39 coqide
-rwxr-xr-x 1 root root 20803128 May 26 15:28 coqide.orig
-rwxr-xr-x 1 root root     1407 May 26 22:39 coqidetop.byte
-rwxr-xr-x 1 root root 38976848 May 26 15:28 coqidetop.byte.orig
-rwxr-xr-x 1 root root     1406 May 26 22:39 coqidetop.opt
-rwxr-xr-x 1 root root 63828048 May 26 15:28 coqidetop.opt.orig
-rwxr-xr-x 1 root root     1402 May 26 22:39 coqnative
-rwxr-xr-x 1 root root 22306888 May 26 15:28 coqnative.orig
-rwxr-xr-x 1 root root     1398 May 26 22:39 coqpp
-rwxr-xr-x 1 root root  3225128 May 26 15:28 coqpp.orig
-rwxr-xr-x 1 root root     1411 May 26 22:39 coqproofworker.opt
-rwxr-xr-x 1 root root 63283320 May 26 15:28 coqproofworker.opt.orig
-rwxr-xr-x 1 root root     1411 May 26 22:39 coqqueryworker.opt
-rwxr-xr-x 1 root root 63259112 May 26 15:28 coqqueryworker.opt.orig
-rwxr-xr-x 1 root root     1412 May 26 22:39 coqtacticworker.opt
-rwxr-xr-x 1 root root 63259576 May 26 15:28 coqtacticworker.opt.orig
-rwxr-xr-x 1 root root     1399 May 26 22:39 coqtop
-rwxr-xr-x 1 root root     1404 May 26 22:39 coqtop.byte
-rwxr-xr-x 1 root root 55317468 May 26 15:28 coqtop.byte.orig
-rwxr-xr-x 1 root root     1403 May 26 22:39 coqtop.opt
-rwxr-xr-x 1 root root 63219504 May 26 15:28 coqtop.opt.orig
-rwxr-xr-x 1 root root 63219504 May 26 15:28 coqtop.orig
-rwxr-xr-x 1 root root     1398 May 26 22:39 coqwc
-rwxr-xr-x 1 root root  2139648 May 26 15:28 coqwc.orig
-rwxr-xr-x 1 root root     1403 May 26 22:39 coqworkmgr
-rwxr-xr-x 1 root root  3595368 May 26 15:28 coqworkmgr.orig
-rwxr-xr-x 1 root root     1401 May 26 22:39 csdpcert
-rwxr-xr-x 1 root root  5866656 May 26 15:28 csdpcert.orig
-rwxr-xr-x 1 root root     1401 May 26 22:39 fake_ide
-rwxr-xr-x 1 root root  9038976 May 26 15:28 fake_ide.orig
-rwxr-xr-x 1 root root     1404 May 26 22:39 ocamllibdep
-rwxr-xr-x 1 root root  3249048 May 26 15:28 ocamllibdep.orig
-rwxr-xr-x 1 root root     1399 May 26 22:39 votour
-rwxr-xr-x 1 root root  3973136 May 26 15:28 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 26 15:35 perennial
++ declare -A overlays
++ set +x
+ FORCE_GIT=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.
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ export 'COQEXTRAFLAGS=-native-compiler no'
+ COQEXTRAFLAGS='-native-compiler no'
+ cd /github/workspace/builds/coq/coq-failing/_build_ci/perennial
+ git submodule update --init --recursive
+ 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/program_proof/examples/inode_proof.v
MINIMIZER_DEBUG: /github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc: COQPATH=
MINIMIZER_DEBUG: 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 -deprecated-hint-rewrite-without-locality -w +deprecated-tactic-notation -w -notation-overridden\,-redundant-canonical-projection -Q /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/stdpp/theories stdpp -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_staging iris.staging -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 -noglob -o /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.vo /github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.v 
File "/github/workspace/builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.v", line 510, characters 66-82:
Error: Expected a single focused goal but 0 goals are focused.

Makefile:48: recipe for target 'src/program_proof/examples/inode_proof.vo' failed
make[1]: *** [src/program_proof/examples/inode_proof.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
Makefile.ci:109: 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 343KiB file on GitHub Actions Artifacts under bug.log)
ild_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 -top -arg inode_proof ../builds/coq/coq-failing/_build_ci/perennial/external/Goose/github_com/tchajed/marshal.v ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/slice/typed_slice.v ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/disk_lib.v ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/disk_prelude.v ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/marshal_proof.v
make -k -f Makefile3q5fnszb.coq ../builds/coq/coq-failing/_build_ci/perennial/external/Goose/github_com/tchajed/marshal.glob ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/disk_prelude.glob ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/disk_lib.glob ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/marshal_proof.glob ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/slice/typed_slice.glob
/github/workspace/builds/coq/coq-failing/_install_ci/bin/coq_makefile COQC = /github/workspace/builds/coq/coq-passing/_install_ci/bin/coqc.orig -o Makefile9j5vwe_b.coq -Q /github/workspace/cwd Top -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/src Perennial -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/stdpp/theories stdpp -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris iris -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_deprecated iris.deprecated -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_staging iris.staging -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 -Q /github/workspace/cwd Top -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/src Perennial -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/stdpp/theories stdpp -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris iris -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_deprecated iris.deprecated -Q /github/workspace/builds/coq/coq-passing/_build_ci/perennial/external/iris/iris_staging iris.staging -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 -top -arg inode_proof ../builds/coq/coq-failing/_build_ci/perennial/external/Goose/github_com/tchajed/marshal.v ../builds/coq/coq-failing/_build_ci/perennial/src/Helpers/List.v ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/encoding/encoding.v ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/slice/typed_slice.v ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/proof_prelude.v
make -k -f Makefile9j5vwe_b.coq ../builds/coq/coq-failing/_build_ci/perennial/src/Helpers/List.glob ../builds/coq/coq-failing/_build_ci/perennial/external/Goose/github_com/tchajed/marshal.glob ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/encoding/encoding.glob ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/proof_prelude.glob ../builds/coq/coq-failing/_build_ci/perennial/src/goose_lang/lib/slice/typed_slice.glob
getting ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.v
getting ../builds/coq/coq-failing/_build_ci/perennial/src/program_proof/examples/inode_proof.glob

Now, I will attempt to find the error message...

I think the error is 'Error: Expected a single focused goal but 0 goals are focused.

Makefile:48: recipe for target 'src/program_proof/examples/inode_proof.vo' failed
make[1]: *** [src/program_proof/examples/inode_proof.vo] Error 1
make[1]: Leaving directory '/github/workspace/builds/coq/coq-failing/_build_ci/perennial'
Makefile.ci:109: recipe for target 'ci-perennial' failed
make: *** [ci-perennial] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
'.
The corresponding regular expression is 'File "[^"]+", line ([0-9]+), characters [0-9-]+:\n(Error:\s+Expected\s+a\s+single\s+focused\s+goal\s+but\s+[\d]+\s+goals\s+are\s+focused\.\s\sMakefile:[\d]+:\s+recipe\s+for\s+target\s+\'src\/program_proof\/examples\/inode_proof\.vo\'\s+failed\smake\[[\d]+\]:\s+\*\*\*\s+\[src\/program_proof\/examples\/inode_proof\.vo\]\s+Error\s+[\d]+\smake\[[\d]+\]:\s+Leaving\s+directory\s+\'\/github\/workspace\/builds\/coq\/coq\-failing\/_build_ci\/perennial\'\sMakefile\.ci:[\d]+:\s+recipe\s+for\s+target\s+\'ci\-perennial\'\s+failed\smake:\s+\*\*\*\s+\[ci\-perennial\]\s+Error\s+[\d]+\s\/github\/workspace\/builds\/coq\s+\/github\/workspace\s::endgroup::)'.

Running command: "/github/workspace/builds/coq/coq-failing/_install_ci/bin/coqc.orig" "-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/theories" "stdpp" "-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_staging" "iris.staging" "-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" "inode_proof" "/tmp/tmpuys7jlbh.v" "-q"

Non-fatal error: Failed to validate all coq runs and preserve the error.  
Writing file to /github/workspace/cwd/tmp.v.
The new error was:
File "/tmp/tmpuys7jlbh.v", line 9, characters 0-31:
Error:
The file /github/workspace/builds/coq/coq-failing/_build_ci/perennial/external/record-update/src/RecordSet.vo contains library
RecordSet and not library RecordUpdate.RecordSet

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.

@mattam82
Copy link
Member Author

@robbertkrebbers the perenial error seems to be related to iris succeding more with this patch. On goal:

Σ: gFunctors
heapG0: heapG Σ
stagedG0: stagedG Σ
allocG0: allocG Σ
inodeN, allocN: namespace
k: nat
l: loc
k': nat
P: inode.t → iProp Σ
addr, off: u64
Q: option Block → iPropI Σ
H: (S k < k')%nat
Φ: val → iPropI Σ
Φc: iPropI Σ
σ: inode.t
mb: option Block
Hσ: mb = σ.(inode.blocks) !! int.nat off
s: Slice.t
1/1
"HQ" : Q mb
"Hblock" : match mb with
           | Some b => is_block s 1 b
           | None => ⌜s = Slice.nil⌝
           end
--------------------------------------∗
match ?Goal with
| Some b => is_block s 1 b
| None => ⌜s = Slice.nil⌝
end ∗ Q ?Goal

iFrame suffices to solve the goal now, whereas before it would leave:

...
"Hblock" : match mb with
           | Some b => is_block s 1 b
           | None => ⌜s = Slice.nil⌝
           end
--------------------------------------∗
match mb with
| Some b => is_block s 1 b
| None => ⌜s = Slice.nil⌝
end

and require an explicit `iApply "Hblock"

@robbertkrebbers
Copy link
Contributor

robbertkrebbers commented May 27, 2021

I think it makes sense that the iFrame works now, so I'm in favor of the new behavior because it's more consistent.

If @tchajed and @RalfJung agree, I think they can provide a fix for perenial that's forward compatible with this PR.

@mattam82
Copy link
Member Author

Yep, it's easy to fix perennial in a compatible way.

@RalfJung
Copy link
Contributor

I don't have a strong opinion on whether this works or not, and I find it hard to judge the larger consequences of this change. Seems fine for me otherwise.

@mattam82 mattam82 requested a review from a team as a code owner May 27, 2021 10:28
@mattam82
Copy link
Member Author

This generally allows to perform dependent resolution with instances of the shape forall a : SomeClass, SomeOtherClass (proj a), while having mode ! for SomeOtherClass. I think that's a net improvement for these situations.

@mattam82
Copy link
Member Author

I've started the bench to check this doesn't negatively impact performance.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 27, 2021

Hey, I have detected that there were CI failures at commit 3c8378b without any failure in the test-suite.
I checked that the corresponding jobs for the base commit ac9a310 succeeded. You can ask me to try to extract a minimal test case from this so that it can be added to the test-suite.
If you tag me saying @coqbot ci minimize, I will minimize the following target: ci-perennial.

@mattam82 mattam82 force-pushed the nohead-evar-application-head branch from 3c8378b to 3cd0858 Compare May 27, 2021 14:19
@tchajed
Copy link
Contributor

tchajed commented May 27, 2021

Perennial should now work, the fixes are now on the coq/tested branch.

@mattam82
Copy link
Member Author

Yep, this one should be all green, I removed the overlay

@tchajed
Copy link
Contributor

tchajed commented May 27, 2021

I only pushed the fixes from master to coq/tested a couple minutes ago, so the current ci-perennial job will fail, but if you restart it now it should succeed.

Copy link
Member

@jfehrle jfehrle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor wording tweaks

doc/sphinx/proofs/automatic-tactics/auto.rst Outdated Show resolved Hide resolved
doc/sphinx/proofs/automatic-tactics/auto.rst Outdated Show resolved Hide resolved
@mattam82
Copy link
Member Author

Good @coq/tactics-maintainers , please review now.

@mattam82
Copy link
Member Author

@ppedrot this is a prerequisite for #9711

@mattam82 mattam82 force-pushed the nohead-evar-application-head branch from 5b92e54 to 1a195b8 Compare May 28, 2021 08:45
@mattam82
Copy link
Member Author

I rebased, but did not change anything

Update doc/sphinx/proofs/automatic-tactics/auto.rst

Co-authored-by: Jim Fehrle <jim.fehrle@gmail.com>

Update doc/changelog/02-specification-language/14392-nohead-evar-application-hea.rst

Co-authored-by: Jim Fehrle <jim.fehrle@gmail.com>

Update doc/sphinx/proofs/automatic-tactics/auto.rst

Co-authored-by: Jim Fehrle <jim.fehrle@gmail.com>
@mattam82 mattam82 force-pushed the nohead-evar-application-head branch from 1a195b8 to a30289e Compare May 28, 2021 08:51
@ppedrot ppedrot self-assigned this May 28, 2021
Copy link
Member

@ppedrot ppedrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes are uncontroversial, but at a high level this kind of design refinement is yet another instance of the headless duck strategy...

@robbertkrebbers
Copy link
Contributor

To be honest: I think this MR makes the behavior more uniform, hence less of a headless duck.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 28, 2021

Hey, I have detected that there were CI failures at commit a30289e without any failure in the test-suite.
I checked that the corresponding jobs for the base commit 92f3b90 succeeded. You can ask me to try to extract a minimal test case from this so that it can be added to the test-suite.
If you tag me saying @coqbot ci minimize, I will minimize the following target: ci-coq_tools.

@ppedrot
Copy link
Member

ppedrot commented May 28, 2021

@mattam82 did you run a bench? I can't find it in the (notoriously cumbersome) gitlab UI. Also, if you want this to go into 8.14 it needs to be merged asap.

@coqbot-app
Copy link
Contributor

coqbot-app bot commented May 28, 2021

Hey, I have detected that there were CI failures at commit a30289e without any failure in the test-suite.
I checked that the corresponding jobs for the base commit 92f3b90 succeeded. You can ask me to try to extract a minimal test case from this so that it can be added to the test-suite.
If you tag me saying @coqbot ci minimize, I will minimize the following target: ci-coq_tools.

@mattam82
Copy link
Member Author

I triggered a bench, it's easy: just go to the bench job on the gitlab ci pipeline details link and "trigger manual action"

@mattam82
Copy link
Member Author

Also, historical note: @ppedrot you were the one who added the Proj (p, c) -> head_evar c case about 4 years ago out of zeal I think :)

@SkySkimmer SkySkimmer changed the title Do not consider scutinees of projections and cases as heads for hint mode "!" Do not consider scrutinees of projections and cases as heads for hint mode "!" May 28, 2021
@SkySkimmer
Copy link
Contributor

https://gitlab.com/coq/coq/-/jobs/1301186577

┌─────────────────────────────┬─────────────────────────┬───────────────────────────────────────┬───────────────────────────────────────┬─────────────────────────┬─────────────────┐
│                             │      user time [s]      │              CPU cycles               │           CPU instructions            │  max resident mem [KB]  │   mem faults    │
│                             │                         │                                       │                                       │                         │                 │
│                package_name │     NEW      OLD  PDIFF │            NEW             OLD  PDIFF │            NEW             OLD  PDIFF │     NEW      OLD  PDIFF │ NEW  OLD  PDIFF │
├─────────────────────────────┼─────────────────────────┼───────────────────────────────────────┼───────────────────────────────────────┼─────────────────────────┼─────────────────┤
│                         coq │    4.52     4.55  -0.66 │    12571747546     12632825682  -0.48 │    23620671860     23626734175  -0.03 │  284544   277224   2.64 │   0    0    nan │
│                    coq-corn │ 1583.61  1593.15  -0.60 │  4392132371746   4418937978885  -0.61 │  6021740653945   6022039254895  -0.00 │  818636   818460   0.02 │   0    0    nan │
│            coq-math-classes │  188.97   189.96  -0.52 │   520615584052    523632129069  -0.58 │   654332491741    654306184348   0.00 │  481032   481096  -0.01 │   0    0    nan │
│                coq-coqprime │ 1480.40  1487.67  -0.49 │  4121852981759   4134838602576  -0.31 │  6591701505524   6590488924009   0.02 │ 1036796  1036860  -0.01 │   0    0    nan │
│               coq-perennial │ 7301.95  7332.77  -0.42 │ 20338383860611  20425354727227  -0.43 │ 29159423190500  29190346968974  -0.11 │ 3074416  3119492  -1.44 │   0    0    nan │
│             coq-lambda-rust │ 1366.64  1372.39  -0.42 │  3805408382818   3813721820217  -0.22 │  5132641844250   5127133058975   0.11 │ 1099556  1095208   0.40 │   0    0    nan │
│            coq-fiat-parsers │  646.56   649.19  -0.41 │  1798854529929   1805311651772  -0.36 │  2559166202521   2558235852965   0.04 │ 3193580  3193420   0.01 │   0    0    nan │
│               coq-fourcolor │ 2711.75  2720.82  -0.33 │  7552424478460   7577507680145  -0.33 │ 12249176373824  12247285471316   0.02 │  732968   733068  -0.01 │   0    0    nan │
│                 coq-coqutil │   63.23    63.44  -0.33 │   173129760759    174316685387  -0.68 │   214909491981    214505387522   0.19 │  598544   598472   0.01 │   0    0    nan │
│                 coq-unimath │ 4182.92  4196.55  -0.32 │ 11624323336271  11662164352785  -0.32 │ 21256458832351  21252849918562   0.02 │ 1123668  1123680  -0.00 │   0    0    nan │
│                 coq-bignums │   59.76    59.94  -0.30 │   165385663771    165737945674  -0.21 │   210350659987    210320318569   0.01 │  462376   462316   0.01 │   0    0    nan │
│ coq-rewriter-perf-SuperFast │  812.74   814.82  -0.26 │  2267052786734   2272733642355  -0.25 │  3341921916375   3341732259945   0.01 │ 1089800  1089820  -0.00 │   0    0    nan │
│             coq-fiat-crypto │ 5155.62  5167.89  -0.24 │ 14357668107170  14376843203819  -0.13 │ 24007715548121  24002575981082   0.02 │ 2220800  2221964  -0.05 │   0    0    nan │
│                coq-rewriter │  740.82   742.39  -0.21 │  2060439100693   2064985284068  -0.22 │  2977293808616   2974609106337   0.09 │ 1089928  1089840   0.01 │   0    0    nan │
│      coq-mathcomp-odd-order │ 1142.66  1144.90  -0.20 │  3178700909381   3182460492155  -0.12 │  4709580545535   4709346324801   0.00 │  941324   941168   0.02 │   0    0    nan │
│              coq-verdi-raft │ 1245.70  1248.06  -0.19 │  3465509455463   3473380710994  -0.23 │  4617609188386   4617344967087   0.01 │  903632   903748  -0.01 │   0    0    nan │
│                coq-bedrock2 │  330.12   330.61  -0.15 │   915838918410    917269207342  -0.16 │  1519099984789   1518671646099   0.03 │  799884   799872   0.00 │   0    0    nan │
│               coq-fiat-core │  117.40   117.56  -0.14 │   330223805126    330069258689   0.05 │   411833101371    410684757319   0.28 │  480732   480680   0.01 │   0    0    nan │
│       coq-mathcomp-fingroup │   52.46    52.52  -0.11 │   145705553980    145571982155   0.09 │   189279691217    189261411441   0.01 │  482480   482608  -0.03 │   0    0    nan │
│                   coq-color │  531.24   531.83  -0.11 │  1471577451218   1473789372839  -0.15 │  1729190346450   1728307485899   0.05 │ 1132828  1133352  -0.05 │   0    0    nan │
│                    coq-core │  110.78   110.78   0.00 │   309982563298    310052448123  -0.02 │   456964494434    457092449787  -0.03 │  277276   277248   0.01 │   0    0    nan │
│                   coq-verdi │  106.72   106.69   0.03 │   294315355217    294403268358  -0.03 │   387828473275    387115581996   0.18 │  542504   542524  -0.00 │   0    0    nan │
│                    coq-hott │  367.00   366.81   0.05 │   997546304919    995715877461   0.18 │  1406080530640   1406078884367   0.00 │  582332   582228   0.02 │   0    0    nan │
│      coq-mathcomp-character │  164.46   164.27   0.12 │   457497836039    456777870315   0.16 │   597015393662    596873316183   0.02 │  718652   733088  -1.97 │   0    0    nan │
│       coq-mathcomp-solvable │  186.25   186.03   0.12 │   516932617417    517035377624  -0.02 │   681542358319    681566304212  -0.00 │  695684   681184   2.13 │   0    0    nan │
│          coq-mathcomp-field │  240.79   240.43   0.15 │   669764754137    669096456678   0.10 │   953907021381    953932850579  -0.00 │  662052   662024   0.00 │   0    0    nan │
│        coq-mathcomp-algebra │  151.43   151.20   0.15 │   421029812237    420100551265   0.22 │   508148289547    508159756271  -0.00 │  553160   553076   0.02 │   0    0    nan │
│      coq-mathcomp-ssreflect │   58.39    58.28   0.19 │   161242320922    160796541185   0.28 │   190363658522    190367922239  -0.00 │  524068   524008   0.01 │   0    0    nan │
│       coq-engine-bench-lite │  338.42   337.77   0.19 │   951340425818    948158141694   0.34 │  1659283500116   1660020097507  -0.04 │ 3506792  3506740   0.00 │   0    0    nan │
│                  coq-stdlib │  429.81   428.85   0.22 │  1204559137548   1203156287276   0.12 │  1491430683037   1491571664247  -0.01 │  568604   568520   0.01 │   0    0    nan │
│                  coq-geocoq │ 1466.22  1461.59   0.32 │  4073332387684   4065709783264   0.19 │  5638563747247   5638196025104   0.01 │  989536   978924   1.08 │   0    0    nan │
│  coq-performance-tests-lite │ 1693.25  1687.41   0.35 │  4727300851558   4710406394366   0.36 │  7454379956278   7450063781096   0.06 │ 1851556  1851688  -0.01 │   0    0    nan │
│              coq-coquelicot │   75.12    74.62   0.67 │   207065053237    206410205168   0.32 │   242010679280    241350637100   0.27 │  560864   560948  -0.01 │   0    0    nan │
└─────────────────────────────┴─────────────────────────┴───────────────────────────────────────┴───────────────────────────────────────┴─────────────────────────┴─────────────────┘

@ppedrot
Copy link
Member

ppedrot commented May 29, 2021

If nobody complains I will merge this tonight so as to fit into the release schedule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancement to an existing user-facing feature, tactic, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants