summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <gareuselesinge@debian.org>2016-12-27 16:53:30 +0100
committerGravatar Enrico Tassi <gareuselesinge@debian.org>2016-12-27 16:53:30 +0100
commita4c7f8bd98be2a200489325ff7c5061cf80ab4f3 (patch)
tree26dd9c4aa142597ee09c887ef161d5f0fa5077b6 /test-suite
parent164c6861860e6b52818c031f901ffeff91fca16a (diff)
Imported Upstream version 8.6upstream/8.6
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/.csdp.cachebin0 -> 89077 bytes
-rw-r--r--test-suite/Makefile109
-rw-r--r--test-suite/bugs/4623.v5
-rw-r--r--test-suite/bugs/4624.v7
-rw-r--r--test-suite/bugs/closed/1784.v5
-rw-r--r--test-suite/bugs/closed/1850.v4
-rw-r--r--test-suite/bugs/closed/2016.v6
-rw-r--r--test-suite/bugs/closed/2021.v2
-rw-r--r--test-suite/bugs/closed/2310.v6
-rw-r--r--test-suite/bugs/closed/2800.v (renamed from test-suite/bugs/opened/2800.v)2
-rw-r--r--test-suite/bugs/closed/2839.v2
-rw-r--r--test-suite/bugs/closed/2848.v7
-rw-r--r--test-suite/bugs/closed/3045.v2
-rw-r--r--test-suite/bugs/closed/3068.v2
-rw-r--r--test-suite/bugs/closed/3070.v6
-rw-r--r--test-suite/bugs/closed/3080.v18
-rw-r--r--test-suite/bugs/closed/3209.v75
-rw-r--r--test-suite/bugs/closed/3251.v1
-rw-r--r--test-suite/bugs/closed/3383.v6
-rw-r--r--test-suite/bugs/closed/3424.v1
-rw-r--r--test-suite/bugs/closed/3441.v23
-rw-r--r--test-suite/bugs/closed/3495.v18
-rw-r--r--test-suite/bugs/closed/3513.v32
-rw-r--r--test-suite/bugs/closed/3563.v6
-rw-r--r--test-suite/bugs/closed/3612.v5
-rw-r--r--test-suite/bugs/closed/3647.v3
-rw-r--r--test-suite/bugs/closed/3649.v5
-rw-r--r--test-suite/bugs/closed/3690.v4
-rw-r--r--test-suite/bugs/closed/3699.v16
-rw-r--r--test-suite/bugs/closed/3753.v (renamed from test-suite/bugs/opened/3753.v)2
-rw-r--r--test-suite/bugs/closed/3825.v24
-rw-r--r--test-suite/bugs/closed/3849.v (renamed from test-suite/bugs/opened/3849.v)2
-rw-r--r--test-suite/bugs/closed/3881.v2
-rw-r--r--test-suite/bugs/closed/3886.v23
-rw-r--r--test-suite/bugs/closed/3911.v26
-rw-r--r--test-suite/bugs/closed/3920.v7
-rw-r--r--test-suite/bugs/closed/3922.v2
-rw-r--r--test-suite/bugs/closed/3929.v67
-rw-r--r--test-suite/bugs/closed/3957.v6
-rw-r--r--test-suite/bugs/closed/4069.v53
-rw-r--r--test-suite/bugs/closed/4095.v87
-rw-r--r--test-suite/bugs/closed/4187.v709
-rw-r--r--test-suite/bugs/closed/4198.v2
-rw-r--r--test-suite/bugs/closed/4214.v (renamed from test-suite/bugs/opened/4214.v)3
-rw-r--r--test-suite/bugs/closed/4292.v7
-rw-r--r--test-suite/bugs/closed/4375.v9
-rw-r--r--test-suite/bugs/closed/4378.v9
-rw-r--r--test-suite/bugs/closed/4416.v4
-rw-r--r--test-suite/bugs/closed/4450.v58
-rw-r--r--test-suite/bugs/closed/4464.v4
-rw-r--r--test-suite/bugs/closed/4471.v6
-rw-r--r--test-suite/bugs/closed/4479.v3
-rw-r--r--test-suite/bugs/closed/4495.v1
-rw-r--r--test-suite/bugs/closed/4498.v24
-rw-r--r--test-suite/bugs/closed/4503.v37
-rw-r--r--test-suite/bugs/closed/4511.v3
-rw-r--r--test-suite/bugs/closed/4519.v21
-rw-r--r--test-suite/bugs/closed/4527.v267
-rw-r--r--test-suite/bugs/closed/4529.v45
-rw-r--r--test-suite/bugs/closed/4533.v226
-rw-r--r--test-suite/bugs/closed/4538.v1
-rw-r--r--test-suite/bugs/closed/4544.v1007
-rw-r--r--test-suite/bugs/closed/4574.v8
-rw-r--r--test-suite/bugs/closed/4576.v3
-rw-r--r--test-suite/bugs/closed/4580.v6
-rw-r--r--test-suite/bugs/closed/4582.v10
-rw-r--r--test-suite/bugs/closed/4588.v10
-rw-r--r--test-suite/bugs/closed/4596.v14
-rw-r--r--test-suite/bugs/closed/4603.v10
-rw-r--r--test-suite/bugs/closed/4616.v4
-rw-r--r--test-suite/bugs/closed/4622.v24
-rw-r--r--test-suite/bugs/closed/4627.v49
-rw-r--r--test-suite/bugs/closed/4628.v46
-rw-r--r--test-suite/bugs/closed/4634.v16
-rw-r--r--test-suite/bugs/closed/4644.v52
-rw-r--r--test-suite/bugs/closed/4653.v3
-rw-r--r--test-suite/bugs/closed/4656.v4
-rw-r--r--test-suite/bugs/closed/4661.v10
-rw-r--r--test-suite/bugs/closed/4663.v3
-rw-r--r--test-suite/bugs/closed/4670.v7
-rw-r--r--test-suite/bugs/closed/4673.v57
-rw-r--r--test-suite/bugs/closed/4679.v18
-rw-r--r--test-suite/bugs/closed/4684.v32
-rw-r--r--test-suite/bugs/closed/4695.v38
-rw-r--r--test-suite/bugs/closed/4708.v8
-rw-r--r--test-suite/bugs/closed/4710.v12
-rw-r--r--test-suite/bugs/closed/4713.v10
-rw-r--r--test-suite/bugs/closed/4718.v15
-rw-r--r--test-suite/bugs/closed/4722.v1
l---------test-suite/bugs/closed/4722/tata1
-rw-r--r--test-suite/bugs/closed/4723.v28
-rw-r--r--test-suite/bugs/closed/4725.v38
-rw-r--r--test-suite/bugs/closed/4726.v19
-rw-r--r--test-suite/bugs/closed/4727.v10
-rw-r--r--test-suite/bugs/closed/4733.v52
-rw-r--r--test-suite/bugs/closed/4737.v9
-rw-r--r--test-suite/bugs/closed/4745.v35
-rw-r--r--test-suite/bugs/closed/4746.v14
-rw-r--r--test-suite/bugs/closed/4754.v35
-rw-r--r--test-suite/bugs/closed/4762.v24
-rw-r--r--test-suite/bugs/closed/4763.v13
-rw-r--r--test-suite/bugs/closed/4764.v5
-rw-r--r--test-suite/bugs/closed/4769.v94
-rw-r--r--test-suite/bugs/closed/4772.v6
-rw-r--r--test-suite/bugs/closed/4780.v106
-rw-r--r--test-suite/bugs/closed/4782.v24
-rw-r--r--test-suite/bugs/closed/4785.v45
-rw-r--r--test-suite/bugs/closed/4785_compat_85.v46
-rw-r--r--test-suite/bugs/closed/4787.v9
-rw-r--r--test-suite/bugs/closed/4798.v3
-rw-r--r--test-suite/bugs/closed/4811.v1685
-rw-r--r--test-suite/bugs/closed/4813.v9
-rw-r--r--test-suite/bugs/closed/4816.v29
-rw-r--r--test-suite/bugs/closed/4818.v24
-rw-r--r--test-suite/bugs/closed/4858.v7
-rw-r--r--test-suite/bugs/closed/4863.v33
-rw-r--r--test-suite/bugs/closed/4865.v52
-rw-r--r--test-suite/bugs/closed/4869.v18
-rw-r--r--test-suite/bugs/closed/4873.v72
-rw-r--r--test-suite/bugs/closed/4877.v12
-rw-r--r--test-suite/bugs/closed/4880.v11
-rw-r--r--test-suite/bugs/closed/4882.v50
-rw-r--r--test-suite/bugs/closed/4893.v4
-rw-r--r--test-suite/bugs/closed/4904.v11
-rw-r--r--test-suite/bugs/closed/4932.v44
-rw-r--r--test-suite/bugs/closed/4955.v98
-rw-r--r--test-suite/bugs/closed/4966.v10
-rw-r--r--test-suite/bugs/closed/4970.v3
-rw-r--r--test-suite/bugs/closed/5011.v2
-rw-r--r--test-suite/bugs/closed/5036.v10
-rw-r--r--test-suite/bugs/closed/5043.v8
-rw-r--r--test-suite/bugs/closed/5045.v3
-rw-r--r--test-suite/bugs/closed/5065.v6
-rw-r--r--test-suite/bugs/closed/5066.v7
-rw-r--r--test-suite/bugs/closed/5077.v8
-rw-r--r--test-suite/bugs/closed/5078.v5
-rw-r--r--test-suite/bugs/closed/5093.v11
-rw-r--r--test-suite/bugs/closed/5095.v5
-rw-r--r--test-suite/bugs/closed/5096.v219
-rw-r--r--test-suite/bugs/closed/5097.v7
-rw-r--r--test-suite/bugs/closed/5123.v33
-rw-r--r--test-suite/bugs/closed/5127.v15
-rw-r--r--test-suite/bugs/closed/5145.v10
-rw-r--r--test-suite/bugs/closed/5149.v47
-rw-r--r--test-suite/bugs/closed/5161.v27
-rw-r--r--test-suite/bugs/closed/5180.v64
-rw-r--r--test-suite/bugs/closed/5181.v3
-rw-r--r--test-suite/bugs/closed/5188.v5
-rw-r--r--test-suite/bugs/closed/5198.v39
-rw-r--r--test-suite/bugs/closed/5203.v5
-rw-r--r--test-suite/bugs/closed/5208.v222
-rw-r--r--test-suite/bugs/closed/HoTT_coq_002.v2
-rw-r--r--test-suite/bugs/closed/HoTT_coq_020.v8
-rw-r--r--test-suite/bugs/closed/HoTT_coq_047.v2
-rw-r--r--test-suite/bugs/closed/HoTT_coq_058.v10
-rw-r--r--test-suite/bugs/closed/HoTT_coq_117.v21
-rw-r--r--test-suite/bugs/closed/PLACEHOLDER.v0
-rw-r--r--test-suite/bugs/closed/bug_4836.v1
-rw-r--r--test-suite/bugs/closed/bug_4836/PLACEHOLDER0
-rw-r--r--test-suite/bugs/opened/3383.v7
-rw-r--r--test-suite/bugs/opened/3410.v1
-rw-r--r--test-suite/bugs/opened/3889.v11
-rw-r--r--test-suite/bugs/opened/3890.v18
-rw-r--r--test-suite/bugs/opened/3916.v3
-rw-r--r--test-suite/bugs/opened/3919.v-disabled13
-rw-r--r--test-suite/bugs/opened/3922.v-disabled83
-rw-r--r--test-suite/bugs/opened/3926.v30
-rw-r--r--test-suite/bugs/opened/3928.v-disabled12
-rw-r--r--test-suite/bugs/opened/3938.v6
-rw-r--r--test-suite/bugs/opened/3946.v11
-rw-r--r--test-suite/bugs/opened/3948.v25
-rw-r--r--test-suite/bugs/opened/4701.v23
-rw-r--r--test-suite/bugs/opened/4717.v19
-rw-r--r--test-suite/bugs/opened/4721.v13
-rw-r--r--test-suite/bugs/opened/4728.v72
-rw-r--r--test-suite/bugs/opened/4755.v34
-rw-r--r--test-suite/bugs/opened/4771.v22
-rw-r--r--test-suite/bugs/opened/4778.v35
-rw-r--r--test-suite/bugs/opened/4781.v94
-rw-r--r--test-suite/bugs/opened/4803.v48
-rw-r--r--test-suite/bugs/opened/4813.v5
-rw-r--r--test-suite/complexity/ring2.v2
-rw-r--r--test-suite/csdp.cachebin76555 -> 0 bytes
-rw-r--r--test-suite/failure/int31.v17
-rw-r--r--test-suite/failure/positivity.v46
-rw-r--r--test-suite/ide/undo013.fake2
-rw-r--r--test-suite/ide/undo014.fake2
-rw-r--r--test-suite/ide/undo015.fake2
-rw-r--r--test-suite/ide/undo016.fake2
-rw-r--r--test-suite/interactive/proof_block.v66
-rw-r--r--test-suite/micromega/bertot.v2
-rw-r--r--test-suite/micromega/qexample.v17
-rw-r--r--test-suite/micromega/rexample.v26
-rw-r--r--test-suite/micromega/square.v3
-rw-r--r--test-suite/micromega/zomicron.v60
-rw-r--r--test-suite/misc/deps/A/A.v1
-rw-r--r--test-suite/misc/deps/B/A.v1
-rw-r--r--test-suite/misc/deps/B/B.v7
-rw-r--r--test-suite/misc/deps/checksum.v2
-rw-r--r--test-suite/output-modulo-time/ltacprof.out12
-rw-r--r--test-suite/output-modulo-time/ltacprof.v8
-rw-r--r--test-suite/output-modulo-time/ltacprof_cutoff.out31
-rw-r--r--test-suite/output-modulo-time/ltacprof_cutoff.v12
-rw-r--r--test-suite/output/Arguments.out2
-rw-r--r--test-suite/output/Arguments.v2
-rw-r--r--test-suite/output/ArgumentsScope.v10
-rw-r--r--test-suite/output/Arguments_renaming.out22
-rw-r--r--test-suite/output/Arguments_renaming.v10
-rw-r--r--test-suite/output/Binder.out8
-rw-r--r--test-suite/output/Binder.v7
-rw-r--r--test-suite/output/Cases.out24
-rw-r--r--test-suite/output/Cases.v37
-rw-r--r--test-suite/output/Errors.out3
-rw-r--r--test-suite/output/Errors.v9
-rw-r--r--test-suite/output/Existentials.out3
-rw-r--r--test-suite/output/InitSyntax.out3
-rw-r--r--test-suite/output/Intuition.out2
-rw-r--r--test-suite/output/Naming.out40
-rw-r--r--test-suite/output/Notations.out14
-rw-r--r--test-suite/output/Notations.v3
-rw-r--r--test-suite/output/Notations2.out36
-rw-r--r--test-suite/output/Notations2.v47
-rw-r--r--test-suite/output/Notations3.out100
-rw-r--r--test-suite/output/Notations3.v141
-rw-r--r--test-suite/output/PatternsInBinders.out39
-rw-r--r--test-suite/output/PatternsInBinders.v66
-rw-r--r--test-suite/output/PrintInfos.out34
-rw-r--r--test-suite/output/PrintInfos.v15
-rw-r--r--test-suite/output/PrintModule.out1
-rw-r--r--test-suite/output/PrintModule.v16
-rw-r--r--test-suite/output/Quote.out18
-rw-r--r--test-suite/output/SearchPattern.out2
-rw-r--r--test-suite/output/Tactics.out2
-rw-r--r--test-suite/output/inference.out10
-rw-r--r--test-suite/output/inference.v1
-rw-r--r--test-suite/output/ltac.out34
-rw-r--r--test-suite/output/ltac.v42
-rw-r--r--test-suite/output/onlyprinting.out2
-rw-r--r--test-suite/output/onlyprinting.v5
-rw-r--r--test-suite/output/qualification.out3
-rw-r--r--test-suite/output/qualification.v19
-rw-r--r--test-suite/output/set.out6
-rw-r--r--test-suite/output/simpl.out6
-rw-r--r--test-suite/output/subst.out97
-rw-r--r--test-suite/output/subst.v48
-rw-r--r--test-suite/output/unifconstraints.out65
-rw-r--r--test-suite/output/unifconstraints.v22
-rw-r--r--test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v20
-rw-r--r--test-suite/success/Case13.v8
-rw-r--r--test-suite/success/CaseInClause.v7
-rw-r--r--test-suite/success/Compat84.v19
-rw-r--r--test-suite/success/Hints.v91
-rw-r--r--test-suite/success/Inductive.v21
-rw-r--r--test-suite/success/Injection.v36
-rw-r--r--test-suite/success/MatchFail.v8
-rw-r--r--test-suite/success/Notations.v23
-rw-r--r--test-suite/success/Notations2.v92
-rw-r--r--test-suite/success/PatternsInBinders.v67
-rw-r--r--test-suite/success/RecTutorial.v6
-rw-r--r--test-suite/success/TacticNotation2.v12
-rw-r--r--test-suite/success/TestRefine.v2
-rw-r--r--test-suite/success/Typeclasses.v188
-rw-r--r--test-suite/success/apply.v2
-rw-r--r--test-suite/success/auto.v89
-rw-r--r--test-suite/success/bigQ.v66
-rw-r--r--test-suite/success/bteauto.v170
-rw-r--r--test-suite/success/cc.v20
-rw-r--r--test-suite/success/clear.v18
-rw-r--r--test-suite/success/coindprim.v85
-rw-r--r--test-suite/success/contradiction.v32
-rw-r--r--test-suite/success/decl_mode2.v249
-rw-r--r--test-suite/success/destruct.v8
-rw-r--r--test-suite/success/eauto.v199
-rw-r--r--test-suite/success/eqdecide.v12
-rw-r--r--test-suite/success/goal_selector.v55
-rw-r--r--test-suite/success/induct.v43
-rw-r--r--test-suite/success/intros.v44
-rw-r--r--test-suite/success/keyedrewrite.v3
-rw-r--r--test-suite/success/ltac.v14
-rw-r--r--test-suite/success/ltacprof.v8
-rw-r--r--test-suite/success/onlyprinting.v7
-rw-r--r--test-suite/success/par_abstract.v25
-rw-r--r--test-suite/success/paralleltac.v26
-rw-r--r--test-suite/success/primitiveproj.v18
-rw-r--r--test-suite/success/programequality.v13
-rw-r--r--test-suite/success/remember.v13
-rw-r--r--test-suite/success/setoid_test.v13
-rw-r--r--test-suite/success/shrink_abstract.v13
-rw-r--r--test-suite/success/shrink_obligations.v28
-rw-r--r--test-suite/success/simpl_tuning.v2
-rw-r--r--test-suite/success/specialize.v8
-rw-r--r--test-suite/success/ssrpattern.v22
-rw-r--r--test-suite/success/subst.v42
-rw-r--r--test-suite/success/univers.v17
-rw-r--r--test-suite/success/vm_univ_poly.v12
-rw-r--r--test-suite/typeclasses/open_constr.v12
-rw-r--r--test-suite/vio/print.v10
297 files changed, 10806 insertions, 362 deletions
diff --git a/test-suite/.csdp.cache b/test-suite/.csdp.cache
new file mode 100644
index 00000000..ba85286d
--- /dev/null
+++ b/test-suite/.csdp.cache
Binary files differ
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 207f25ed..c10cd4ed 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -49,6 +49,10 @@ SINGLE_QUOTE="
#" # double up on the quotes, in a comment, to appease the emacs syntax highlighter
# wrap the arguments in parens, but only if they exist
get_coq_prog_args_in_parens = $(subst $(SINGLE_QUOTE),,$(if $(call get_coq_prog_args,$(1)), ($(call get_coq_prog_args,$(1)))))
+# get the command to use with this set of arguments; if there's -compile, use coqc, else use coqtop
+has_compile_flag = $(filter "-compile",$(call get_coq_prog_args,$(1)))
+has_profile_ltac_or_compile_flag = $(filter "-profile-ltac-cutoff" "-profile-ltac" "-compile",$(call get_coq_prog_args,$(1)))
+get_command_based_on_flags = $(if $(call has_profile_ltac_or_compile_flag,$(1)),$(coqc),$(command))
bogomips:=
@@ -79,11 +83,14 @@ COMPLEXITY := $(if $(bogomips),complexity)
BUGS := bugs/opened bugs/closed
VSUBSYSTEMS := prerequisite success failure $(BUGS) output \
- interactive micromega $(COMPLEXITY) modules stm
+ output-modulo-time interactive micromega $(COMPLEXITY) modules stm
# All subsystems
SUBSYSTEMS := $(VSUBSYSTEMS) misc bugs ide vio coqchk
+PREREQUISITELOG = prerequisite/admit.v.log \
+ prerequisite/make_local.v.log prerequisite/make_notation.v.log
+
#######################################################################
# Phony targets
#######################################################################
@@ -92,13 +99,13 @@ SUBSYSTEMS := $(VSUBSYSTEMS) misc bugs ide vio coqchk
.PHONY: all run clean $(SUBSYSTEMS)
all: run
- $(MAKE) --quiet summary.log
+ $(MAKE) report
run: $(SUBSYSTEMS)
bugs: $(BUGS)
clean:
- rm -f trace lia.cache
+ rm -f trace .lia.cache
$(SHOW) "RM <**/*.stamp> <**/*.vo> <**/*.vio> <**/*.log>"
$(HIDE)find . \( \
-name '*.stamp' -o -name '*.vo' -o -name '*.vio' -o -name '*.log' \
@@ -133,6 +140,7 @@ summary:
$(call summary_dir, "Failure tests", failure); \
$(call summary_dir, "Bugs tests", bugs); \
$(call summary_dir, "Output tests", output); \
+ $(call summary_dir, "Output (modulo time changes) tests", output-modulo-time); \
$(call summary_dir, "Interactive tests", interactive); \
$(call summary_dir, "Micromega tests", micromega); \
$(call summary_dir, "Miscellaneous tests", misc); \
@@ -151,11 +159,11 @@ summary:
}
summary.log:
- $(SHOW) SUMMARY
+ $(SHOW) BUILDING SUMMARY FILE
$(HIDE)$(MAKE) --quiet summary > "$@"
report: summary.log
- $(HIDE)if grep -F 'Error!' summary.log ; then false; fi
+ $(HIDE)if grep -q -F 'Error!' summary.log ; then echo FAILURES; grep -F 'Error!' summary.log; false; else echo NO FAILURES; fi
#######################################################################
# Regression (and progression) tests
@@ -172,7 +180,7 @@ $(addsuffix .log,$(wildcard bugs/opened/*.v)): %.v.log: %.v
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(command) "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...still active"; \
@@ -193,7 +201,7 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(command) "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -221,12 +229,12 @@ $(addsuffix .log,$(wildcard prerequisite/*.v)): %.v.log: %.v
fi; \
} > "$@"
-$(addsuffix .log,$(wildcard success/*.v micromega/*.v modules/*.v)): %.v.log: %.v
+$(addsuffix .log,$(wildcard success/*.v micromega/*.v modules/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
opts="$(if $(findstring modules/,$<),-R modules Mods -impredicative-set)"; \
echo $(call log_intro,$<); \
- $(command) "$<" $(call get_coq_prog_args,"$<") $$opts 2>&1; R=$$?; times; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") $$opts 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -242,7 +250,6 @@ $(addsuffix .log,$(wildcard stm/*.v)): %.v.log: %.v
$(HIDE){ \
echo $(call log_intro,$<); \
$(coqc) "$<" $(call get_coq_prog_args,"$<") -async-proofs on \
- -async-proofs-private-flags fallback-to-lazy-if-marshal-error=no,fallback-to-lazy-if-slave-dies=no \
$$opts 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
@@ -253,11 +260,11 @@ $(addsuffix .log,$(wildcard stm/*.v)): %.v.log: %.v
fi; \
} > "$@"
-$(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v
+$(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(command) "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -267,16 +274,17 @@ $(addsuffix .log,$(wildcard failure/*.v)): %.v.log: %.v
fi; \
} > "$@"
-$(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out
+$(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
tmpoutput=`mktemp /tmp/coqcheck.XXXXXX`; \
- $(command) "$<" $(call get_coq_prog_args,"$<") 2>&1 \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1 \
| grep -v "Welcome to Coq" \
| grep -v "\[Loading ML file" \
| grep -v "Skipping rcfile loading" \
| grep -v "^<W>" \
+ | sed 's/File "[^"]*"/File "stdin"/' \
> $$tmpoutput; \
diff -u $*.out $$tmpoutput 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
@@ -289,7 +297,43 @@ $(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out
rm $$tmpoutput; \
} > "$@"
-$(addsuffix .log,$(wildcard interactive/*.v)): %.v.log: %.v
+$(addsuffix .log,$(wildcard output-modulo-time/*.v)): %.v.log: %.v %.out
+ @echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
+ $(HIDE){ \
+ echo $(call log_intro,$<); \
+ tmpoutput=`mktemp /tmp/coqcheck.XXXXXX`; \
+ tmpexpected=`mktemp /tmp/coqcheck.XXXXXX`; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1 \
+ | grep -v "Welcome to Coq" \
+ | grep -v "\[Loading ML file" \
+ | grep -v "Skipping rcfile loading" \
+ | grep -v "^<W>" \
+ | sed -e 's/\s*[-+0-9]*\.[0-9][0-9]*\s*//g' \
+ -e 's/\s*0\.\s*//g' \
+ -e 's/\s*[-+]nan\s*//g' \
+ -e 's/\s*[-+]inf\s*//g' \
+ -e 's/^[^a-zA-Z]*//' \
+ | sort \
+ > $$tmpoutput; \
+ sed -e 's/\s*[-+0-9]*\.[0-9][0-9]*\s*//g' \
+ -e 's/\s*0\.\s*//g' \
+ -e 's/\s*[-+]nan\s*//g' \
+ -e 's/\s*[-+]inf\s*//g' \
+ -e 's/^[^a-zA-Z]*//' \
+ $*.out | sort > $$tmpexpected; \
+ diff -b -u $$tmpexpected $$tmpoutput 2>&1; R=$$?; times; \
+ if [ $$R = 0 ]; then \
+ echo $(log_success); \
+ echo " $<...Ok"; \
+ else \
+ echo $(log_failure); \
+ echo " $<...Error! (unexpected output)"; \
+ fi; \
+ rm $$tmpoutput; \
+ rm $$tmpexpected; \
+ } > "$@"
+
+$(addsuffix .log,$(wildcard interactive/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
@@ -307,12 +351,12 @@ $(addsuffix .log,$(wildcard interactive/*.v)): %.v.log: %.v
# the .v file with exactly two digits after the dot. The reference for
# time is a 6120 bogomips cpu.
ifneq (,$(bogomips))
-$(addsuffix .log,$(wildcard complexity/*.v)): %.v.log: %.v
+$(addsuffix .log,$(wildcard complexity/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
true "extract effective user time"; \
- res=`$(command) "$<" $(call get_coq_prog_args,"$<") 2>&1 | sed -n -e "s/Finished transaction in .*(\([0-9]*\.[0-9]*\)u.*)/\1/p" | head -1`; \
+ res=`$(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1 | sed -n -e "s/Finished transaction in .*(\([0-9]*\.[0-9]*\)u.*)/\1/p" | head -1`; \
R=$$?; times; \
if [ $$R != 0 ]; then \
echo $(log_failure); \
@@ -338,11 +382,11 @@ $(addsuffix .log,$(wildcard complexity/*.v)): %.v.log: %.v
endif
# Ideal-features tests
-$(addsuffix .log,$(wildcard ideal-features/*.v)): %.v.log: %.v
+$(addsuffix .log,$(wildcard ideal-features/*.v)): %.v.log: %.v $(PREREQUISITELOG)
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(command) "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
+ $(call get_command_based_on_flags,"$<") "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
if [ $$R != 0 ]; then \
echo $(log_success); \
echo " $<...still wished"; \
@@ -361,7 +405,7 @@ modules/%.vo: modules/%.v
# Miscellaneous tests
#######################################################################
-misc: misc/deps-order.log misc/universes.log
+misc: misc/deps-order.log misc/universes.log misc/deps-checksum.log
# Check that both coqdep and coqtop/coqc supports -R
# Check that both coqdep and coqtop/coqc takes the later -R
@@ -390,8 +434,28 @@ misc/deps-order.log:
rm $$tmpoutput; \
} > "$@"
+deps-checksum: misc/deps-checksum.log
+misc/deps-checksum.log:
+ @echo "TEST misc/deps-checksum"
+ $(HIDE){ \
+ echo $(call log_intro,deps-checksum); \
+ rm -f misc/deps/*/*.vo; \
+ $(bincoqc) -R misc/deps/A A misc/deps/A/A.v; \
+ $(bincoqc) -R misc/deps/B A misc/deps/B/A.v; \
+ $(bincoqc) -R misc/deps/B A misc/deps/B/B.v; \
+ $(coqtop) -R misc/deps/B A -R misc/deps/A A -load-vernac-source misc/deps/checksum.v 2>&1; \
+ if [ $$? = 0 ]; then \
+ echo $(log_success); \
+ echo " misc/deps-checksum...Ok"; \
+ else \
+ echo $(log_failure); \
+ echo " misc/deps-checksum...Error!"; \
+ fi; \
+ } > "$@"
+
+
# Sort universes for the whole standard library
-EXPECTED_UNIVERSES := 5
+EXPECTED_UNIVERSES := 4 # Prop is not counted
universes: misc/universes.log
misc/universes.log: misc/universes/all_stdlib.v
@echo "TEST misc/universes"
@@ -422,7 +486,7 @@ ide : $(patsubst %.fake,%.fake.log,$(wildcard ide/*.fake))
@echo "TEST $<"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(BIN)fake_ide $< "$(BIN)coqtop -boot -async-proofs on" 2>&1; \
+ $(BIN)fake_ide $< "$(BIN)coqtop -boot -async-proofs on -async-proofs-tactic-error-resilience off -async-proofs-command-error-resilience off" 2>&1; \
if [ $$? = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -464,4 +528,3 @@ coqchk: $(patsubst %.v,%.chk.log,$(wildcard coqchk/*.v))
echo " $<...Error!"; \
fi; \
} > "$@"
-
diff --git a/test-suite/bugs/4623.v b/test-suite/bugs/4623.v
new file mode 100644
index 00000000..405d0980
--- /dev/null
+++ b/test-suite/bugs/4623.v
@@ -0,0 +1,5 @@
+Goal Type -> Type.
+set (T := Type).
+clearbody T.
+refine (@id _).
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/4624.v b/test-suite/bugs/4624.v
new file mode 100644
index 00000000..a737afcd
--- /dev/null
+++ b/test-suite/bugs/4624.v
@@ -0,0 +1,7 @@
+Record foo := mkfoo { type : Type }.
+
+Canonical Structure fooA (T : Type) := mkfoo (T -> T).
+
+Definition id (t : foo) (x : type t) := x.
+
+Definition bar := id _ ((fun x : nat => x) : _). \ No newline at end of file
diff --git a/test-suite/bugs/closed/1784.v b/test-suite/bugs/closed/1784.v
index 0b63d7b5..25d1b192 100644
--- a/test-suite/bugs/closed/1784.v
+++ b/test-suite/bugs/closed/1784.v
@@ -91,9 +91,8 @@ Next Obligation. intro H; inversion H. Defined.
Next Obligation. intro H; inversion H; subst. Defined.
Next Obligation.
intro H1; contradict H. inversion H1; subst. assumption.
- contradict H0; assumption. Defined.
-Next Obligation.
- intro H1; contradict H0. inversion H1; subst. assumption. Defined.
+ contradict H0; assumption. Defined.
+Next Obligation. intro H1; contradict H0. inversion H1; subst. assumption. Defined.
Next Obligation.
intro H1; contradict H. inversion H1; subst. assumption. Defined.
Next Obligation.
diff --git a/test-suite/bugs/closed/1850.v b/test-suite/bugs/closed/1850.v
new file mode 100644
index 00000000..26b48093
--- /dev/null
+++ b/test-suite/bugs/closed/1850.v
@@ -0,0 +1,4 @@
+Parameter P : Type -> Type -> Type.
+Notation "e |= t --> v" := (P e t v) (at level 100, t at level 54).
+Fail Check (nat |= nat --> nat).
+
diff --git a/test-suite/bugs/closed/2016.v b/test-suite/bugs/closed/2016.v
index 13ec5bea..536e6fab 100644
--- a/test-suite/bugs/closed/2016.v
+++ b/test-suite/bugs/closed/2016.v
@@ -1,6 +1,8 @@
(* Coq 8.2beta4 *)
Require Import Classical_Prop.
+Unset Structural Injection.
+
Record coreSemantics : Type := CoreSemantics {
core: Type;
corestep: core -> core -> Prop;
@@ -49,7 +51,7 @@ unfold oe_corestep; intros.
assert (HH:= step_fun _ _ _ H H0); clear H H0.
destruct q1; destruct q2; unfold oe2coreSem; simpl in *.
generalize (inj_pairT1 _ _ _ _ _ _ HH); clear HH; intros.
-injection H; clear H; intros.
+injection H.
revert in_q1 in_corestep1 in_corestep_fun1
H.
pattern in_core1.
@@ -59,4 +61,4 @@ apply sym_eq.
(** good to here **)
Show Universes.
Print Universes.
-Fail apply H0. \ No newline at end of file
+Fail apply H0.
diff --git a/test-suite/bugs/closed/2021.v b/test-suite/bugs/closed/2021.v
index e598e5ae..5df92998 100644
--- a/test-suite/bugs/closed/2021.v
+++ b/test-suite/bugs/closed/2021.v
@@ -1,6 +1,8 @@
(* correct failure of injection/discriminate on types whose inductive
status derives from the substitution of an argument *)
+Unset Structural Injection.
+
Inductive t : nat -> Type :=
| M : forall n: nat, nat -> t n.
diff --git a/test-suite/bugs/closed/2310.v b/test-suite/bugs/closed/2310.v
index 0be859ed..7fae3287 100644
--- a/test-suite/bugs/closed/2310.v
+++ b/test-suite/bugs/closed/2310.v
@@ -14,4 +14,8 @@ Definition replace a (y:Nest (prod a a)) : a = a -> Nest a.
(P:=\a.Nest (prod a a) and P:=\_.Nest (prod a a)) and refine should either
leave P as subgoal or choose itself one solution *)
-intros. refine (Cons (cast H _ y)). \ No newline at end of file
+ intros. Fail refine (Cons (cast H _ y)).
+ Unset Solve Unification Constraints. (* Keep the unification constraint around *)
+ refine (Cons (cast H _ y)).
+ intros.
+ refine (Nest (prod X X)). Qed. \ No newline at end of file
diff --git a/test-suite/bugs/opened/2800.v b/test-suite/bugs/closed/2800.v
index c559ab0c..2ee43893 100644
--- a/test-suite/bugs/opened/2800.v
+++ b/test-suite/bugs/closed/2800.v
@@ -1,6 +1,6 @@
Goal False.
-Fail intuition
+intuition
match goal with
| |- _ => idtac " foo"
end.
diff --git a/test-suite/bugs/closed/2839.v b/test-suite/bugs/closed/2839.v
index e396fe06..e727e260 100644
--- a/test-suite/bugs/closed/2839.v
+++ b/test-suite/bugs/closed/2839.v
@@ -5,6 +5,6 @@ intro.
Fail
let H :=
match goal with
- | [ H : appcontext G [@eq _ _] |- _ ] => let H' := context G[@plus 2] in H'
+ | [ H : context G [@eq _ _] |- _ ] => let H' := context G[@plus 2] in H'
end
in pose H.
diff --git a/test-suite/bugs/closed/2848.v b/test-suite/bugs/closed/2848.v
index de137d39..828e3b8c 100644
--- a/test-suite/bugs/closed/2848.v
+++ b/test-suite/bugs/closed/2848.v
@@ -2,8 +2,9 @@ Require Import Setoid.
Parameter value' : Type.
Parameter equiv' : value' -> value' -> Prop.
-
+Axiom cheat : forall {A}, A.
Add Parametric Relation : _ equiv'
- reflexivity proved by (Equivalence.equiv_reflexive _)
- transitivity proved by (Equivalence.equiv_transitive _)
+ reflexivity proved by (Equivalence.equiv_reflexive cheat)
+ transitivity proved by (Equivalence.equiv_transitive cheat)
as apply_equiv'_rel.
+Check apply_equiv'_rel : PreOrder equiv'. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3045.v b/test-suite/bugs/closed/3045.v
index ef110ad0..5f80013d 100644
--- a/test-suite/bugs/closed/3045.v
+++ b/test-suite/bugs/closed/3045.v
@@ -12,7 +12,7 @@ Record SpecializedCategory (obj : Type) :=
Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d'
}.
-Arguments Compose {obj} [C s d d'] m1 m2 : rename.
+Arguments Compose {obj} [C s d d'] _ _ : rename.
Inductive ReifiedMorphism : forall objC (C : SpecializedCategory objC), C -> C -> Type :=
| ReifiedComposedMorphism : forall objC C s d d', ReifiedMorphism C d d' -> ReifiedMorphism C s d -> @ReifiedMorphism objC C s d'.
diff --git a/test-suite/bugs/closed/3068.v b/test-suite/bugs/closed/3068.v
index ced6d959..79671ce9 100644
--- a/test-suite/bugs/closed/3068.v
+++ b/test-suite/bugs/closed/3068.v
@@ -56,7 +56,7 @@ Section Finite_nat_set.
subst fs1.
apply iff_refl.
intros H.
- eapply counted_list_equal_nth_char.
+ eapply (counted_list_equal_nth_char _ _ _ _ ?[def]).
intros i.
destruct (counted_def_nth fs1 i _ ) eqn:H0.
(* This was not part of the initial bug report; this is to check that
diff --git a/test-suite/bugs/closed/3070.v b/test-suite/bugs/closed/3070.v
new file mode 100644
index 00000000..7a8feca5
--- /dev/null
+++ b/test-suite/bugs/closed/3070.v
@@ -0,0 +1,6 @@
+(* Testing subst wrt chains of dependencies *)
+
+Lemma foo (a1 a2 : Set) (b1 : a1 -> Prop)
+ (Ha : a1 = a2) (c : a1) (d : b1 c) : True.
+Proof.
+ subst.
diff --git a/test-suite/bugs/closed/3080.v b/test-suite/bugs/closed/3080.v
new file mode 100644
index 00000000..7d0dc090
--- /dev/null
+++ b/test-suite/bugs/closed/3080.v
@@ -0,0 +1,18 @@
+(* -*- coq-prog-args: ("-emacs" "-nois") -*- *)
+Delimit Scope type_scope with type.
+Delimit Scope function_scope with function.
+
+Bind Scope type_scope with Sortclass.
+Bind Scope function_scope with Funclass.
+
+Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+
+Definition compose {A B C} (g : B -> C) (f : A -> B) :=
+ fun x : A => g (f x).
+
+Notation " g ∘ f " := (compose g f)
+ (at level 40, left associativity) : function_scope.
+
+Fail Check (fun x => x) ∘ (fun x => x). (* this [Check] should fail, as [function_scope] is not opened *)
+Check compose ((fun x => x) ∘ (fun x => x)) (fun x => x). (* this check should succeed, as [function_scope] should be automatically bound in the arugments to [compose] *)
diff --git a/test-suite/bugs/closed/3209.v b/test-suite/bugs/closed/3209.v
new file mode 100644
index 00000000..855058b0
--- /dev/null
+++ b/test-suite/bugs/closed/3209.v
@@ -0,0 +1,75 @@
+(* Avoiding some occur-check *)
+
+(* 1. Original example *)
+
+Inductive eqT {A} (x : A) : A -> Type :=
+ reflT : eqT x x.
+Definition Bi_inv (A B : Type) (f : (A -> B)) :=
+ sigT (fun (g : B -> A) =>
+ sigT (fun (h : B -> A) =>
+ sigT (fun (α : forall b : B, eqT (f (g b)) b) =>
+ forall a : A, eqT (h (f a)) a))).
+Definition TEquiv (A B : Type) := sigT (fun (f : A -> B) => Bi_inv _ _ f).
+
+Axiom UA : forall (A B : Type), TEquiv (TEquiv A B) (eqT A B).
+Definition idtoeqv {A B} (e : eqT A B) : TEquiv A B :=
+ sigT_rect (fun _ => TEquiv A B)
+ (fun (f : TEquiv A B -> eqT A B) H =>
+ sigT_rect _ (* (fun _ => TEquiv A B) *)
+ (fun g _ => g e)
+ H)
+ (UA A B).
+
+(* 2. Alternative example by Guillaume *)
+
+Inductive foo (A : Prop) : Prop := Foo : foo A.
+Axiom bar : forall (A : Prop) (P : foo A -> Prop), (A -> P (Foo A)) -> Prop.
+
+(* This used to fail with a Not_found, we fail more graciously but a
+ heuristic could be implemented, e.g. in some smart occur-check
+ function, to find a solution of then form ?P := fun _ => ?P' *)
+
+Fail Check (fun e : ?[T] => bar ?[A] ?[P] (fun g : ?[A'] => g e)).
+
+(* This works and tells which solution we could have inferred *)
+
+Check (fun e : ?[T] => bar ?[A] (fun _ => ?[P]) (fun g : ?[A'] => g e)).
+
+(* For the record, here is the trace in the failing example:
+
+In (fun e : ?T => bar ?[A] ?[P] (fun g : ?A' => g e)), we have the existential variables
+
+e:?T |- ?A : Prop
+e:?T |- ?P : foo ?A -> Prop
+e:?T |- ?A' : Type
+
+with constraints
+
+?A' == ?A
+?A' == ?T -> ?P (Foo ?A)
+
+To type (g e), unification first defines
+
+?A := forall x:?B, ?P'{e:=e,x:=x}
+with ?T <= ?B
+and ?P'@{e:=e,x:=e} <= ?P@{e:=e} (Foo (forall x:?B, ?P'{e:=e,x:=x}))
+
+Then, since ?P'@{e:=e,x:=e} may use "e" in two different ways, it is
+not a pattern and we define a new
+
+e:?T x:?B|- ?P'' : foo (?B' -> ?P''') -> Prop
+
+for some ?B' and ?P''', together with
+
+?P'@{e,x} := ?P''{e:=e,x:=e} (Foo (?B -> ?P')
+?P@{e} := ?P''{e:=e,x:=e}
+
+Moreover, ?B' and ?P''' have to satisfy
+
+?B'@{e:=e,x:=e} == ?B@{e:=e}
+?P'''@{e:=e,x:=e} == ?P'@{e:=e,x:=x}
+
+and this leads to define ?P' which was the initial existential
+variable to define.
+*)
+
diff --git a/test-suite/bugs/closed/3251.v b/test-suite/bugs/closed/3251.v
index 5a7ae200..d4ce050c 100644
--- a/test-suite/bugs/closed/3251.v
+++ b/test-suite/bugs/closed/3251.v
@@ -1,4 +1,5 @@
Goal True.
+idtac.
Ltac foo := idtac.
(* print out happens twice:
foo is defined
diff --git a/test-suite/bugs/closed/3383.v b/test-suite/bugs/closed/3383.v
new file mode 100644
index 00000000..25257644
--- /dev/null
+++ b/test-suite/bugs/closed/3383.v
@@ -0,0 +1,6 @@
+Goal forall b : bool, match b as b' return if b' then True else True with true => I | false => I end = match b as b' return if b' then True else True with true => I | false => I end.
+intro.
+lazymatch goal with
+| [ |- context[match ?b as b' in bool return @?P b' with true => ?t | false => ?f end] ]
+ => change (match b as b' in bool return P b' with true => t | false => f end) with (@bool_rect P t f b)
+end.
diff --git a/test-suite/bugs/closed/3424.v b/test-suite/bugs/closed/3424.v
index f9b2c386..ee8cabf1 100644
--- a/test-suite/bugs/closed/3424.v
+++ b/test-suite/bugs/closed/3424.v
@@ -13,6 +13,7 @@ Notation "0" := (trunc_S minus_one) : trunc_scope.
Class IsTrunc (n : trunc_index) (A : Type) : Type := Trunc_is_trunc : IsTrunc_internal n A.
Notation IsHProp := (IsTrunc minus_one).
Notation IsHSet := (IsTrunc 0).
+Set Refolding Reduction.
Goal forall (A : Type) (a b : A) (H' : IsHSet A), { x : Type & IsHProp x }.
Proof.
intros.
diff --git a/test-suite/bugs/closed/3441.v b/test-suite/bugs/closed/3441.v
new file mode 100644
index 00000000..50d29780
--- /dev/null
+++ b/test-suite/bugs/closed/3441.v
@@ -0,0 +1,23 @@
+Axiom f : nat -> nat -> nat.
+Fixpoint do_n (n : nat) (k : nat) :=
+ match n with
+ | 0 => k
+ | S n' => do_n n' (f k k)
+ end.
+
+Notation big := (_ = _).
+Axiom k : nat.
+Goal True.
+Timeout 1 let H := fresh "H" in
+ let x := constr:(let n := 17 in do_n n = do_n n) in
+ let y := (eval lazy in x) in
+ pose proof y as H. (* Finished transaction in 1.102 secs (1.084u,0.016s) (successful) *)
+Timeout 1 let H := fresh "H" in
+ let x := constr:(let n := 17 in do_n n = do_n n) in
+ let y := (eval lazy in x) in
+ pose y as H; clearbody H. (* Finished transaction in 0.412 secs (0.412u,0.s) (successful) *)
+
+Timeout 1 Time let H := fresh "H" in
+ let x := constr:(let n := 17 in do_n n = do_n n) in
+ let y := (eval lazy in x) in
+ assert (H := y). (* Finished transaction in 1.19 secs (1.164u,0.024s) (successful) *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/3495.v b/test-suite/bugs/closed/3495.v
new file mode 100644
index 00000000..102a2aba
--- /dev/null
+++ b/test-suite/bugs/closed/3495.v
@@ -0,0 +1,18 @@
+Require Import RelationClasses.
+
+Axiom R : Prop -> Prop -> Prop.
+Declare Instance : Reflexive R.
+
+Class bar := { x : False }.
+Record foo := { a : Prop ; b : bar }.
+
+Definition default_foo (a0 : Prop) `{b : bar} : foo := {| a := a0 ; b := b |}.
+
+Goal exists k, R k True.
+Proof.
+eexists.
+evar (b : bar).
+let e := match goal with |- R ?e _ => constr:(e) end in
+unify e (a (default_foo True)).
+subst b.
+reflexivity.
diff --git a/test-suite/bugs/closed/3513.v b/test-suite/bugs/closed/3513.v
index fcdfa005..9ed0926a 100644
--- a/test-suite/bugs/closed/3513.v
+++ b/test-suite/bugs/closed/3513.v
@@ -1,4 +1,3 @@
-Require Import TestSuite.admit.
(* File reduced by coq-bug-finder from original input, then from 5752 lines to 3828 lines, then from 2707 lines to 558 lines, then from 472 lines to 168 lines, then from 110 lines to 101 lines, then from 96 lines to 77 lines, then from 80 lines to 64 lines *)
Require Coq.Setoids.Setoid.
Import Coq.Setoids.Setoid.
@@ -35,7 +34,7 @@ Local Existing Instance ILFun_Ops.
Local Existing Instance ILFun_ILogic.
Definition catOP (P Q: OPred) : OPred := admit.
Add Parametric Morphism : catOP with signature lentails ==> lentails ==> lentails as catOP_entails_m.
-admit.
+apply admit.
Defined.
Definition catOPA (P Q R : OPred) : catOP (catOP P Q) R -|- catOP P (catOP Q R) := admit.
Class IsPointed (T : Type) := point : T.
@@ -69,8 +68,27 @@ Goal forall (T : Type) (O0 : T -> OPred) (O1 : T -> PointedOPred)
pose P;
refine (P _ _)
end; unfold Basics.flip.
- 2: solve [ apply reflexivity ].
- Undo.
- 2: reflexivity. (* Toplevel input, characters 18-29:
-Error:
-Tactic failure: The relation lentails is not a declared reflexive relation. Maybe you need to require the Setoid library. *) \ No newline at end of file
+ Focus 2.
+ Set Typeclasses Debug.
+ Set Typeclasses Legacy Resolution.
+ apply reflexivity.
+ (* Debug: 1.1: apply @IsPointed_catOP on
+(IsPointed (exists x0 : Actions, (catOP ?Goal O2 : OPred) x0))
+Debug: 1.1.1.1: apply OPred_inhabited on (IsPointed (exists x0 : Actions, ?Goal x0))
+Debug: 1.1.2.1: apply OPred_inhabited on (IsPointed (exists x : Actions, O2 x))
+Debug: 2.1: apply @Equivalence_Reflexive on (Reflexive lentails)
+Debug: 2.1.1: no match for (Equivalence lentails) , 5 possibilities
+Debug: Backtracking after apply @Equivalence_Reflexive
+Debug: 2.2: apply @PreOrder_Reflexive on (Reflexive lentails)
+Debug: 2.2.1.1: apply @lentailsPre on (PreOrder lentails)
+Debug: 2.2.1.1.1.1: apply ILFun_ILogic on (ILogic OPred)
+*)
+ Undo. Unset Typeclasses Legacy Resolution.
+ Test Typeclasses Unique Solutions.
+ Test Typeclasses Unique Instances.
+ Show Existentials.
+ Set Typeclasses Debug Verbosity 2.
+ Set Printing All.
+ (* As in 8.5, allow a shelved subgoal to remain *)
+ apply reflexivity.
+ \ No newline at end of file
diff --git a/test-suite/bugs/closed/3563.v b/test-suite/bugs/closed/3563.v
index 67972166..961563ed 100644
--- a/test-suite/bugs/closed/3563.v
+++ b/test-suite/bugs/closed/3563.v
@@ -16,11 +16,11 @@ Goal forall (H H0 H1 : Type) (H2 : H1) (H3 : H1 -> H * H0)
transport (fun y : H1 -> H * H0 => H5 (fst (y H2))) H4 H6 = H7.
intros.
match goal with
- | [ |- appcontext ctx [transport (fun y => (?g (@fst ?C ?h (y H2)))) H4 H6] ]
+ | [ |- context ctx [transport (fun y => (?g (@fst ?C ?h (y H2)))) H4 H6] ]
=> set(foo:=h); idtac
end.
match goal with
- | [ |- appcontext ctx [transport (fun y => (?g (fst (y H2))))] ]
+ | [ |- context ctx [transport (fun y => (?g (fst (y H2))))] ]
=> idtac
end.
Abort.
@@ -30,7 +30,7 @@ Goal forall (H H0 H1 : Type) (H2 : H1) (H3 : H1 -> (H1 -> H) * H0)
transport (fun y : H1 -> (H1 -> H) * H0 => H5 (fst (y H2) H2)) H4 H6 = H7.
intros.
match goal with
- | [ |- appcontext ctx [transport (fun y => (?g (@fst ?C ?D (y H2) ?X)))] ]
+ | [ |- context ctx [transport (fun y => (?g (@fst ?C ?D (y H2) ?X)))] ]
=> set(foo:=X)
end.
(* Anomaly: Uncaught exception Not_found(_). Please report. *)
diff --git a/test-suite/bugs/closed/3612.v b/test-suite/bugs/closed/3612.v
index 9125ab16..a5476850 100644
--- a/test-suite/bugs/closed/3612.v
+++ b/test-suite/bugs/closed/3612.v
@@ -6,6 +6,8 @@ lines, then from 421 lines to 428 lines, then from 444 lines to 429 lines, then
Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
Reserved Notation "x = y :> T" (at level 70, y at next level, no associativity).
Reserved Notation "x = y" (at level 70, no associativity).
+Delimit Scope type_scope with type.
+Bind Scope type_scope with Sortclass.
Open Scope type_scope.
Global Set Universe Polymorphism.
Notation "A -> B" := (forall (_ : A), B) : type_scope.
@@ -35,6 +37,9 @@ Axiom path_path_sigma : forall {A : Type} (P : A -> Type) (u v : sigT P)
(r : p..1 = q..1)
(s : transport (fun x => transport P x u.2 = v.2) r p..2 = q..2),
p = q.
+
+Declare ML Module "coretactics".
+
Goal forall (A : Type) (B : forall _ : A, Type) (x : @sigT A (fun x : A => B x))
(xx : @paths (@sigT A (fun x0 : A => B x0)) x x),
@paths (@paths (@sigT A (fun x0 : A => B x0)) x x) xx
diff --git a/test-suite/bugs/closed/3647.v b/test-suite/bugs/closed/3647.v
index 495e67e0..f5a22bd5 100644
--- a/test-suite/bugs/closed/3647.v
+++ b/test-suite/bugs/closed/3647.v
@@ -650,4 +650,5 @@ Goal forall (ptest : program) (cond : Condition) (value : bool)
Grab Existential Variables.
subst_body; simpl.
- refine (all_behead (projT2 _)).
+ Fail refine (all_behead (projT2 _)).
+ Unset Solve Unification Constraints. refine (all_behead (projT2 _)).
diff --git a/test-suite/bugs/closed/3649.v b/test-suite/bugs/closed/3649.v
index 06188e7b..fc4c171e 100644
--- a/test-suite/bugs/closed/3649.v
+++ b/test-suite/bugs/closed/3649.v
@@ -2,8 +2,11 @@
(* File reduced by coq-bug-finder from original input, then from 9518 lines to 404 lines, then from 410 lines to 208 lines, then from 162 lines to 77 lines *)
(* coqc version trunk (September 2014) compiled on Sep 18 2014 21:0:5 with OCaml 4.01.0
coqtop version cagnode16:/afs/csail.mit.edu/u/j/jgross/coq-trunk,trunk (07e4438bd758c2ced8caf09a6961ccd77d84e42b) *)
+Declare ML Module "coretactics".
Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
Reserved Notation "x = y" (at level 70, no associativity).
+Delimit Scope type_scope with type.
+Bind Scope type_scope with Sortclass.
Open Scope type_scope.
Axiom admit : forall {T}, T.
Notation "A -> B" := (forall (_ : A), B) : type_scope.
@@ -54,4 +57,4 @@ Goal forall (C D : PreCategory) (G G' : Functor C D)
(** This [change] succeeded, but did not progress, in 07e4438bd758c2ced8caf09a6961ccd77d84e42b, because [T0 x o T1 x] was not found in the goal *)
let T0 := match goal with |- context[components_of ?T0 ?x o components_of ?T1 ?x] => constr:(T0) end in
let T1 := match goal with |- context[components_of ?T0 ?x o components_of ?T1 ?x] => constr:(T1) end in
- progress change (T0 x o T1 x) with ((fun y => y) (T0 x o T1 x)). \ No newline at end of file
+ progress change (T0 x o T1 x) with ((fun y => y) (T0 x o T1 x)).
diff --git a/test-suite/bugs/closed/3690.v b/test-suite/bugs/closed/3690.v
index c24173ab..fd9640b8 100644
--- a/test-suite/bugs/closed/3690.v
+++ b/test-suite/bugs/closed/3690.v
@@ -47,7 +47,7 @@ Type@{Top.21} -> Type@{Top.23}
Top.23 < Top.22
*) *)
Fail Check @qux@{Set Set}.
-Fail Check @qux@{Set Set Set}.
+Check @qux@{Type Type Type Type}.
(* [qux] should only need two universes *)
-Check @qux@{i j k}. (* Error: The command has not failed!, but I think this is suboptimal *)
+Check @qux@{i j k l}. (* Error: The command has not failed!, but I think this is suboptimal *)
Fail Check @qux@{i j}.
diff --git a/test-suite/bugs/closed/3699.v b/test-suite/bugs/closed/3699.v
index aad0bb44..efa43252 100644
--- a/test-suite/bugs/closed/3699.v
+++ b/test-suite/bugs/closed/3699.v
@@ -34,8 +34,7 @@ Module NonPrim.
: forall b:B, P b.
Proof.
intros b.
- unshelve (refine (pr1 (isconnected_elim _ _))).
- exact b.
+ unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))).
intro x.
exact (transport P x.2 (d x.1)).
Defined.
@@ -47,8 +46,7 @@ Module NonPrim.
: forall b:B, P b.
Proof.
intros b.
- unshelve (refine (pr1 (isconnected_elim _ _))).
- exact b.
+ unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))).
intros [a p].
exact (transport P p (d a)).
Defined.
@@ -65,7 +63,7 @@ Module NonPrim.
set (fibermap := fun a0p : hfiber f (f a)
=> let (a0, p) := a0p in transport P p (d a0)).
Set Printing Implicit.
- let G := match goal with |- ?G => constr:G end in
+ let G := match goal with |- ?G => constr:(G) end in
first [ match goal with
| [ |- (@isconnected_elim n (@hfiber A B f (f a))
(@isconnected_hfiber_conn_map n A B f H (f a))
@@ -111,8 +109,7 @@ Module Prim.
: forall b:B, P b.
Proof.
intros b.
- unshelve (refine (pr1 (isconnected_elim _ _))).
- exact b.
+ unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))).
intro x.
exact (transport P x.2 (d x.1)).
Defined.
@@ -124,8 +121,7 @@ Module Prim.
: forall b:B, P b.
Proof.
intros b.
- unshelve (refine (pr1 (isconnected_elim _ _))).
- exact b.
+ unshelve (refine (pr1 (isconnected_elim (A:=hfiber f b) _ _))).
intros [a p].
exact (transport P p (d a)).
Defined.
@@ -142,7 +138,7 @@ Module Prim.
set (fibermap := fun a0p : hfiber f (f a)
=> let (a0, p) := a0p in transport P p (d a0)).
Set Printing Implicit.
- let G := match goal with |- ?G => constr:G end in
+ let G := match goal with |- ?G => constr:(G) end in
first [ match goal with
| [ |- (@isconnected_elim n (@hfiber A B f (f a))
(@isconnected_hfiber_conn_map n A B f H (f a))
diff --git a/test-suite/bugs/opened/3753.v b/test-suite/bugs/closed/3753.v
index 05d77c83..5bfbee94 100644
--- a/test-suite/bugs/opened/3753.v
+++ b/test-suite/bugs/closed/3753.v
@@ -1,4 +1,4 @@
Axiom foo : Type -> Type.
Axiom bar : forall (T : Type), T -> foo T.
Arguments bar A x : rename.
-Fail About bar.
+About bar. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3825.v b/test-suite/bugs/closed/3825.v
new file mode 100644
index 00000000..666c6463
--- /dev/null
+++ b/test-suite/bugs/closed/3825.v
@@ -0,0 +1,24 @@
+Set Universe Polymorphism.
+Set Printing Universes.
+
+Axiom foo@{i j} : Type@{i} -> Type@{j}.
+
+Notation bar := foo.
+
+Monomorphic Universes i j.
+
+Check bar@{i j}.
+Fail Check bar@{i}.
+
+Notation qux := (nat -> nat).
+
+Fail Check qux@{i}.
+
+Axiom TruncType@{i} : nat -> Type@{i}.
+
+Notation "n -Type" := (TruncType n) (at level 1) : type_scope.
+Notation hProp := (0)-Type.
+
+Check hProp.
+Check hProp@{i}.
+
diff --git a/test-suite/bugs/opened/3849.v b/test-suite/bugs/closed/3849.v
index 5290054a..a8dc3af9 100644
--- a/test-suite/bugs/opened/3849.v
+++ b/test-suite/bugs/closed/3849.v
@@ -5,4 +5,4 @@ Tactic Notation "bar" hyp_list(hs) := foo hs.
Goal True.
do 5 pose proof 0 as ?n0.
foo n1 n2.
-Fail bar n3 n4.
+bar n3 n4.
diff --git a/test-suite/bugs/closed/3881.v b/test-suite/bugs/closed/3881.v
index 070d1e9c..a327bbf2 100644
--- a/test-suite/bugs/closed/3881.v
+++ b/test-suite/bugs/closed/3881.v
@@ -23,7 +23,7 @@ Proof.
pose (fun H => @isequiv_homotopic _ _ ((g o f) o f^-1) _ H
(fun b => ap g (eisretr f b))) as k.
revert k.
- let x := match goal with |- let k := ?x in _ => constr:x end in
+ let x := match goal with |- let k := ?x in _ => constr:(x) end in
intro k; clear k;
pose (x _).
pose (@isequiv_homotopic _ _ ((g o f) o f^-1) g _
diff --git a/test-suite/bugs/closed/3886.v b/test-suite/bugs/closed/3886.v
new file mode 100644
index 00000000..2ac4abe5
--- /dev/null
+++ b/test-suite/bugs/closed/3886.v
@@ -0,0 +1,23 @@
+Require Import Program.
+
+Inductive Even : nat -> Prop :=
+| evenO : Even O
+| evenS : forall n, Odd n -> Even (S n)
+with Odd : nat -> Prop :=
+| oddS : forall n, Even n -> Odd (S n).
+
+Program Fixpoint doubleE {n} (e : Even n) : Even (2 * n)
+ := _
+with doubleO {n} (o : Odd n) : Odd (S (2 * n))
+ := _.
+Obligations.
+Axiom cheat : forall {A}, A.
+Obligation 1 of doubleE.
+apply cheat.
+Qed.
+
+Obligation 1 of doubleO.
+apply cheat.
+Qed.
+
+Check doubleE. \ No newline at end of file
diff --git a/test-suite/bugs/closed/3911.v b/test-suite/bugs/closed/3911.v
new file mode 100644
index 00000000..b289eafb
--- /dev/null
+++ b/test-suite/bugs/closed/3911.v
@@ -0,0 +1,26 @@
+(* Tested against coq ee596bc *)
+
+Set Nonrecursive Elimination Schemes.
+Set Primitive Projections.
+Set Universe Polymorphism.
+
+Record setoid := { base : Type }.
+
+Definition catdata (Obj Arr : Type) : Type := nat.
+ (* [nat] can be replaced by any other type, it seems,
+ without changing the error *)
+
+Record cat : Type :=
+ {
+ obj : setoid;
+ arr : Type;
+ dta : catdata (base obj) arr
+ }.
+
+Definition bcwa (C:cat) (B:setoid) :Type := nat.
+ (* As above, nothing special about [nat] here. *)
+
+Record temp {C}{B} (e:bcwa C B) :=
+ { fld : base (obj C) }.
+
+Print temp_rect.
diff --git a/test-suite/bugs/closed/3920.v b/test-suite/bugs/closed/3920.v
new file mode 100644
index 00000000..a4adb23c
--- /dev/null
+++ b/test-suite/bugs/closed/3920.v
@@ -0,0 +1,7 @@
+Require Import Setoid.
+Axiom P : nat -> Prop.
+Axiom P_or : forall x y, P (x + y) <-> P x \/ P y.
+Lemma foo (H : P 3) : False.
+eapply or_introl in H.
+erewrite <- P_or in H.
+(* Error: No such hypothesis: H *)
diff --git a/test-suite/bugs/closed/3922.v b/test-suite/bugs/closed/3922.v
index 5013bc6a..d88e8c33 100644
--- a/test-suite/bugs/closed/3922.v
+++ b/test-suite/bugs/closed/3922.v
@@ -73,7 +73,7 @@ Definition Trunc_ind {n A}
(P : Trunc n A -> Type) {Pt : forall aa, IsTrunc n (P aa)}
: (forall a, P (tr a)) -> (forall aa, P aa)
:= (fun f aa => match aa with tr a => fun _ => f a end Pt).
-Definition merely (A : Type@{i}) : hProp@{i} := BuildhProp (Trunc -1 A).
+Definition merely (A : Type@{i}) : hProp := BuildhProp (Trunc -1 A).
Definition cconst_factors_contr `{Funext} {X Y : Type} (f : X -> Y)
(P : Type) `{Pc : X -> Contr P}
(g : X -> P) (h : P -> Y) (p : h o g == f)
diff --git a/test-suite/bugs/closed/3929.v b/test-suite/bugs/closed/3929.v
new file mode 100644
index 00000000..955581ef
--- /dev/null
+++ b/test-suite/bugs/closed/3929.v
@@ -0,0 +1,67 @@
+Universes i j.
+Set Printing Universes.
+Set Printing All.
+Polymorphic Definition lt@{x y} : Type@{y} := Type@{x}.
+Goal True.
+evar (T:Type@{i}).
+set (Z := nat : Type@{j}). simpl in Z.
+let Tv:=eval cbv [T] in T in
+pose (x:=Tv).
+revert x.
+refine (_ : let x:=Z in True).
+(** This enforces i <= j *)
+Fail pose (lt@{i j}).
+let Zv:=eval cbv [Z] in Z in
+let Tv:=eval cbv [T] in T in
+constr_eq Zv Tv.
+exact I.
+Defined.
+
+Goal True.
+evar (T:nat).
+pose (Z:=0).
+let Tv:=eval cbv [T] in T in
+pose (x:=Tv).
+revert x.
+refine (_ : let x:=Z in True).
+let Zv:=eval cbv [Z] in Z in
+let Tv:=eval cbv [T] in T in
+constr_eq Zv Tv.
+Abort.
+
+Goal True.
+evar (T:Set).
+pose (Z:=nat).
+let Tv:=eval cbv [T] in T in
+pose (x:=Tv).
+revert x.
+refine (_ : let x:=Z in True).
+let Zv:=eval cbv [Z] in Z in
+let Tv:=eval cbv [T] in T in
+constr_eq Zv Tv.
+Abort.
+
+Goal forall (A:Type)(a:A), True.
+intros A a.
+evar (T:A).
+pose (Z:=a).
+let Tv:=eval cbv delta [T] in T in
+pose (x:=Tv).
+revert x.
+refine (_ : let x:=Z in True).
+let Zv:=eval cbv [Z] in Z in
+let Tv:=eval cbv [T] in T in
+constr_eq Zv Tv.
+Abort.
+
+Goal True.
+evar (T:Type).
+pose (Z:=nat).
+let Tv:=eval cbv [T] in T in
+pose (x:=Tv).
+revert x.
+refine (_ : let x:=Z in True).
+let Zv:=eval cbv [Z] in Z in
+let Tv:=eval cbv [T] in T in
+constr_eq Zv Tv.
+Abort.
diff --git a/test-suite/bugs/closed/3957.v b/test-suite/bugs/closed/3957.v
new file mode 100644
index 00000000..e20a6e97
--- /dev/null
+++ b/test-suite/bugs/closed/3957.v
@@ -0,0 +1,6 @@
+Ltac foo tac := tac.
+
+Goal True.
+Proof.
+foo subst.
+Admitted.
diff --git a/test-suite/bugs/closed/4069.v b/test-suite/bugs/closed/4069.v
index 21b03ce5..61527764 100644
--- a/test-suite/bugs/closed/4069.v
+++ b/test-suite/bugs/closed/4069.v
@@ -49,3 +49,56 @@ Lemma bar {A} n m (x : A) :
skipn n (replicate m x) = replicate (m - n) x.
Proof. intros. f_equal.
(* 8.5: one goal, n = m - n *)
+Abort.
+
+Variable F : nat -> Set.
+Variable X : forall n, F (n + 1).
+
+Definition sequator{X Y: Set}{eq:X=Y}(x:X) : Y := eq_rec _ _ x _ eq.
+Definition tequator{X Y}{eq:X=Y}(x:X) : Y := eq_rect _ _ x _ eq.
+Polymorphic Definition pequator{X Y}{eq:X=Y}(x:X) : Y := eq_rect _ _ x _ eq.
+
+Goal {n:nat & F (S n)}.
+eexists.
+unshelve eapply (sequator (X _)).
+f_equal. (*behaves*)
+Undo 2.
+unshelve eapply (pequator (X _)).
+f_equal. (*behaves*)
+Undo 2.
+unshelve eapply (tequator (X _)).
+f_equal. (*behaves now *)
+Focus 2. exact 0.
+simpl.
+reflexivity.
+Defined.
+
+(* Part 2: modulo casts introduced by refine due to reductions in goals *)
+
+Goal {n:nat & F (S n)}.
+eexists.
+(*misbehaves, although same goal as above*)
+Set Printing All.
+unshelve refine (sequator (X _)); revgoals.
+2:exact 0. reflexivity.
+Undo 3.
+unshelve refine (pequator (X _)); revgoals.
+f_equal.
+Undo 2.
+unshelve refine (tequator (X _)); revgoals.
+f_equal.
+Admitted.
+
+Goal @eq Set nat nat.
+congruence.
+Qed.
+
+Goal @eq Type nat nat.
+congruence.
+Qed.
+
+Variable T : Type.
+
+Goal @eq Type T T.
+congruence.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4095.v b/test-suite/bugs/closed/4095.v
new file mode 100644
index 00000000..ffd33d38
--- /dev/null
+++ b/test-suite/bugs/closed/4095.v
@@ -0,0 +1,87 @@
+(* File reduced by coq-bug-finder from original input, then from 5752 lines to 3828 lines, then from 2707 lines to 558 lines, then from 472 lines to 168 lines, then from 110 lines to 101 lines, then from 96 lines to 77 lines, then from 80 lines to 64 lines, then from 92 lines to 79 lines *)
+(* coqc version 8.5beta1 (February 2015) compiled on Feb 23 2015 18:32:3 with OCaml 4.01.0
+ coqtop version cagnode15:/afs/csail.mit.edu/u/j/jgross/coq-8.5,v8.5 (ebfc19d792492417b129063fb511aa423e9d9e08) *)
+Require Import Coq.Setoids.Setoid.
+Generalizable All Variables.
+Axiom admit : forall {T}, T.
+Ltac admit := apply admit.
+Class Equiv (A : Type) := equiv : relation A.
+Class type (A : Type) {e : Equiv A} := eq_equiv : Equivalence equiv.
+Class ILogicOps Frm := { lentails: relation Frm;
+ ltrue: Frm;
+ land: Frm -> Frm -> Frm;
+ lor: Frm -> Frm -> Frm }.
+Infix "|--" := lentails (at level 79, no associativity).
+Class ILogic Frm {ILOps: ILogicOps Frm} := { lentailsPre:> PreOrder lentails }.
+Definition lequiv `{ILogic Frm} P Q := P |-- Q /\ Q |-- P.
+Infix "-|-" := lequiv (at level 85, no associativity).
+Instance lequiv_inverse_lentails `{ILogic Frm} : subrelation lequiv (inverse lentails) := admit.
+Record ILFunFrm (T : Type) `{e : Equiv T} `{ILOps : ILogicOps Frm} := mkILFunFrm { ILFunFrm_pred :> T -> Frm }.
+Section ILogic_Fun.
+ Context (T: Type) `{TType: type T}.
+ Context `{IL: ILogic Frm}.
+ Local Instance ILFun_Ops : ILogicOps (@ILFunFrm T _ Frm _) := admit.
+ Definition ILFun_ILogic : ILogic (@ILFunFrm T _ Frm _) := admit.
+End ILogic_Fun.
+Implicit Arguments ILFunFrm [[ILOps] [e]].
+Instance ILogicOps_Prop : ILogicOps Prop | 2 := {| lentails P Q := (P : Prop) -> Q;
+ ltrue := True;
+ land P Q := P /\ Q;
+ lor P Q := P \/ Q |}.
+Axiom Action : Set.
+Definition Actions := list Action.
+Instance ActionsEquiv : Equiv Actions := { equiv a1 a2 := a1 = a2 }.
+Definition OPred := ILFunFrm Actions Prop.
+Local Existing Instance ILFun_Ops.
+Local Existing Instance ILFun_ILogic.
+Definition catOP (P Q: OPred) : OPred := admit.
+Add Parametric Morphism : catOP with signature lentails ==> lentails ==> lentails as catOP_entails_m.
+admit.
+Defined.
+Definition catOPA (P Q R : OPred) : catOP (catOP P Q) R -|- catOP P (catOP Q R) := admit.
+Class IsPointed (T : Type) := point : T.
+Notation IsPointed_OPred P := (IsPointed (exists x : Actions, (P : OPred) x)).
+Record PointedOPred := mkPointedOPred {
+ OPred_pred :> OPred;
+ OPred_inhabited: IsPointed_OPred OPred_pred
+ }.
+Existing Instance OPred_inhabited.
+Canonical Structure default_PointedOPred O `{IsPointed_OPred O} : PointedOPred
+ := {| OPred_pred := O ; OPred_inhabited := _ |}.
+Instance IsPointed_catOP `{IsPointed_OPred P, IsPointed_OPred Q} : IsPointed_OPred (catOP P Q) := admit.
+Goal forall (T : Type) (O0 : T -> OPred) (O1 : T -> PointedOPred)
+ (tr : T -> T) (O2 : PointedOPred) (x : T)
+ (H : forall x0 : T, catOP (O0 x0) (O1 (tr x0)) |-- O1 x0),
+ exists e1 e2,
+ catOP (O0 e1) (OPred_pred e2) |-- catOP (O1 x) O2.
+ intros; do 2 esplit.
+ rewrite <- catOPA.
+ lazymatch goal with
+ | |- ?R (?f ?a ?b) (?f ?a' ?b') =>
+ let P := constr:(fun H H' => @Morphisms.proper_prf (OPred -> OPred -> OPred)
+ (@Morphisms.respectful OPred (OPred -> OPred)
+ (@lentails OPred
+ (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop))
+ (@lentails OPred
+ (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop) ==>
+ @lentails OPred
+ (@ILFun_Ops Actions ActionsEquiv Prop ILogicOps_Prop))) catOP
+ catOP_entails_m_Proper a a' H b b' H') in
+ pose P;
+ refine (P _ _)
+ end.
+ Undo.
+ Fail lazymatch goal with
+ | |- ?R (?f ?a ?b) (?f ?a' ?b') =>
+ let P := constr:(fun H H' => Morphisms.proper_prf a a' H b b' H') in
+ set(p:=P)
+ end. (* Toplevel input, characters 15-182:
+Error: Cannot infer an instance of type
+"PointedOPred" for the variable p in environment:
+T : Type
+O0 : T -> OPred
+O1 : T -> PointedOPred
+tr : T -> T
+O2 : PointedOPred
+x0 : T
+H : forall x0 : T, catOP (O0 x0) (O1 (tr x0)) |-- O1 x0 *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/4187.v b/test-suite/bugs/closed/4187.v
new file mode 100644
index 00000000..b13ca36a
--- /dev/null
+++ b/test-suite/bugs/closed/4187.v
@@ -0,0 +1,709 @@
+(* Lifted from https://coq.inria.fr/bugs/show_bug.cgi?id=4187 *)
+(* File reduced by coq-bug-finder from original input, then from 715 lines to 696 lines *)
+(* coqc version 8.4pl5 (December 2014) compiled on Dec 28 2014 03:23:16 with OCaml 4.01.0
+ coqtop version 8.4pl5 (December 2014) *)
+Set Asymmetric Patterns.
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Import Coq.Lists.List.
+Require Import Coq.Setoids.Setoid.
+Require Import Coq.Numbers.Natural.Peano.NPeano.
+Global Set Implicit Arguments.
+Global Generalizable All Variables.
+Coercion is_true : bool >-> Sortclass.
+Coercion bool_of_sumbool {A B} (x : {A} + {B}) : bool := if x then true else false.
+Fixpoint ForallT {T} (P : T -> Type) (ls : list T) : Type
+ := match ls return Type with
+ | nil => True
+ | x::xs => (P x * ForallT P xs)%type
+ end.
+Fixpoint Forall_tails {T} (P : list T -> Type) (ls : list T) : Type
+ := match ls with
+ | nil => P nil
+ | x::xs => (P (x::xs) * Forall_tails P xs)%type
+ end.
+
+Module Export ADTSynthesis_DOT_Common_DOT_Wf.
+Module Export ADTSynthesis.
+Module Export Common.
+Module Export Wf.
+
+Section wf.
+ Section wf_prod.
+ Context A B (RA : relation A) (RB : relation B).
+Definition prod_relation : relation (A * B).
+exact (fun ab a'b' =>
+ RA (fst ab) (fst a'b') \/ (fst a'b' = fst ab /\ RB (snd ab) (snd a'b'))).
+Defined.
+
+ Fixpoint well_founded_prod_relation_helper
+ a b
+ (wf_A : Acc RA a) (wf_B : well_founded RB) {struct wf_A}
+ : Acc prod_relation (a, b)
+ := match wf_A with
+ | Acc_intro fa => (fix wf_B_rec b' (wf_B' : Acc RB b') : Acc prod_relation (a, b')
+ := Acc_intro
+ _
+ (fun ab =>
+ match ab as ab return prod_relation ab (a, b') -> Acc prod_relation ab with
+ | (a'', b'') =>
+ fun pf =>
+ match pf with
+ | or_introl pf'
+ => @well_founded_prod_relation_helper
+ _ _
+ (fa _ pf')
+ wf_B
+ | or_intror (conj pfa pfb)
+ => match wf_B' with
+ | Acc_intro fb
+ => eq_rect
+ _
+ (fun a'' => Acc prod_relation (a'', b''))
+ (wf_B_rec _ (fb _ pfb))
+ _
+ pfa
+ end
+ end
+ end)
+ ) b (wf_B b)
+ end.
+
+ Definition well_founded_prod_relation : well_founded RA -> well_founded RB -> well_founded prod_relation.
+ Proof.
+ intros wf_A wf_B [a b]; hnf in *.
+ apply well_founded_prod_relation_helper; auto.
+ Defined.
+ End wf_prod.
+
+ Section wf_projT1.
+ Context A (B : A -> Type) (R : relation A).
+Definition projT1_relation : relation (sigT B).
+exact (fun ab a'b' =>
+ R (projT1 ab) (projT1 a'b')).
+Defined.
+
+ Definition well_founded_projT1_relation : well_founded R -> well_founded projT1_relation.
+ Proof.
+ intros wf [a b]; hnf in *.
+ induction (wf a) as [a H IH].
+ constructor.
+ intros y r.
+ specialize (IH _ r (projT2 y)).
+ destruct y.
+ exact IH.
+ Defined.
+ End wf_projT1.
+End wf.
+
+Section Fix3.
+ Context A (B : A -> Type) (C : forall a, B a -> Type) (D : forall a b, C a b -> Type)
+ (R : A -> A -> Prop) (Rwf : well_founded R)
+ (P : forall a b c, D a b c -> Type)
+ (F : forall x : A, (forall y : A, R y x -> forall b c d, P y b c d) -> forall b c d, P x b c d).
+Definition Fix3 a b c d : @P a b c d.
+exact (@Fix { a : A & { b : B a & { c : C b & D c } } }
+ (fun x y => R (projT1 x) (projT1 y))
+ (well_founded_projT1_relation Rwf)
+ (fun abcd => P (projT2 (projT2 (projT2 abcd))))
+ (fun x f => @F (projT1 x) (fun y r b c d => f (existT _ y (existT _ b (existT _ c d))) r) _ _ _)
+ (existT _ a (existT _ b (existT _ c d)))).
+Defined.
+End Fix3.
+
+End Wf.
+
+End Common.
+
+End ADTSynthesis.
+
+End ADTSynthesis_DOT_Common_DOT_Wf.
+
+Module Export ADTSynthesis_DOT_Parsers_DOT_StringLike_DOT_Core.
+Module Export ADTSynthesis.
+Module Export Parsers.
+Module Export StringLike.
+Module Export Core.
+Import Coq.Setoids.Setoid.
+Import Coq.Classes.Morphisms.
+
+
+
+Module Export StringLike.
+ Class StringLike {Char : Type} :=
+ {
+ String :> Type;
+ is_char : String -> Char -> bool;
+ length : String -> nat;
+ take : nat -> String -> String;
+ drop : nat -> String -> String;
+ bool_eq : String -> String -> bool;
+ beq : relation String := fun x y => bool_eq x y
+ }.
+
+ Arguments StringLike : clear implicits.
+ Infix "=s" := (@beq _ _) (at level 70, no associativity) : type_scope.
+ Notation "s ~= [ ch ]" := (is_char s ch) (at level 70, no associativity) : string_like_scope.
+ Local Open Scope string_like_scope.
+
+ Definition str_le `{StringLike Char} (s1 s2 : String)
+ := length s1 < length s2 \/ s1 =s s2.
+ Infix "≤s" := str_le (at level 70, right associativity).
+
+ Class StringLikeProperties (Char : Type) `{StringLike Char} :=
+ {
+ singleton_unique : forall s ch ch', s ~= [ ch ] -> s ~= [ ch' ] -> ch = ch';
+ length_singleton : forall s ch, s ~= [ ch ] -> length s = 1;
+ bool_eq_char : forall s s' ch, s ~= [ ch ] -> s' ~= [ ch ] -> s =s s';
+ is_char_Proper :> Proper (beq ==> eq ==> eq) is_char;
+ length_Proper :> Proper (beq ==> eq) length;
+ take_Proper :> Proper (eq ==> beq ==> beq) take;
+ drop_Proper :> Proper (eq ==> beq ==> beq) drop;
+ bool_eq_Equivalence :> Equivalence beq;
+ bool_eq_empty : forall str str', length str = 0 -> length str' = 0 -> str =s str';
+ take_short_length : forall str n, n <= length str -> length (take n str) = n;
+ take_long : forall str n, length str <= n -> take n str =s str;
+ take_take : forall str n m, take n (take m str) =s take (min n m) str;
+ drop_length : forall str n, length (drop n str) = length str - n;
+ drop_0 : forall str, drop 0 str =s str;
+ drop_drop : forall str n m, drop n (drop m str) =s drop (n + m) str;
+ drop_take : forall str n m, drop n (take m str) =s take (m - n) (drop n str);
+ take_drop : forall str n m, take n (drop m str) =s drop m (take (n + m) str)
+ }.
+
+ Arguments StringLikeProperties Char {_}.
+End StringLike.
+
+End Core.
+
+End StringLike.
+
+End Parsers.
+
+End ADTSynthesis.
+
+End ADTSynthesis_DOT_Parsers_DOT_StringLike_DOT_Core.
+
+Module Export ADTSynthesis.
+Module Export Parsers.
+Module Export ContextFreeGrammar.
+Require Import Coq.Strings.String.
+Require Import Coq.Lists.List.
+Export ADTSynthesis.Parsers.StringLike.Core.
+Import ADTSynthesis.Common.
+
+Local Open Scope string_like_scope.
+
+Section cfg.
+ Context {Char : Type}.
+
+ Section definitions.
+
+ Inductive item :=
+ | Terminal (_ : Char)
+ | NonTerminal (_ : string).
+
+ Definition production := list item.
+ Definition productions := list production.
+
+ Record grammar :=
+ {
+ Start_symbol :> string;
+ Lookup :> string -> productions;
+ Start_productions :> productions := Lookup Start_symbol;
+ Valid_nonterminals : list string;
+ Valid_productions : list productions := map Lookup Valid_nonterminals
+ }.
+ End definitions.
+
+ Section parse.
+ Context {HSL : StringLike Char}.
+ Variable G : grammar.
+
+ Inductive parse_of (str : String) : productions -> Type :=
+ | ParseHead : forall pat pats, parse_of_production str pat
+ -> parse_of str (pat::pats)
+ | ParseTail : forall pat pats, parse_of str pats
+ -> parse_of str (pat::pats)
+ with parse_of_production (str : String) : production -> Type :=
+ | ParseProductionNil : length str = 0 -> parse_of_production str nil
+ | ParseProductionCons : forall n pat pats,
+ parse_of_item (take n str) pat
+ -> parse_of_production (drop n str) pats
+ -> parse_of_production str (pat::pats)
+ with parse_of_item (str : String) : item -> Type :=
+ | ParseTerminal : forall ch, str ~= [ ch ] -> parse_of_item str (Terminal ch)
+ | ParseNonTerminal : forall nt, parse_of str (Lookup G nt)
+ -> parse_of_item str (NonTerminal nt).
+ End parse.
+End cfg.
+
+Arguments item _ : clear implicits.
+Arguments production _ : clear implicits.
+Arguments productions _ : clear implicits.
+Arguments grammar _ : clear implicits.
+
+End ContextFreeGrammar.
+
+Module Export BaseTypes.
+
+Section recursive_descent_parser.
+
+ Class parser_computational_predataT :=
+ { nonterminals_listT : Type;
+ initial_nonterminals_data : nonterminals_listT;
+ is_valid_nonterminal : nonterminals_listT -> String.string -> bool;
+ remove_nonterminal : nonterminals_listT -> String.string -> nonterminals_listT;
+ nonterminals_listT_R : nonterminals_listT -> nonterminals_listT -> Prop;
+ remove_nonterminal_dec : forall ls nonterminal,
+ is_valid_nonterminal ls nonterminal
+ -> nonterminals_listT_R (remove_nonterminal ls nonterminal) ls;
+ ntl_wf : well_founded nonterminals_listT_R }.
+
+ Class parser_removal_dataT' `{predata : parser_computational_predataT} :=
+ { remove_nonterminal_1
+ : forall ls ps ps',
+ is_valid_nonterminal (remove_nonterminal ls ps) ps'
+ -> is_valid_nonterminal ls ps';
+ remove_nonterminal_2
+ : forall ls ps ps',
+ is_valid_nonterminal (remove_nonterminal ls ps) ps' = false
+ <-> is_valid_nonterminal ls ps' = false \/ ps = ps' }.
+End recursive_descent_parser.
+
+End BaseTypes.
+Import Coq.Lists.List.
+Import ADTSynthesis.Parsers.ContextFreeGrammar.
+
+Local Open Scope string_like_scope.
+
+Section cfg.
+ Context {Char} {HSL : StringLike Char} {G : grammar Char}.
+ Context {predata : @parser_computational_predataT}
+ {rdata' : @parser_removal_dataT' predata}.
+
+ Inductive minimal_parse_of
+ : forall (str0 : String) (valid : nonterminals_listT)
+ (str : String),
+ productions Char -> Type :=
+ | MinParseHead : forall str0 valid str pat pats,
+ @minimal_parse_of_production str0 valid str pat
+ -> @minimal_parse_of str0 valid str (pat::pats)
+ | MinParseTail : forall str0 valid str pat pats,
+ @minimal_parse_of str0 valid str pats
+ -> @minimal_parse_of str0 valid str (pat::pats)
+ with minimal_parse_of_production
+ : forall (str0 : String) (valid : nonterminals_listT)
+ (str : String),
+ production Char -> Type :=
+ | MinParseProductionNil : forall str0 valid str,
+ length str = 0
+ -> @minimal_parse_of_production str0 valid str nil
+ | MinParseProductionCons : forall str0 valid str n pat pats,
+ str ≤s str0
+ -> @minimal_parse_of_item str0 valid (take n str) pat
+ -> @minimal_parse_of_production str0 valid (drop n str) pats
+ -> @minimal_parse_of_production str0 valid str (pat::pats)
+ with minimal_parse_of_item
+ : forall (str0 : String) (valid : nonterminals_listT)
+ (str : String),
+ item Char -> Type :=
+ | MinParseTerminal : forall str0 valid str ch,
+ str ~= [ ch ]
+ -> @minimal_parse_of_item str0 valid str (Terminal ch)
+ | MinParseNonTerminal
+ : forall str0 valid str (nt : String.string),
+ @minimal_parse_of_nonterminal str0 valid str nt
+ -> @minimal_parse_of_item str0 valid str (NonTerminal nt)
+ with minimal_parse_of_nonterminal
+ : forall (str0 : String) (valid : nonterminals_listT)
+ (str : String),
+ String.string -> Type :=
+ | MinParseNonTerminalStrLt
+ : forall str0 valid (nt : String.string) str,
+ length str < length str0
+ -> is_valid_nonterminal initial_nonterminals_data nt
+ -> @minimal_parse_of str initial_nonterminals_data str (Lookup G nt)
+ -> @minimal_parse_of_nonterminal str0 valid str nt
+ | MinParseNonTerminalStrEq
+ : forall str0 str valid nonterminal,
+ str =s str0
+ -> is_valid_nonterminal initial_nonterminals_data nonterminal
+ -> is_valid_nonterminal valid nonterminal
+ -> @minimal_parse_of str0 (remove_nonterminal valid nonterminal) str (Lookup G nonterminal)
+ -> @minimal_parse_of_nonterminal str0 valid str nonterminal.
+End cfg.
+Import ADTSynthesis.Common.
+
+Section general.
+ Context {Char} {HSL : StringLike Char} {G : grammar Char}.
+
+ Class boolean_parser_dataT :=
+ { predata :> parser_computational_predataT;
+ split_string_for_production
+ : item Char -> production Char -> String -> list nat }.
+
+ Global Coercion predata : boolean_parser_dataT >-> parser_computational_predataT.
+
+ Definition split_list_completeT `{data : @parser_computational_predataT}
+ {str0 valid}
+ (it : item Char) (its : production Char)
+ (str : String)
+ (pf : str ≤s str0)
+ (split_list : list nat)
+
+ := ({ n : nat
+ & (minimal_parse_of_item (G := G) (predata := data) str0 valid (take n str) it)
+ * (minimal_parse_of_production (G := G) str0 valid (drop n str) its) }%type)
+ -> ({ n : nat
+ & (In n split_list)
+ * (minimal_parse_of_item (G := G) str0 valid (take n str) it)
+ * (minimal_parse_of_production (G := G) str0 valid (drop n str) its) }%type).
+
+ Class boolean_parser_completeness_dataT' `{data : boolean_parser_dataT} :=
+ { split_string_for_production_complete
+ : forall str0 valid str (pf : str ≤s str0) nt,
+ is_valid_nonterminal initial_nonterminals_data nt
+ -> ForallT
+ (Forall_tails
+ (fun prod
+ => match prod return Type with
+ | nil => True
+ | it::its
+ => @split_list_completeT data str0 valid it its str pf (split_string_for_production it its str)
+ end))
+ (Lookup G nt) }.
+End general.
+
+Module Export BooleanRecognizer.
+Import Coq.Numbers.Natural.Peano.NPeano.
+Import Coq.Arith.Compare_dec.
+Import Coq.Arith.Wf_nat.
+
+Section recursive_descent_parser.
+ Context {Char} {HSL : StringLike Char} {HSLP : StringLikeProperties Char} {G : grammar Char}.
+ Context {data : @boolean_parser_dataT Char _}.
+
+ Section bool.
+ Section parts.
+Definition parse_item
+ (str_matches_nonterminal : String.string -> bool)
+ (str : String)
+ (it : item Char)
+ : bool.
+Admitted.
+
+ Section production.
+ Context {str0}
+ (parse_nonterminal
+ : forall (str : String),
+ str ≤s str0
+ -> String.string
+ -> bool).
+
+ Fixpoint parse_production
+ (str : String)
+ (pf : str ≤s str0)
+ (prod : production Char)
+ : bool.
+ Proof.
+ refine
+ match prod with
+ | nil =>
+
+ Nat.eq_dec (length str) 0
+ | it::its
+ => let parse_production' := fun str pf => parse_production str pf its in
+ fold_right
+ orb
+ false
+ (map (fun n =>
+ (parse_item
+ (parse_nonterminal (str := take n str) _)
+ (take n str)
+ it)
+ && parse_production' (drop n str) _)%bool
+ (split_string_for_production it its str))
+ end;
+ revert pf; clear -HSLP; intros; admit.
+ Defined.
+ End production.
+
+ Section productions.
+ Context {str0}
+ (parse_nonterminal
+ : forall (str : String)
+ (pf : str ≤s str0),
+ String.string -> bool).
+Definition parse_productions
+ (str : String)
+ (pf : str ≤s str0)
+ (prods : productions Char)
+ : bool.
+exact (fold_right orb
+ false
+ (map (parse_production parse_nonterminal pf)
+ prods)).
+Defined.
+ End productions.
+
+ Section nonterminals.
+ Section step.
+ Context {str0 valid}
+ (parse_nonterminal
+ : forall (p : String * nonterminals_listT),
+ prod_relation (ltof _ length) nonterminals_listT_R p (str0, valid)
+ -> forall str : String,
+ str ≤s fst p -> String.string -> bool).
+
+ Definition parse_nonterminal_step
+ (str : String)
+ (pf : str ≤s str0)
+ (nt : String.string)
+ : bool.
+ Proof.
+ refine
+ (if lt_dec (length str) (length str0)
+ then
+ parse_productions
+ (@parse_nonterminal
+ (str : String, initial_nonterminals_data)
+ (or_introl _))
+ (or_intror (reflexivity _))
+ (Lookup G nt)
+ else
+ if Sumbool.sumbool_of_bool (is_valid_nonterminal valid nt)
+ then
+ parse_productions
+ (@parse_nonterminal
+ (str0 : String, remove_nonterminal valid nt)
+ (or_intror (conj eq_refl (remove_nonterminal_dec _ nt _))))
+ (str := str)
+ _
+ (Lookup G nt)
+ else
+ false);
+ assumption.
+ Defined.
+ End step.
+
+ Section wf.
+Definition parse_nonterminal_or_abort
+ : forall (p : String * nonterminals_listT)
+ (str : String),
+ str ≤s fst p
+ -> String.string
+ -> bool.
+exact (Fix3
+ _ _ _
+ (well_founded_prod_relation
+ (well_founded_ltof _ length)
+ ntl_wf)
+ _
+ (fun sl => @parse_nonterminal_step (fst sl) (snd sl))).
+Defined.
+Definition parse_nonterminal
+ (str : String)
+ (nt : String.string)
+ : bool.
+exact (@parse_nonterminal_or_abort
+ (str : String, initial_nonterminals_data) str
+ (or_intror (reflexivity _)) nt).
+Defined.
+ End wf.
+ End nonterminals.
+ End parts.
+ End bool.
+End recursive_descent_parser.
+
+Section cfg.
+ Context {Char} {HSL : StringLike Char} {HSLP : @StringLikeProperties Char HSL} (G : grammar Char).
+
+ Section definitions.
+ Context (P : String -> String.string -> Type).
+
+ Definition Forall_parse_of_item'
+ (Forall_parse_of : forall {str pats} (p : parse_of G str pats), Type)
+ {str it} (p : parse_of_item G str it)
+ := match p return Type with
+ | ParseTerminal ch pf => unit
+ | ParseNonTerminal nt p'
+ => (P str nt * Forall_parse_of p')%type
+ end.
+
+ Fixpoint Forall_parse_of {str pats} (p : parse_of G str pats)
+ := match p with
+ | ParseHead pat pats p'
+ => Forall_parse_of_production p'
+ | ParseTail _ _ p'
+ => Forall_parse_of p'
+ end
+ with Forall_parse_of_production {str pat} (p : parse_of_production G str pat)
+ := match p return Type with
+ | ParseProductionNil pf => unit
+ | ParseProductionCons pat strs pats p' p''
+ => (Forall_parse_of_item' (@Forall_parse_of) p' * Forall_parse_of_production p'')%type
+ end.
+
+ Definition Forall_parse_of_item {str it} (p : parse_of_item G str it)
+ := @Forall_parse_of_item' (@Forall_parse_of) str it p.
+ End definitions.
+
+ End cfg.
+
+Section recursive_descent_parser_list.
+ Context {Char} {HSL : StringLike Char} {HLSP : StringLikeProperties Char} {G : grammar Char}.
+Definition rdp_list_nonterminals_listT : Type.
+exact (list String.string).
+Defined.
+Definition rdp_list_is_valid_nonterminal : rdp_list_nonterminals_listT -> String.string -> bool.
+admit.
+Defined.
+Definition rdp_list_remove_nonterminal : rdp_list_nonterminals_listT -> String.string -> rdp_list_nonterminals_listT.
+admit.
+Defined.
+Definition rdp_list_nonterminals_listT_R : rdp_list_nonterminals_listT -> rdp_list_nonterminals_listT -> Prop.
+exact (ltof _ (@List.length _)).
+Defined.
+ Lemma rdp_list_remove_nonterminal_dec : forall ls prods,
+ @rdp_list_is_valid_nonterminal ls prods = true
+ -> @rdp_list_nonterminals_listT_R (@rdp_list_remove_nonterminal ls prods) ls.
+admit.
+Defined.
+ Lemma rdp_list_ntl_wf : well_founded rdp_list_nonterminals_listT_R.
+ Proof.
+ unfold rdp_list_nonterminals_listT_R.
+ intro.
+ apply well_founded_ltof.
+ Defined.
+
+ Global Instance rdp_list_predata : parser_computational_predataT
+ := { nonterminals_listT := rdp_list_nonterminals_listT;
+ initial_nonterminals_data := Valid_nonterminals G;
+ is_valid_nonterminal := rdp_list_is_valid_nonterminal;
+ remove_nonterminal := rdp_list_remove_nonterminal;
+ nonterminals_listT_R := rdp_list_nonterminals_listT_R;
+ remove_nonterminal_dec := rdp_list_remove_nonterminal_dec;
+ ntl_wf := rdp_list_ntl_wf }.
+End recursive_descent_parser_list.
+
+Section sound.
+ Section general.
+ Context {Char} {HSL : StringLike Char} {HSLP : StringLikeProperties Char} (G : grammar Char).
+ Context {data : @boolean_parser_dataT Char _}
+ {cdata : @boolean_parser_completeness_dataT' Char _ G data}
+ {rdata : @parser_removal_dataT' predata}.
+
+ Section parts.
+
+ Section nonterminals.
+ Section wf.
+
+ Lemma parse_nonterminal_sound
+ (str : String) (nonterminal : String.string)
+ : parse_nonterminal (G := G) str nonterminal
+ = true
+ -> parse_of_item G str (NonTerminal nonterminal).
+admit.
+Defined.
+ End wf.
+ End nonterminals.
+ End parts.
+ End general.
+End sound.
+
+Import Coq.Strings.String.
+Import ADTSynthesis.Parsers.ContextFreeGrammar.
+
+Fixpoint list_to_productions {T} (default : T) (ls : list (string * T)) : string -> T
+ := match ls with
+ | nil => fun _ => default
+ | (str, t)::ls' => fun s => if string_dec str s
+ then t
+ else list_to_productions default ls' s
+ end.
+
+Fixpoint list_to_grammar {T} (default : productions T) (ls : list (string * productions T)) : grammar T
+ := {| Start_symbol := hd ""%string (map (@fst _ _) ls);
+ Lookup := list_to_productions default ls;
+ Valid_nonterminals := map (@fst _ _) ls |}.
+
+Section interface.
+ Context {Char} (G : grammar Char).
+Definition production_is_reachable (p : production Char) : Prop.
+admit.
+Defined.
+Definition split_list_is_complete `{HSL : StringLike Char} (str : String) (it : item Char) (its : production Char)
+ (splits : list nat)
+ : Prop.
+exact (forall n,
+ n <= length str
+ -> parse_of_item G (take n str) it
+ -> parse_of_production G (drop n str) its
+ -> production_is_reachable (it::its)
+ -> List.In n splits).
+Defined.
+
+ Record Splitter :=
+ {
+ string_type :> StringLike Char;
+ splits_for : String -> item Char -> production Char -> list nat;
+
+ string_type_properties :> StringLikeProperties Char;
+ splits_for_complete : forall str it its,
+ split_list_is_complete str it its (splits_for str it its)
+
+ }.
+ Global Existing Instance string_type_properties.
+
+ Record Parser (HSL : StringLike Char) :=
+ {
+ has_parse : @String Char HSL -> bool;
+
+ has_parse_sound : forall str,
+ has_parse str = true
+ -> parse_of_item G str (NonTerminal (Start_symbol G));
+
+ has_parse_complete : forall str (p : parse_of_item G str (NonTerminal (Start_symbol G))),
+ Forall_parse_of_item
+ (fun _ nt => List.In nt (Valid_nonterminals G))
+ p
+ -> has_parse str = true
+ }.
+End interface.
+
+Module Export ParserImplementation.
+
+Section implementation.
+ Context {Char} {G : grammar Char}.
+ Context (splitter : Splitter G).
+
+ Local Instance parser_data : @boolean_parser_dataT Char _ :=
+ { predata := rdp_list_predata (G := G);
+ split_string_for_production it its str
+ := splits_for splitter str it its }.
+
+ Program Definition parser : Parser G splitter
+ := {| has_parse str := parse_nonterminal (G := G) (data := parser_data) str (Start_symbol G);
+ has_parse_sound str Hparse := parse_nonterminal_sound G _ _ Hparse;
+ has_parse_complete str p Hp := _ |}.
+ Next Obligation.
+admit.
+Defined.
+End implementation.
+
+End ParserImplementation.
+
+Section implementation.
+ Context {Char} {ls : list (String.string * productions Char)}.
+ Local Notation G := (list_to_grammar (nil::nil) ls) (only parsing).
+ Context (splitter : Splitter G).
+
+ Local Instance parser_data : @boolean_parser_dataT Char _ := parser_data splitter.
+
+ Goal forall str : @String Char splitter,
+ let G' :=
+ @BooleanRecognizer.parse_nonterminal Char splitter splitter G parser_data str G = true in
+ G'.
+ intros str G'.
+ Timeout 1 assert (pf' : G' -> Prop) by abstract admit.
diff --git a/test-suite/bugs/closed/4198.v b/test-suite/bugs/closed/4198.v
index f85a6026..eb37141b 100644
--- a/test-suite/bugs/closed/4198.v
+++ b/test-suite/bugs/closed/4198.v
@@ -11,7 +11,7 @@ Goal forall A (x x' : A) (xs xs' : list A) (H : x::xs = x'::xs'),
simpl.
intros.
match goal with
- | [ |- appcontext G[@hd] ] => idtac
+ | [ |- context G[@hd] ] => idtac
end.
(* This second example comes from CFGV where inspecting subterms of a
diff --git a/test-suite/bugs/opened/4214.v b/test-suite/bugs/closed/4214.v
index 3daf4521..d684e8cf 100644
--- a/test-suite/bugs/opened/4214.v
+++ b/test-suite/bugs/closed/4214.v
@@ -2,4 +2,5 @@
Goal forall A (a b c : A), b = a -> b = c -> a = c.
intros.
subst.
-Fail reflexivity.
+reflexivity.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4292.v b/test-suite/bugs/closed/4292.v
new file mode 100644
index 00000000..403e155e
--- /dev/null
+++ b/test-suite/bugs/closed/4292.v
@@ -0,0 +1,7 @@
+Module Type S. End S.
+
+Declare Module M : S.
+
+Module Type F (T: S). End F.
+
+Fail Module Type N := F with Module T := M.
diff --git a/test-suite/bugs/closed/4375.v b/test-suite/bugs/closed/4375.v
index 03af1653..71e3a751 100644
--- a/test-suite/bugs/closed/4375.v
+++ b/test-suite/bugs/closed/4375.v
@@ -93,14 +93,15 @@ Polymorphic CoInductive foo@{i} (T : Type@{i}) : Type@{i} :=
| A : foo T -> foo T.
Polymorphic CoFixpoint cg@{i} (t : Type@{i}) : foo@{i} t :=
- @A@{i} t (cg@{i} t).
+ @A@{i} t (cg t).
Print cg.
Polymorphic CoFixpoint ca@{i} (t : Type@{i}) : foo@{i} t :=
- @A@{i} t (@cb@{i} t)
+ @A@{i} t (cb t)
with cb@{i} (t : Type@{i}) : foo@{i} t :=
- @A@{i} t (@ca@{i} t).
+ @A@{i} t (ca t).
Print ca.
-Print cb. \ No newline at end of file
+Print cb.
+ \ No newline at end of file
diff --git a/test-suite/bugs/closed/4378.v b/test-suite/bugs/closed/4378.v
new file mode 100644
index 00000000..9d591655
--- /dev/null
+++ b/test-suite/bugs/closed/4378.v
@@ -0,0 +1,9 @@
+Tactic Notation "epose" open_constr(a) :=
+ let a' := fresh in
+ pose a as a'.
+Tactic Notation "epose2" open_constr(a) tactic3(tac) :=
+ let a' := fresh in
+ pose a as a'.
+Goal True.
+ epose _. Undo.
+ epose2 _ idtac.
diff --git a/test-suite/bugs/closed/4416.v b/test-suite/bugs/closed/4416.v
new file mode 100644
index 00000000..3189685e
--- /dev/null
+++ b/test-suite/bugs/closed/4416.v
@@ -0,0 +1,4 @@
+Goal exists x, x.
+Unset Solve Unification Constraints.
+unshelve refine (ex_intro _ _ _); match goal with _ => refine (_ _) end.
+(* Error: Incorrect number of goals (expected 2 tactics). *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/4450.v b/test-suite/bugs/closed/4450.v
new file mode 100644
index 00000000..ecebaba8
--- /dev/null
+++ b/test-suite/bugs/closed/4450.v
@@ -0,0 +1,58 @@
+Polymorphic Axiom inhabited@{u} : Type@{u} -> Prop.
+
+Polymorphic Axiom unit@{u} : Type@{u}.
+Polymorphic Axiom tt@{u} : inhabited unit@{u}.
+
+Polymorphic Hint Resolve tt : the_lemmas.
+Set Printing All.
+Set Printing Universes.
+Goal inhabited unit.
+Proof.
+ eauto with the_lemmas.
+Qed.
+
+Universe u.
+Axiom f : Type@{u} -> Prop.
+Lemma fapp (X : Type) : f X -> False.
+Admitted.
+Polymorphic Axiom funi@{i} : f unit@{i}.
+
+Goal (forall U, f U) -> (*(f unit -> False) -> *)False /\ False.
+ eauto using (fapp unit funi). (* The two fapp's have different universes *)
+Qed.
+
+Hint Resolve (fapp unit funi) : mylems.
+
+Goal (forall U, f U) -> (*(f unit -> False) -> *)False /\ False.
+ eauto with mylems. (* Forces the two fapps at the same level *)
+Qed.
+
+Goal (forall U, f U) -> (f unit -> False) -> False /\ False.
+ eauto. (* Forces the two fapps at the same level *)
+Qed.
+
+Polymorphic Definition MyType@{i} := Type@{i}.
+Universes l m n.
+Constraint l < m.
+Polymorphic Axiom maketype@{i} : MyType@{i}.
+
+Goal MyType@{l}.
+Proof.
+ Fail solve [ eauto using maketype@{m} ].
+ eauto using maketype.
+ Undo.
+ eauto using maketype@{n}.
+Qed.
+
+Axiom foo : forall (A : Type), list A.
+Polymorphic Axiom foop@{i} : forall (A : Type@{i}), list A.
+
+Universe x y.
+Goal list Type@{x}.
+Proof.
+ eauto using (foo Type). (* Refreshes the term *)
+ Undo.
+ eauto using foo. Show Universes.
+ Undo.
+ eauto using foop. Show Proof. Show Universes.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4464.v b/test-suite/bugs/closed/4464.v
new file mode 100644
index 00000000..f8e9405d
--- /dev/null
+++ b/test-suite/bugs/closed/4464.v
@@ -0,0 +1,4 @@
+Goal True -> True.
+Proof.
+ intro H'.
+ let H := H' in destruct H; try destruct H.
diff --git a/test-suite/bugs/closed/4471.v b/test-suite/bugs/closed/4471.v
new file mode 100644
index 00000000..36efc42d
--- /dev/null
+++ b/test-suite/bugs/closed/4471.v
@@ -0,0 +1,6 @@
+Goal forall (A B : Type) (P : forall _ : prod A B, Type) (a : A) (b : B) (p p0 : forall (x : A) (x' : B), P (@pair A B x x')),
+ @eq (P (@pair A B a b)) (p (@fst A B (@pair A B a b)) (@snd A B (@pair A B a b)))
+ (p0 (@fst A B (@pair A B a b)) (@snd A B (@pair A B a b))).
+Proof.
+ intros.
+ Fail generalize dependent (a, b).
diff --git a/test-suite/bugs/closed/4479.v b/test-suite/bugs/closed/4479.v
new file mode 100644
index 00000000..921579d1
--- /dev/null
+++ b/test-suite/bugs/closed/4479.v
@@ -0,0 +1,3 @@
+Goal True.
+Fail autorewrite with foo.
+try autorewrite with foo.
diff --git a/test-suite/bugs/closed/4495.v b/test-suite/bugs/closed/4495.v
new file mode 100644
index 00000000..8b032db5
--- /dev/null
+++ b/test-suite/bugs/closed/4495.v
@@ -0,0 +1 @@
+Fail Notation "'forall' x .. y ',' P " := (forall x, .. (forall y, P) ..) (at level 200, x binder, y binder).
diff --git a/test-suite/bugs/closed/4498.v b/test-suite/bugs/closed/4498.v
new file mode 100644
index 00000000..ccdb2ddd
--- /dev/null
+++ b/test-suite/bugs/closed/4498.v
@@ -0,0 +1,24 @@
+Require Export Coq.Unicode.Utf8.
+Require Export Coq.Classes.Morphisms.
+Require Export Coq.Relations.Relation_Definitions.
+
+Set Universe Polymorphism.
+
+Reserved Notation "a ~> b" (at level 90, right associativity).
+
+Class Category := {
+ ob : Type;
+ uhom := Type : Type;
+ hom : ob → ob → uhom where "a ~> b" := (hom a b);
+ compose : ∀ {A B C}, (B ~> C) → (A ~> B) → (A ~> C);
+ equiv : ∀ {A B}, relation (A ~> B);
+ is_equiv : ∀ {A B}, @Equivalence (A ~> B) equiv;
+ comp_respects : ∀ {A B C},
+ Proper (@equiv B C ==> @equiv A B ==> @equiv A C) (@compose A B C);
+}.
+
+Require Export Coq.Setoids.Setoid.
+
+Add Parametric Morphism `{C : Category} {A B C} : (@compose _ A B C) with
+ signature equiv ==> equiv ==> equiv as compose_mor.
+Proof. apply comp_respects. Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4503.v b/test-suite/bugs/closed/4503.v
new file mode 100644
index 00000000..f54d6433
--- /dev/null
+++ b/test-suite/bugs/closed/4503.v
@@ -0,0 +1,37 @@
+Require Coq.Classes.RelationClasses.
+
+Class PreOrder (A : Type) (r : A -> A -> Type) : Type :=
+{ refl : forall x, r x x }.
+
+(* FAILURE 1 *)
+
+Section foo.
+ Polymorphic Universes A.
+ Polymorphic Context {A : Type@{A}} {rA : A -> A -> Prop} {PO : PreOrder A rA}.
+
+ Fail Definition foo := PO.
+End foo.
+
+
+Module ILogic.
+
+Set Universe Polymorphism.
+
+(* Logical connectives *)
+Class ILogic@{L} (A : Type@{L}) : Type := mkILogic
+{
+ lentails: A -> A -> Prop;
+ lentailsPre:> RelationClasses.PreOrder lentails
+}.
+
+
+End ILogic.
+
+Set Printing Universes.
+
+(* There is stil a problem if the class is universe polymorphic *)
+Section Embed_ILogic_Pre.
+ Polymorphic Universes A T.
+ Fail Context {A : Type@{A}} {ILA: ILogic.ILogic@{A} A}.
+
+End Embed_ILogic_Pre. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4511.v b/test-suite/bugs/closed/4511.v
new file mode 100644
index 00000000..0cdb3aee
--- /dev/null
+++ b/test-suite/bugs/closed/4511.v
@@ -0,0 +1,3 @@
+Goal True.
+Fail evar I.
+
diff --git a/test-suite/bugs/closed/4519.v b/test-suite/bugs/closed/4519.v
new file mode 100644
index 00000000..ccbc47d2
--- /dev/null
+++ b/test-suite/bugs/closed/4519.v
@@ -0,0 +1,21 @@
+Set Universe Polymorphism.
+Section foo.
+ Universe i.
+ Context (foo : Type@{i}) (bar : Type@{i}).
+ Definition qux@{i} (baz : Type@{i}) := foo -> bar.
+End foo.
+Set Printing Universes.
+Print qux. (* qux@{Top.42 Top.43} =
+fun foo bar _ : Type@{Top.42} => foo -> bar
+ : Type@{Top.42} -> Type@{Top.42} -> Type@{Top.42} -> Type@{Top.42}
+(* Top.42 Top.43 |= *)
+(* This is wrong; the first two types are equal, but the last one is not *)
+
+qux is universe polymorphic
+Argument scopes are [type_scope type_scope type_scope]
+ *)
+Check qux nat nat nat : Set.
+Check qux nat nat Set : Set. (* Error:
+The term "qux@{Top.50 Top.51} ?T ?T0 Set" has type "Type@{Top.50}" while it is
+expected to have type "Set"
+(universe inconsistency: Cannot enforce Top.50 = Set because Set < Top.50). *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/4527.v b/test-suite/bugs/closed/4527.v
new file mode 100644
index 00000000..08628377
--- /dev/null
+++ b/test-suite/bugs/closed/4527.v
@@ -0,0 +1,267 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-nois" "-indices-matter" "-R" "." "Top" "-top" "bug_bad_univ_length_01") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 1199 lines to
+430 lines, then from 444 lines to 430 lines, then from 964 lines to 255 lines,
+then from 269 lines to 255 lines *)
+(* coqc version 8.5 (January 2016) compiled on Jan 23 2016 16:15:22 with OCaml
+4.01.0
+ coqtop version 8.5 (January 2016) *)
+Inductive False := .
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Coq.Init.Datatypes.
+
+Import Coq.Init.Notations.
+
+Global Set Universe Polymorphism.
+
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+
+Inductive True : Type :=
+ I : True.
+Module Export Datatypes.
+
+Set Implicit Arguments.
+Notation nat := Coq.Init.Datatypes.nat.
+Notation S := Coq.Init.Datatypes.S.
+
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+
+Notation "x * y" := (prod x y) : type_scope.
+
+Open Scope nat_scope.
+
+End Datatypes.
+Module Export Specif.
+
+Set Implicit Arguments.
+
+Record sig {A} (P : A -> Type) := exist { proj1_sig : A ; proj2_sig : P
+proj1_sig }.
+
+Notation sigT := sig (only parsing).
+
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+
+Notation projT1 := proj1_sig (only parsing).
+Notation projT2 := proj2_sig (only parsing).
+
+End Specif.
+Definition Type1@{i} := Eval hnf in let gt := (Set : Type@{i}) in Type@{i}.
+
+Definition Type2@{i j} := Eval hnf in let gt := (Type1@{j} : Type@{i}) in
+Type@{i}.
+
+Definition Type2le@{i j} := Eval hnf in let gt := (Set : Type@{i}) in
+ let ge := ((fun x => x) : Type1@{j} ->
+Type@{i}) in Type@{i}.
+
+Notation idmap := (fun x => x).
+Delimit Scope function_scope with function.
+Delimit Scope path_scope with path.
+Delimit Scope fibration_scope with fibration.
+Open Scope fibration_scope.
+Open Scope function_scope.
+
+Notation pr1 := projT1.
+Notation pr2 := projT2.
+
+Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+Notation "x .2" := (pr2 x) (at level 3, format "x '.2'") : fibration_scope.
+
+Notation compose := (fun g f x => g (f x)).
+
+Notation "g 'o' f" := (compose g%function f%function) (at level 40, left
+associativity) : function_scope.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+
+Notation "p @ q" := (concat p%path q%path) (at level 20) : path_scope.
+
+Notation "p ^" := (inverse p%path) (at level 3, format "p '^'") : path_scope.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x)
+ := forall x:A, f x = g x.
+
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) :
+type_scope.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Arguments eisretr {A B}%type_scope f%function_scope {_} _.
+Arguments eissect {A B}%type_scope f%function_scope {_} _.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'") :
+function_scope.
+
+Inductive Unit : Type1 :=
+ tt : Unit.
+
+Local Open Scope path_scope.
+
+Section EquivInverse.
+
+ Context {A B : Type} (f : A -> B) {feq : IsEquiv f}.
+
+ Theorem other_adj (b : B) : eissect f (f^-1 b) = ap f^-1 (eisretr f b).
+admit.
+Defined.
+
+ Global Instance isequiv_inverse : IsEquiv f^-1 | 10000
+ := BuildIsEquiv B A f^-1 f (eissect f) (eisretr f) other_adj.
+End EquivInverse.
+
+Section Adjointify.
+
+ Context {A B : Type} (f : A -> B) (g : B -> A).
+ Context (isretr : Sect g f) (issect : Sect f g).
+
+ Let issect' := fun x =>
+ ap g (ap f (issect x)^) @ ap g (isretr (f x)) @ issect x.
+
+ Let is_adjoint' (a : A) : isretr (f a) = ap f (issect' a).
+admit.
+Defined.
+
+ Definition isequiv_adjointify : IsEquiv f
+ := BuildIsEquiv A B f g isretr issect' is_adjoint'.
+
+End Adjointify.
+
+ Definition ExtensionAlong {A B : Type} (f : A -> B)
+ (P : B -> Type) (d : forall x:A, P (f x))
+ := { s : forall y:B, P y & forall x:A, s (f x) = d x }.
+
+ Fixpoint ExtendableAlong@{i j k l}
+ (n : nat) {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := match n with
+ | 0 => Unit@{l}
+ | S n => (forall (g : forall a, C (f a)),
+ ExtensionAlong@{i j k l l} f C g) *
+ forall (h k : forall b, C b),
+ ExtendableAlong n f (fun b => h b = k b)
+ end.
+
+ Definition ooExtendableAlong@{i j k l}
+ {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := forall n, ExtendableAlong@{i j k l} n f C.
+
+Module Type ReflectiveSubuniverses.
+
+ Parameter ReflectiveSubuniverse@{u a} : Type2@{u a}.
+
+ Parameter O_reflector@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter In@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter O_inO@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T :
+Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T).
+
+ Parameter to@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T :
+Type@{i}),
+ T -> O_reflector@{u a i} O T.
+
+ Parameter inO_equiv_inO@{u a i j k} :
+ forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}) (U : Type@{j})
+ (T_inO : In@{u a i} O T) (f : T -> U) (feq : IsEquiv f),
+
+ let gei := ((fun x => x) : Type@{i} -> Type@{k}) in
+ let gej := ((fun x => x) : Type@{j} -> Type@{k}) in
+ In@{u a j} O U.
+
+ Parameter extendable_to_O@{u a i j k}
+ : forall (O : ReflectiveSubuniverse@{u a}) {P : Type2le@{i a}} {Q :
+Type2le@{j a}} {Q_inO : In@{u a j} O Q},
+ ooExtendableAlong@{i i j k} (to O P) (fun _ => Q).
+
+End ReflectiveSubuniverses.
+
+Module ReflectiveSubuniverses_Theory (Os : ReflectiveSubuniverses).
+Export Os.
+
+Existing Class In.
+
+ Coercion O_reflector : ReflectiveSubuniverse >-> Funclass.
+
+Arguments inO_equiv_inO {O} T {U} {_} f {_}.
+Global Existing Instance O_inO.
+
+Section ORecursion.
+ Context {O : ReflectiveSubuniverse}.
+
+ Definition O_indpaths {P Q : Type} {Q_inO : In O Q}
+ (g h : O P -> Q) (p : g o to O P == h o to O P)
+ : g == h
+ := (fst (snd (extendable_to_O O 2) g h) p).1.
+
+ Definition O_indpaths_beta {P Q : Type} {Q_inO : In O Q}
+ (g h : O P -> Q) (p : g o (to O P) == h o (to O P)) (x : P)
+ : O_indpaths g h p (to O P x) = p x
+ := (fst (snd (extendable_to_O O 2) g h) p).2 x.
+
+End ORecursion.
+
+Section Reflective_Subuniverse.
+ Universes Ou Oa.
+ Context (O : ReflectiveSubuniverse@{Ou Oa}).
+
+ Definition inO_isequiv_to_O (T:Type)
+ : IsEquiv (to O T) -> In O T
+ := fun _ => inO_equiv_inO (O T) (to O T)^-1.
+
+ Definition inO_to_O_retract (T:Type) (mu : O T -> T)
+ : Sect (to O T) mu -> In O T.
+ Proof.
+ unfold Sect; intros H.
+ apply inO_isequiv_to_O.
+ apply isequiv_adjointify with (g:=mu).
+ -
+ refine (O_indpaths (to O T o mu) idmap _).
+ intros x; exact (ap (to O T) (H x)).
+ -
+ exact H.
+ Defined.
+
+ Definition inO_paths@{i} (S : Type@{i}) {S_inO : In@{Ou Oa i} O S} (x y :
+S) : In@{Ou Oa i} O (x=y).
+ Proof.
+ simple refine (inO_to_O_retract@{i} _ _ _); intro u.
+ -
+ assert (p : (fun _ : O (x=y) => x) == (fun _=> y)).
+ {
+ refine (O_indpaths _ _ _); simpl.
+ intro v; exact v.
+}
+ exact (p u).
+ -
+ hnf.
+ rewrite O_indpaths_beta; reflexivity.
+ Qed.
+ Check inO_paths@{Type}.
diff --git a/test-suite/bugs/closed/4529.v b/test-suite/bugs/closed/4529.v
new file mode 100644
index 00000000..8b3c24fe
--- /dev/null
+++ b/test-suite/bugs/closed/4529.v
@@ -0,0 +1,45 @@
+(* File reduced by coq-bug-finder from original input, then from 1334 lines to 1518 lines, then from 849 lines to 59 lines *)
+(* coqc version 8.5 (January 2016) compiled on Jan 22 2016 18:20:47 with OCaml 4.02.3
+ coqtop version r-schnelltop:/home/r/src/coq/coq,(HEAD detached at V8.5) (5e23fb90b39dfa014ae5c4fb46eb713cca09dbff) *)
+Require Coq.Setoids.Setoid.
+Import Coq.Setoids.Setoid.
+
+Class Equiv A := equiv: relation A.
+Infix "≡" := equiv (at level 70, no associativity).
+Notation "(≡)" := equiv (only parsing).
+
+(* If I remove this line, everything compiles. *)
+Set Primitive Projections.
+
+Class Dist A := dist : nat -> relation A.
+Notation "x ={ n }= y" := (dist n x y)
+ (at level 70, n at next level, format "x ={ n }= y").
+
+Record CofeMixin A `{Equiv A, Dist A} := {
+ mixin_equiv_dist x y : x ≡ y <-> forall n, x ={n}= y;
+ mixin_dist_equivalence n : Equivalence (dist n);
+}.
+
+Structure cofeT := CofeT {
+ cofe_car :> Type;
+ cofe_equiv : Equiv cofe_car;
+ cofe_dist : Dist cofe_car;
+ cofe_mixin : CofeMixin cofe_car
+}.
+Existing Instances cofe_equiv cofe_dist.
+Arguments cofe_car : simpl never.
+
+Section cofe_mixin.
+ Context {A : cofeT}.
+ Implicit Types x y : A.
+ Lemma equiv_dist x y : x ≡ y <-> forall n, x ={n}= y.
+Admitted.
+End cofe_mixin.
+ Context {A : cofeT}.
+ Global Instance cofe_equivalence : Equivalence ((≡) : relation A).
+ Proof.
+ split.
+ *
+ intros x.
+apply equiv_dist.
+
diff --git a/test-suite/bugs/closed/4533.v b/test-suite/bugs/closed/4533.v
new file mode 100644
index 00000000..ae17fb14
--- /dev/null
+++ b/test-suite/bugs/closed/4533.v
@@ -0,0 +1,226 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-nois" "-indices-matter" "-R" "." "Top" "-top" "bug_lex_wrong_rewrite_02") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 1125 lines to
+346 lines, then from 360 lines to 346 lines, then from 822 lines to 271 lines,
+then from 285 lines to 271 lines *)
+(* coqc version 8.5 (January 2016) compiled on Jan 23 2016 16:15:22 with OCaml
+4.01.0
+ coqtop version 8.5 (January 2016) *)
+Inductive False := .
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Coq.Init.Datatypes.
+Import Coq.Init.Notations.
+Global Set Universe Polymorphism.
+Global Set Primitive Projections.
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+Module Export Datatypes.
+ Set Implicit Arguments.
+ Notation nat := Coq.Init.Datatypes.nat.
+ Notation S := Coq.Init.Datatypes.S.
+ Record prod (A B : Type) := pair { fst : A ; snd : B }.
+ Notation "x * y" := (prod x y) : type_scope.
+ Delimit Scope nat_scope with nat.
+ Open Scope nat_scope.
+End Datatypes.
+Module Export Specif.
+ Set Implicit Arguments.
+ Record sig {A} (P : A -> Type) := exist { proj1_sig : A ; proj2_sig : P
+proj1_sig }.
+ Notation sigT := sig (only parsing).
+ Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+ Notation projT1 := proj1_sig (only parsing).
+ Notation projT2 := proj2_sig (only parsing).
+End Specif.
+Global Set Keyed Unification.
+Global Unset Strict Universe Declaration.
+Definition Type1@{i} := Eval hnf in let gt := (Set : Type@{i}) in Type@{i}.
+Definition Type2@{i j} := Eval hnf in let gt := (Type1@{j} : Type@{i}) in
+Type@{i}.
+Definition Type2le@{i j} := Eval hnf in let gt := (Set : Type@{i}) in
+ let ge := ((fun x => x) : Type1@{j} ->
+Type@{i}) in Type@{i}.
+Notation idmap := (fun x => x).
+Delimit Scope function_scope with function.
+Delimit Scope path_scope with path.
+Delimit Scope fibration_scope with fibration.
+Open Scope fibration_scope.
+Open Scope function_scope.
+Notation pr1 := projT1.
+Notation pr2 := projT2.
+Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+Notation "x .2" := (pr2 x) (at level 3, format "x '.2'") : fibration_scope.
+Notation compose := (fun g f x => g (f x)).
+Notation "g 'o' f" := (compose g%function f%function) (at level 40, left
+associativity) : function_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+Notation "1" := idpath : path_scope.
+Notation "p @ q" := (concat p%path q%path) (at level 20) : path_scope.
+Notation "p ^" := (inverse p%path) (at level 3, format "p '^'") : path_scope.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x)
+ := forall x:A, f x = g x.
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) :
+type_scope.
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr
+(f x) = ap f (eissect x)
+ }.
+Arguments eissect {A B}%type_scope f%function_scope {_} _.
+Inductive Unit : Type1 := tt : Unit.
+Local Open Scope path_scope.
+Definition concat_p_pp {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z
+= t) :
+ p @ (q @ r) = (p @ q) @ r :=
+ match r with idpath =>
+ match q with idpath =>
+ match p with idpath => 1
+ end end end.
+Section Adjointify.
+ Context {A B : Type} (f : A -> B) (g : B -> A).
+ Context (isretr : Sect g f) (issect : Sect f g).
+ Let issect' := fun x =>
+ ap g (ap f (issect x)^) @ ap g (isretr (f x)) @ issect x.
+
+ Let is_adjoint' (a : A) : isretr (f a) = ap f (issect' a).
+ admit.
+ Defined.
+
+ Definition isequiv_adjointify : IsEquiv f
+ := BuildIsEquiv A B f g isretr issect' is_adjoint'.
+End Adjointify.
+Definition ExtensionAlong {A B : Type} (f : A -> B)
+ (P : B -> Type) (d : forall x:A, P (f x))
+ := { s : forall y:B, P y & forall x:A, s (f x) = d x }.
+Fixpoint ExtendableAlong@{i j k l}
+ (n : nat) {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := match n with
+ | 0 => Unit@{l}
+ | S n => (forall (g : forall a, C (f a)),
+ ExtensionAlong@{i j k l l} f C g) *
+ forall (h k : forall b, C b),
+ ExtendableAlong n f (fun b => h b = k b)
+ end.
+
+Definition ooExtendableAlong@{i j k l}
+ {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := forall n, ExtendableAlong@{i j k l} n f C.
+
+Module Type ReflectiveSubuniverses.
+
+ Parameter ReflectiveSubuniverse@{u a} : Type2@{u a}.
+
+ Parameter O_reflector@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter In@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter O_inO@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T :
+Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T).
+
+ Parameter to@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T :
+Type@{i}),
+ T -> O_reflector@{u a i} O T.
+
+ Parameter extendable_to_O@{u a i j k}
+ : forall (O : ReflectiveSubuniverse@{u a}) {P : Type2le@{i a}} {Q :
+Type2le@{j a}} {Q_inO : In@{u a j} O Q},
+ ooExtendableAlong@{i i j k} (to O P) (fun _ => Q).
+
+End ReflectiveSubuniverses.
+
+Module ReflectiveSubuniverses_Theory (Os : ReflectiveSubuniverses).
+ Export Os.
+ Existing Class In.
+ Module Export Coercions.
+ Coercion O_reflector : ReflectiveSubuniverse >-> Funclass.
+ End Coercions.
+ Global Existing Instance O_inO.
+
+ Section ORecursion.
+ Context {O : ReflectiveSubuniverse}.
+
+ Definition O_rec {P Q : Type} {Q_inO : In O Q}
+ (f : P -> Q)
+ : O P -> Q
+ := (fst (extendable_to_O O 1%nat) f).1.
+
+ Definition O_rec_beta {P Q : Type} {Q_inO : In O Q}
+ (f : P -> Q) (x : P)
+ : O_rec f (to O P x) = f x
+ := (fst (extendable_to_O O 1%nat) f).2 x.
+
+ Definition O_indpaths {P Q : Type} {Q_inO : In O Q}
+ (g h : O P -> Q) (p : g o to O P == h o to O P)
+ : g == h
+ := (fst (snd (extendable_to_O O 2) g h) p).1.
+
+ End ORecursion.
+
+
+ Section Reflective_Subuniverse.
+ Context (O : ReflectiveSubuniverse@{Ou Oa}).
+
+ Definition isequiv_to_O_inO@{u a i} (T : Type@{i}) `{In@{u a i} O T} :
+IsEquiv@{i i} (to O T).
+ Proof.
+
+ pose (g := O_rec@{u a i i i i i} idmap).
+ refine (isequiv_adjointify (to O T) g _ _).
+ -
+ refine (O_indpaths@{u a i i i i i} (to O T o g) idmap _).
+ intros x.
+ apply ap.
+ apply O_rec_beta.
+ -
+ intros x.
+ apply O_rec_beta.
+ Defined.
+ Global Existing Instance isequiv_to_O_inO.
+
+ End Reflective_Subuniverse.
+
+End ReflectiveSubuniverses_Theory.
+
+Module Type Preserves_Fibers (Os : ReflectiveSubuniverses).
+ Module Export Os_Theory := ReflectiveSubuniverses_Theory Os.
+End Preserves_Fibers.
+
+Opaque eissect.
+Module Lex_Reflective_Subuniverses
+ (Os : ReflectiveSubuniverses) (Opf : Preserves_Fibers Os).
+ Import Opf.
+ Goal forall (O : ReflectiveSubuniverse) (A : Type) (B : A -> Type) (A_inO :
+In O A),
+
+ forall g,
+ forall (x : O {x : A & B x}) v v' v'' (p2 : v'' = v') (p0 : v' = v) (p1 :
+v = _) r,
+ (p2
+ @ (p0
+ @ p1))
+ @ eissect (to O A) (g x) = r.
+ intros.
+ cbv zeta.
+ rewrite concat_p_pp.
+ match goal with
+ | [ |- p2 @ p0 @ p1 @ eissect (to O A) (g x) = r ] => idtac "good"
+ | [ |- ?G ] => fail 1 "bad" G
+ end.
+ Fail rewrite concat_p_pp. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4538.v b/test-suite/bugs/closed/4538.v
new file mode 100644
index 00000000..f925aae9
--- /dev/null
+++ b/test-suite/bugs/closed/4538.v
@@ -0,0 +1 @@
+Reserved Notation " (u *) ".
diff --git a/test-suite/bugs/closed/4544.v b/test-suite/bugs/closed/4544.v
new file mode 100644
index 00000000..da140c93
--- /dev/null
+++ b/test-suite/bugs/closed/4544.v
@@ -0,0 +1,1007 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-nois" "-indices-matter" "-R" "." "Top" "-top" "bug_oog_looping_rewrite_01") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 2553 lines to 1932 lines, then from 1946 lines to 1932 lines, then from 2467 lines to 1002 lines, then from 1016 lines to 1002 lines *)
+(* coqc version 8.5 (January 2016) compiled on Jan 23 2016 16:15:22 with OCaml 4.01.0
+ coqtop version 8.5 (January 2016) *)
+Inductive False := .
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Coq.Init.Datatypes.
+
+Import Coq.Init.Notations.
+
+Global Set Universe Polymorphism.
+
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+Global Set Primitive Projections.
+
+Inductive sum (A B : Type) : Type :=
+ | inl : A -> sum A B
+ | inr : B -> sum A B.
+Notation nat := Coq.Init.Datatypes.nat.
+Notation S := Coq.Init.Datatypes.S.
+Notation "x + y" := (sum x y) : type_scope.
+
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+
+Notation "x * y" := (prod x y) : type_scope.
+Module Export Specif.
+
+Set Implicit Arguments.
+
+Record sig {A} (P : A -> Type) := exist { proj1_sig : A ; proj2_sig : P proj1_sig }.
+Arguments proj1_sig {A P} _ / .
+
+Notation sigT := sig (only parsing).
+Notation existT := exist (only parsing).
+
+Notation "{ x : A & P }" := (sigT (fun x:A => P)) : type_scope.
+
+Notation projT1 := proj1_sig (only parsing).
+Notation projT2 := proj2_sig (only parsing).
+
+End Specif.
+Module Export HoTT_DOT_Basics_DOT_Overture.
+Module Export HoTT.
+Module Export Basics.
+Module Export Overture.
+
+Global Set Keyed Unification.
+
+Global Unset Strict Universe Declaration.
+
+Notation Type0 := Set.
+
+Definition Type1@{i} := Eval hnf in let gt := (Set : Type@{i}) in Type@{i}.
+
+Definition Type2@{i j} := Eval hnf in let gt := (Type1@{j} : Type@{i}) in Type@{i}.
+
+Definition Type2le@{i j} := Eval hnf in let gt := (Set : Type@{i}) in
+ let ge := ((fun x => x) : Type1@{j} -> Type@{i}) in Type@{i}.
+
+Notation idmap := (fun x => x).
+Delimit Scope function_scope with function.
+Delimit Scope path_scope with path.
+Delimit Scope fibration_scope with fibration.
+Delimit Scope trunc_scope with trunc.
+
+Open Scope trunc_scope.
+Open Scope path_scope.
+Open Scope fibration_scope.
+Open Scope nat_scope.
+Open Scope function_scope.
+
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+
+Notation pr1 := projT1.
+Notation pr2 := projT2.
+
+Notation "x .1" := (pr1 x) (at level 3, format "x '.1'") : fibration_scope.
+Notation "x .2" := (pr2 x) (at level 3, format "x '.2'") : fibration_scope.
+
+Notation compose := (fun g f x => g (f x)).
+
+Notation "g 'o' f" := (compose g%function f%function) (at level 40, left associativity) : function_scope.
+
+Inductive paths {A : Type} (a : A) : A -> Type :=
+ idpath : paths a a.
+
+Arguments idpath {A a} , [A] a.
+
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+
+Notation "1" := idpath : path_scope.
+
+Notation "p @ q" := (concat p%path q%path) (at level 20) : path_scope.
+
+Notation "p ^" := (inverse p%path) (at level 3, format "p '^'") : path_scope.
+
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing) : path_scope.
+
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x)
+ := forall x:A, f x = g x.
+
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
+
+Definition Sect {A B : Type} (s : A -> B) (r : B -> A) :=
+ forall x : A, r (s x) = x.
+
+Class IsEquiv {A B : Type} (f : A -> B) := BuildIsEquiv {
+ equiv_inv : B -> A ;
+ eisretr : Sect equiv_inv f;
+ eissect : Sect f equiv_inv;
+ eisadj : forall x : A, eisretr (f x) = ap f (eissect x)
+}.
+
+Arguments eisretr {A B}%type_scope f%function_scope {_} _.
+
+Record Equiv A B := BuildEquiv {
+ equiv_fun : A -> B ;
+ equiv_isequiv : IsEquiv equiv_fun
+}.
+
+Coercion equiv_fun : Equiv >-> Funclass.
+
+Global Existing Instance equiv_isequiv.
+
+Notation "A <~> B" := (Equiv A B) (at level 85) : type_scope.
+
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'") : function_scope.
+
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+}.
+
+Arguments center A {_}.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Notation "n .+1" := (trunc_S n) (at level 2, left associativity, format "n .+1") : trunc_scope.
+Notation "-2" := minus_two (at level 0) : trunc_scope.
+Notation "-1" := (-2.+1) (at level 0) : trunc_scope.
+Notation "0" := (-1.+1) : trunc_scope.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | -2 => Contr_internal A
+ | n'.+1 => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Global Instance istrunc_paths (A : Type) n `{H : IsTrunc n.+1 A} (x y : A)
+: IsTrunc n (x = y)
+ := H x y.
+
+Notation Contr := (IsTrunc -2).
+Notation IsHProp := (IsTrunc -1).
+
+Hint Extern 0 => progress change Contr_internal with Contr in * : typeclass_instances.
+
+Monomorphic Axiom dummy_funext_type : Type0.
+Monomorphic Class Funext := { dummy_funext_value : dummy_funext_type }.
+
+Inductive Unit : Type1 :=
+ tt : Unit.
+
+Class IsPointed (A : Type) := point : A.
+
+Arguments point A {_}.
+
+Record pType :=
+ { pointed_type : Type ;
+ ispointed_type : IsPointed pointed_type }.
+
+Coercion pointed_type : pType >-> Sortclass.
+
+Global Existing Instance ispointed_type.
+
+Definition hfiber {A B : Type} (f : A -> B) (y : B) := { x : A & f x = y }.
+
+Ltac revert_opaque x :=
+ revert x;
+ match goal with
+ | [ |- forall _, _ ] => idtac
+ | _ => fail 1 "Reverted constant is not an opaque variable"
+ end.
+
+End Overture.
+
+End Basics.
+
+End HoTT.
+
+End HoTT_DOT_Basics_DOT_Overture.
+Module Export HoTT_DOT_Basics_DOT_PathGroupoids.
+Module Export HoTT.
+Module Export Basics.
+Module Export PathGroupoids.
+
+Local Open Scope path_scope.
+
+Definition concat_p1 {A : Type} {x y : A} (p : x = y) :
+ p @ 1 = p
+ :=
+ match p with idpath => 1 end.
+
+Definition concat_1p {A : Type} {x y : A} (p : x = y) :
+ 1 @ p = p
+ :=
+ match p with idpath => 1 end.
+
+Definition concat_p_pp {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z = t) :
+ p @ (q @ r) = (p @ q) @ r :=
+ match r with idpath =>
+ match q with idpath =>
+ match p with idpath => 1
+ end end end.
+
+Definition concat_pp_p {A : Type} {x y z t : A} (p : x = y) (q : y = z) (r : z = t) :
+ (p @ q) @ r = p @ (q @ r) :=
+ match r with idpath =>
+ match q with idpath =>
+ match p with idpath => 1
+ end end end.
+
+Definition concat_pV {A : Type} {x y : A} (p : x = y) :
+ p @ p^ = 1
+ :=
+ match p with idpath => 1 end.
+
+Definition moveR_Vp {A : Type} {x y z : A} (p : x = z) (q : y = z) (r : x = y) :
+ p = r @ q -> r^ @ p = q.
+admit.
+Defined.
+
+Definition moveL_Vp {A : Type} {x y z : A} (p : x = z) (q : y = z) (r : x = y) :
+ r @ q = p -> q = r^ @ p.
+admit.
+Defined.
+
+Definition moveR_M1 {A : Type} {x y : A} (p q : x = y) :
+ 1 = p^ @ q -> p = q.
+admit.
+Defined.
+
+Definition ap_pp {A B : Type} (f : A -> B) {x y z : A} (p : x = y) (q : y = z) :
+ ap f (p @ q) = (ap f p) @ (ap f q)
+ :=
+ match q with
+ idpath =>
+ match p with idpath => 1 end
+ end.
+
+Definition ap_V {A B : Type} (f : A -> B) {x y : A} (p : x = y) :
+ ap f (p^) = (ap f p)^
+ :=
+ match p with idpath => 1 end.
+
+Definition ap_compose {A B C : Type} (f : A -> B) (g : B -> C) {x y : A} (p : x = y) :
+ ap (g o f) p = ap g (ap f p)
+ :=
+ match p with idpath => 1 end.
+
+Definition concat_pA1 {A : Type} {f : A -> A} (p : forall x, x = f x) {x y : A} (q : x = y) :
+ (p x) @ (ap f q) = q @ (p y)
+ :=
+ match q as i in (_ = y) return (p x @ ap f i = i @ p y) with
+ | idpath => concat_p1 _ @ (concat_1p _)^
+ end.
+
+End PathGroupoids.
+
+End Basics.
+
+End HoTT.
+
+End HoTT_DOT_Basics_DOT_PathGroupoids.
+Module Export HoTT_DOT_Basics_DOT_Equivalences.
+Module Export HoTT.
+Module Export Basics.
+Module Export Equivalences.
+
+Definition isequiv_commsq {A B C D}
+ (f : A -> B) (g : C -> D) (h : A -> C) (k : B -> D)
+ (p : k o f == g o h)
+ `{IsEquiv _ _ f} `{IsEquiv _ _ h} `{IsEquiv _ _ k}
+: IsEquiv g.
+admit.
+Defined.
+
+Section Adjointify.
+
+ Context {A B : Type} (f : A -> B) (g : B -> A).
+ Context (isretr : Sect g f) (issect : Sect f g).
+
+ Let issect' := fun x =>
+ ap g (ap f (issect x)^) @ ap g (isretr (f x)) @ issect x.
+
+ Let is_adjoint' (a : A) : isretr (f a) = ap f (issect' a).
+ Proof.
+ unfold issect'.
+ apply moveR_M1.
+ repeat rewrite ap_pp, concat_p_pp; rewrite <- ap_compose.
+ rewrite (concat_pA1 (fun b => (isretr b)^) (ap f (issect a)^)).
+ repeat rewrite concat_pp_p; rewrite ap_V; apply moveL_Vp; rewrite concat_p1.
+ rewrite concat_p_pp, <- ap_compose.
+ rewrite (concat_pA1 (fun b => (isretr b)^) (isretr (f a))).
+ rewrite concat_pV, concat_1p; reflexivity.
+ Qed.
+
+ Definition isequiv_adjointify : IsEquiv f
+ := BuildIsEquiv A B f g isretr issect' is_adjoint'.
+
+End Adjointify.
+
+End Equivalences.
+
+End Basics.
+
+End HoTT.
+
+End HoTT_DOT_Basics_DOT_Equivalences.
+Module Export HoTT_DOT_Basics_DOT_Trunc.
+Module Export HoTT.
+Module Export Basics.
+Module Export Trunc.
+Generalizable Variables A B m n f.
+
+Definition trunc_equiv A {B} (f : A -> B)
+ `{IsTrunc n A} `{IsEquiv A B f}
+ : IsTrunc n B.
+admit.
+Defined.
+
+Record TruncType (n : trunc_index) := BuildTruncType {
+ trunctype_type : Type ;
+ istrunc_trunctype_type : IsTrunc n trunctype_type
+}.
+
+Arguments BuildTruncType _ _ {_}.
+
+Coercion trunctype_type : TruncType >-> Sortclass.
+
+Notation "n -Type" := (TruncType n) (at level 1) : type_scope.
+Notation hProp := (-1)-Type.
+
+Notation BuildhProp := (BuildTruncType -1).
+
+End Trunc.
+
+End Basics.
+
+End HoTT.
+
+End HoTT_DOT_Basics_DOT_Trunc.
+Module Export HoTT_DOT_Types_DOT_Unit.
+Module Export HoTT.
+Module Export Types.
+Module Export Unit.
+
+Notation unit_name x := (fun (_ : Unit) => x).
+
+End Unit.
+
+End Types.
+
+End HoTT.
+
+End HoTT_DOT_Types_DOT_Unit.
+Module Export HoTT_DOT_Types_DOT_Sigma.
+Module Export HoTT.
+Module Export Types.
+Module Export Sigma.
+Local Open Scope path_scope.
+
+Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (pq : {p : u.1 = v.1 & p # u.2 = v.2})
+: u = v
+ := match pq.2 in (_ = v2) return u = (v.1; v2) with
+ | 1 => match pq.1 as p in (_ = v1) return u = (v1; p # u.2) with
+ | 1 => 1
+ end
+ end.
+
+Definition path_sigma {A : Type} (P : A -> Type) (u v : sigT P)
+ (p : u.1 = v.1) (q : p # u.2 = v.2)
+: u = v
+ := path_sigma_uncurried P u v (p;q).
+
+Definition path_sigma' {A : Type} (P : A -> Type) {x x' : A} {y : P x} {y' : P x'}
+ (p : x = x') (q : p # y = y')
+: (x;y) = (x';y')
+ := path_sigma P (x;y) (x';y') p q.
+
+Global Instance isequiv_pr1_contr {A} {P : A -> Type}
+ `{forall a, Contr (P a)}
+: IsEquiv (@pr1 A P) | 100.
+Proof.
+ refine (isequiv_adjointify (@pr1 A P)
+ (fun a => (a ; center (P a))) _ _).
+ -
+ intros a; reflexivity.
+ -
+ intros [a p].
+ refine (path_sigma' P 1 (contr _)).
+Defined.
+
+Definition path_sigma_hprop {A : Type} {P : A -> Type}
+ `{forall x, IsHProp (P x)}
+ (u v : sigT P)
+: u.1 = v.1 -> u = v
+ := path_sigma_uncurried P u v o pr1^-1.
+
+End Sigma.
+
+End Types.
+
+End HoTT.
+
+End HoTT_DOT_Types_DOT_Sigma.
+Module Export HoTT_DOT_Extensions.
+Module Export HoTT.
+Module Export Extensions.
+
+Section Extensions.
+
+ Definition ExtensionAlong {A B : Type} (f : A -> B)
+ (P : B -> Type) (d : forall x:A, P (f x))
+ := { s : forall y:B, P y & forall x:A, s (f x) = d x }.
+
+ Fixpoint ExtendableAlong@{i j k l}
+ (n : nat) {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := match n with
+ | 0 => Unit@{l}
+ | S n => (forall (g : forall a, C (f a)),
+ ExtensionAlong@{i j k l l} f C g) *
+ forall (h k : forall b, C b),
+ ExtendableAlong n f (fun b => h b = k b)
+ end.
+
+ Definition ooExtendableAlong@{i j k l}
+ {A : Type@{i}} {B : Type@{j}}
+ (f : A -> B) (C : B -> Type@{k}) : Type@{l}
+ := forall n, ExtendableAlong@{i j k l} n f C.
+
+End Extensions.
+
+End Extensions.
+
+End HoTT.
+
+End HoTT_DOT_Extensions.
+Module Export HoTT.
+Module Export Modalities.
+Module Export ReflectiveSubuniverse.
+
+Module Type ReflectiveSubuniverses.
+
+ Parameter ReflectiveSubuniverse@{u a} : Type2@{u a}.
+
+ Parameter O_reflector@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter In@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter O_inO@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T).
+
+ Parameter to@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ T -> O_reflector@{u a i} O T.
+
+ Parameter inO_equiv_inO@{u a i j k} :
+ forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}) (U : Type@{j})
+ (T_inO : In@{u a i} O T) (f : T -> U) (feq : IsEquiv f),
+
+ let gei := ((fun x => x) : Type@{i} -> Type@{k}) in
+ let gej := ((fun x => x) : Type@{j} -> Type@{k}) in
+ In@{u a j} O U.
+
+ Parameter hprop_inO@{u a i}
+ : Funext -> forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ IsHProp (In@{u a i} O T).
+
+ Parameter extendable_to_O@{u a i j k}
+ : forall (O : ReflectiveSubuniverse@{u a}) {P : Type2le@{i a}} {Q : Type2le@{j a}} {Q_inO : In@{u a j} O Q},
+ ooExtendableAlong@{i i j k} (to O P) (fun _ => Q).
+
+End ReflectiveSubuniverses.
+
+Module ReflectiveSubuniverses_Theory (Os : ReflectiveSubuniverses).
+Export Os.
+
+Module Export Coercions.
+
+ Coercion O_reflector : ReflectiveSubuniverse >-> Funclass.
+
+End Coercions.
+
+End ReflectiveSubuniverses_Theory.
+
+Module Type ReflectiveSubuniverses_Restriction_Data (Os : ReflectiveSubuniverses).
+
+ Parameter New_ReflectiveSubuniverse@{u a} : Type2@{u a}.
+
+ Parameter ReflectiveSubuniverses_restriction@{u a}
+ : New_ReflectiveSubuniverse@{u a} -> Os.ReflectiveSubuniverse@{u a}.
+
+End ReflectiveSubuniverses_Restriction_Data.
+
+Module ReflectiveSubuniverses_Restriction
+ (Os : ReflectiveSubuniverses)
+ (Res : ReflectiveSubuniverses_Restriction_Data Os)
+<: ReflectiveSubuniverses.
+
+ Definition ReflectiveSubuniverse := Res.New_ReflectiveSubuniverse.
+
+ Definition O_reflector@{u a i} (O : ReflectiveSubuniverse@{u a})
+ := Os.O_reflector@{u a i} (Res.ReflectiveSubuniverses_restriction O).
+ Definition In@{u a i} (O : ReflectiveSubuniverse@{u a})
+ := Os.In@{u a i} (Res.ReflectiveSubuniverses_restriction O).
+ Definition O_inO@{u a i} (O : ReflectiveSubuniverse@{u a})
+ := Os.O_inO@{u a i} (Res.ReflectiveSubuniverses_restriction O).
+ Definition to@{u a i} (O : ReflectiveSubuniverse@{u a})
+ := Os.to@{u a i} (Res.ReflectiveSubuniverses_restriction O).
+ Definition inO_equiv_inO@{u a i j k} (O : ReflectiveSubuniverse@{u a})
+ := Os.inO_equiv_inO@{u a i j k} (Res.ReflectiveSubuniverses_restriction O).
+ Definition hprop_inO@{u a i} (H : Funext) (O : ReflectiveSubuniverse@{u a})
+ := Os.hprop_inO@{u a i} H (Res.ReflectiveSubuniverses_restriction O).
+ Definition extendable_to_O@{u a i j k} (O : ReflectiveSubuniverse@{u a})
+ := @Os.extendable_to_O@{u a i j k} (Res.ReflectiveSubuniverses_restriction@{u a} O).
+
+End ReflectiveSubuniverses_Restriction.
+
+Module ReflectiveSubuniverses_FamUnion
+ (Os1 Os2 : ReflectiveSubuniverses)
+<: ReflectiveSubuniverses.
+
+ Definition ReflectiveSubuniverse@{u a} : Type2@{u a}
+ := Os1.ReflectiveSubuniverse@{u a} + Os2.ReflectiveSubuniverse@{u a}.
+
+ Definition O_reflector@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+admit.
+Defined.
+
+ Definition In@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+ Proof.
+ intros [O|O]; [ exact (Os1.In@{u a i} O)
+ | exact (Os2.In@{u a i} O) ].
+ Defined.
+
+ Definition O_inO@{u a i}
+ : forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T).
+admit.
+Defined.
+
+ Definition to@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ T -> O_reflector@{u a i} O T.
+admit.
+Defined.
+
+ Definition inO_equiv_inO@{u a i j k} :
+ forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}) (U : Type@{j})
+ (T_inO : In@{u a i} O T) (f : T -> U) (feq : IsEquiv f),
+ In@{u a j} O U.
+ Proof.
+ intros [O|O]; [ exact (Os1.inO_equiv_inO@{u a i j k} O)
+ | exact (Os2.inO_equiv_inO@{u a i j k} O) ].
+ Defined.
+
+ Definition hprop_inO@{u a i}
+ : Funext -> forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ IsHProp (In@{u a i} O T).
+admit.
+Defined.
+
+ Definition extendable_to_O@{u a i j k}
+ : forall (O : ReflectiveSubuniverse@{u a}) {P : Type2le@{i a}} {Q : Type2le@{j a}} {Q_inO : In@{u a j} O Q},
+ ooExtendableAlong@{i i j k} (to O P) (fun _ => Q).
+admit.
+Defined.
+
+End ReflectiveSubuniverses_FamUnion.
+
+End ReflectiveSubuniverse.
+
+End Modalities.
+
+End HoTT.
+
+Module Type Modalities.
+
+ Parameter Modality@{u a} : Type2@{u a}.
+
+ Parameter O_reflector@{u a i} : forall (O : Modality@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter In@{u a i} : forall (O : Modality@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter O_inO@{u a i} : forall (O : Modality@{u a}) (T : Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T).
+
+ Parameter to@{u a i} : forall (O : Modality@{u a}) (T : Type@{i}),
+ T -> O_reflector@{u a i} O T.
+
+ Parameter inO_equiv_inO@{u a i j k} :
+ forall (O : Modality@{u a}) (T : Type@{i}) (U : Type@{j})
+ (T_inO : In@{u a i} O T) (f : T -> U) (feq : IsEquiv f),
+
+ let gei := ((fun x => x) : Type@{i} -> Type@{k}) in
+ let gej := ((fun x => x) : Type@{j} -> Type@{k}) in
+ In@{u a j} O U.
+
+ Parameter hprop_inO@{u a i}
+ : Funext -> forall (O : Modality@{u a}) (T : Type@{i}),
+ IsHProp (In@{u a i} O T).
+
+End Modalities.
+
+Module Modalities_to_ReflectiveSubuniverses
+ (Os : Modalities) <: ReflectiveSubuniverses.
+
+ Import Os.
+
+ Fixpoint O_extendable@{u a i j k} (O : Modality@{u a})
+ (A : Type@{i}) (B : O_reflector O A -> Type@{j})
+ (B_inO : forall a, In@{u a j} O (B a)) (n : nat)
+ : ExtendableAlong@{i i j k} n (to O A) B.
+admit.
+Defined.
+
+ Definition ReflectiveSubuniverse := Modality.
+
+ Definition O_reflector@{u a i} := O_reflector@{u a i}.
+
+ Definition In@{u a i} : forall (O : ReflectiveSubuniverse@{u a}),
+ Type2le@{i a} -> Type2le@{i a}
+ := In@{u a i}.
+ Definition O_inO@{u a i} : forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ In@{u a i} O (O_reflector@{u a i} O T)
+ := O_inO@{u a i}.
+ Definition to@{u a i} := to@{u a i}.
+ Definition inO_equiv_inO@{u a i j k} :
+ forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}) (U : Type@{j})
+ (T_inO : In@{u a i} O T) (f : T -> U) (feq : IsEquiv f),
+ In@{u a j} O U
+ := inO_equiv_inO@{u a i j k}.
+ Definition hprop_inO@{u a i}
+ : Funext -> forall (O : ReflectiveSubuniverse@{u a}) (T : Type@{i}),
+ IsHProp (In@{u a i} O T)
+ := hprop_inO@{u a i}.
+
+ Definition extendable_to_O@{u a i j k} (O : ReflectiveSubuniverse@{u a})
+ {P : Type2le@{i a}} {Q : Type2le@{j a}} {Q_inO : In@{u a j} O Q}
+ : ooExtendableAlong@{i i j k} (to O P) (fun _ => Q)
+ := fun n => O_extendable O P (fun _ => Q) (fun _ => Q_inO) n.
+
+End Modalities_to_ReflectiveSubuniverses.
+
+Module Type EasyModalities.
+
+ Parameter Modality@{u a} : Type2@{u a}.
+
+ Parameter O_reflector@{u a i} : forall (O : Modality@{u a}),
+ Type2le@{i a} -> Type2le@{i a}.
+
+ Parameter to@{u a i} : forall (O : Modality@{u a}) (T : Type@{i}),
+ T -> O_reflector@{u a i} O T.
+
+ Parameter minO_pathsO@{u a i}
+ : forall (O : Modality@{u a}) (A : Type@{i})
+ (z z' : O_reflector@{u a i} O A),
+ IsEquiv (to@{u a i} O (z = z')).
+
+End EasyModalities.
+
+Module EasyModalities_to_Modalities (Os : EasyModalities)
+<: Modalities.
+
+ Import Os.
+
+ Definition Modality := Modality.
+
+ Definition O_reflector@{u a i} := O_reflector@{u a i}.
+ Definition to@{u a i} := to@{u a i}.
+
+ Definition In@{u a i}
+ : forall (O : Modality@{u a}), Type@{i} -> Type@{i}
+ := fun O A => IsEquiv@{i i} (to O A).
+
+ Definition hprop_inO@{u a i} `{Funext} (O : Modality@{u a})
+ (T : Type@{i})
+ : IsHProp (In@{u a i} O T).
+admit.
+Defined.
+
+ Definition O_ind_internal@{u a i j k} (O : Modality@{u a})
+ (A : Type@{i}) (B : O_reflector@{u a i} O A -> Type@{j})
+ (B_inO : forall oa, In@{u a j} O (B oa))
+ : let gei := ((fun x => x) : Type@{i} -> Type@{k}) in
+ let gej := ((fun x => x) : Type@{j} -> Type@{k}) in
+ (forall a, B (to O A a)) -> forall oa, B oa.
+admit.
+Defined.
+
+ Definition O_ind_beta_internal@{u a i j k} (O : Modality@{u a})
+ (A : Type@{i}) (B : O_reflector@{u a i} O A -> Type@{j})
+ (B_inO : forall oa, In@{u a j} O (B oa))
+ (f : forall a : A, B (to O A a)) (a:A)
+ : O_ind_internal@{u a i j k} O A B B_inO f (to O A a) = f a.
+admit.
+Defined.
+
+ Definition O_inO@{u a i} (O : Modality@{u a}) (A : Type@{i})
+ : In@{u a i} O (O_reflector@{u a i} O A).
+admit.
+Defined.
+
+ Definition inO_equiv_inO@{u a i j k} (O : Modality@{u a}) (A : Type@{i}) (B : Type@{j})
+ (A_inO : In@{u a i} O A) (f : A -> B) (feq : IsEquiv f)
+ : In@{u a j} O B.
+ Proof.
+ simple refine (isequiv_commsq (to O A) (to O B) f
+ (O_ind_internal O A (fun _ => O_reflector O B) _ (fun a => to O B (f a))) _).
+ -
+ intros; apply O_inO.
+ -
+ intros a; refine (O_ind_beta_internal@{u a i j k} O A (fun _ => O_reflector O B) _ _ a).
+ -
+ apply A_inO.
+ -
+ simple refine (isequiv_adjointify _
+ (O_ind_internal O B (fun _ => O_reflector O A) _ (fun b => to O A (f^-1 b))) _ _);
+ intros x.
+ +
+ apply O_inO.
+ +
+ pattern x; refine (O_ind_internal O B _ _ _ x); intros.
+ *
+ apply minO_pathsO.
+ *
+ simpl; admit.
+ +
+ pattern x; refine (O_ind_internal O A _ _ _ x); intros.
+ *
+ apply minO_pathsO.
+ *
+ simpl; admit.
+ Defined.
+
+End EasyModalities_to_Modalities.
+
+Module Modalities_Theory (Os : Modalities).
+
+Export Os.
+Module Export Os_ReflectiveSubuniverses
+ := Modalities_to_ReflectiveSubuniverses Os.
+Module Export RSU
+ := ReflectiveSubuniverses_Theory Os_ReflectiveSubuniverses.
+
+Module Export Coercions.
+ Coercion modality_to_reflective_subuniverse
+ := idmap : Modality -> ReflectiveSubuniverse.
+End Coercions.
+
+Class IsConnected (O : Modality@{u a}) (A : Type@{i})
+
+ := isconnected_contr_O : IsTrunc@{i} -2 (O A).
+
+Class IsConnMap (O : Modality@{u a})
+ {A : Type@{i}} {B : Type@{j}} (f : A -> B)
+ := isconnected_hfiber_conn_map
+
+ : forall b:B, IsConnected@{u a k} O (hfiber@{i j} f b).
+
+End Modalities_Theory.
+
+Private Inductive Trunc (n : trunc_index) (A :Type) : Type :=
+ tr : A -> Trunc n A.
+Arguments tr {n A} a.
+
+Global Instance istrunc_truncation (n : trunc_index) (A : Type@{i})
+: IsTrunc@{j} n (Trunc@{i} n A).
+Admitted.
+
+Definition Trunc_ind {n A}
+ (P : Trunc n A -> Type) {Pt : forall aa, IsTrunc n (P aa)}
+ : (forall a, P (tr a)) -> (forall aa, P aa)
+:= (fun f aa => match aa with tr a => fun _ => f a end Pt).
+
+Definition Truncation_Modality := trunc_index.
+
+Module Truncation_Modalities <: Modalities.
+
+ Definition Modality : Type2@{u a} := Truncation_Modality.
+
+ Definition O_reflector (n : Modality@{u u'}) A := Trunc n A.
+
+ Definition In (n : Modality@{u u'}) A := IsTrunc n A.
+
+ Definition O_inO (n : Modality@{u u'}) A : In n (O_reflector n A).
+admit.
+Defined.
+
+ Definition to (n : Modality@{u u'}) A := @tr n A.
+
+ Definition inO_equiv_inO (n : Modality@{u u'})
+ (A : Type@{i}) (B : Type@{j}) Atr f feq
+ : let gei := ((fun x => x) : Type@{i} -> Type@{k}) in
+ let gej := ((fun x => x) : Type@{j} -> Type@{k}) in
+ In n B
+ := @trunc_equiv A B f n Atr feq.
+
+ Definition hprop_inO `{Funext} (n : Modality@{u u'}) A
+ : IsHProp (In n A).
+admit.
+Defined.
+
+End Truncation_Modalities.
+
+Module Import TrM := Modalities_Theory Truncation_Modalities.
+
+Definition merely (A : Type@{i}) : hProp := BuildhProp (Trunc -1 A).
+
+Notation IsSurjection := (IsConnMap -1).
+
+Definition BuildIsSurjection {A B} (f : A -> B) :
+ (forall b, merely (hfiber f b)) -> IsSurjection f.
+admit.
+Defined.
+
+Ltac strip_truncations :=
+
+ progress repeat match goal with
+ | [ T : _ |- _ ]
+ => revert_opaque T;
+ refine (@Trunc_ind _ _ _ _ _);
+
+ [];
+ intro T
+ end.
+Local Open Scope trunc_scope.
+
+Global Instance conn_pointed_type {n : trunc_index} {A : Type} (a0:A)
+ `{IsConnMap n _ _ (unit_name a0)} : IsConnected n.+1 A | 1000.
+admit.
+Defined.
+
+Definition loops (A : pType) : pType :=
+ Build_pType (point A = point A) idpath.
+
+Record pMap (A B : pType) :=
+ { pointed_fun : A -> B ;
+ point_eq : pointed_fun (point A) = point B }.
+
+Arguments point_eq {A B} f : rename.
+Coercion pointed_fun : pMap >-> Funclass.
+
+Infix "->*" := pMap (at level 99) : pointed_scope.
+Local Open Scope pointed_scope.
+
+Definition pmap_compose {A B C : pType}
+ (g : B ->* C) (f : A ->* B)
+: A ->* C
+ := Build_pMap A C (g o f)
+ (ap g (point_eq f) @ point_eq g).
+
+Record pHomotopy {A B : pType} (f g : pMap A B) :=
+ { pointed_htpy : f == g ;
+ point_htpy : pointed_htpy (point A) @ point_eq g = point_eq f }.
+Arguments pointed_htpy {A B f g} p x.
+
+Infix "==*" := pHomotopy (at level 70, no associativity) : pointed_scope.
+
+Definition loops_functor {A B : pType} (f : A ->* B)
+: (loops A) ->* (loops B).
+Proof.
+ refine (Build_pMap (loops A) (loops B)
+ (fun p => (point_eq f)^ @ (ap f p @ point_eq f)) _).
+ apply moveR_Vp; simpl.
+ refine (concat_1p _ @ (concat_p1 _)^).
+Defined.
+
+Definition loops_functor_compose {A B C : pType}
+ (g : B ->* C) (f : A ->* B)
+: (loops_functor (pmap_compose g f))
+ ==* (pmap_compose (loops_functor g) (loops_functor f)).
+admit.
+Defined.
+
+Local Open Scope path_scope.
+
+Record ooGroup :=
+ { classifying_space : pType@{i} ;
+ isconn_classifying_space : IsConnected@{u a i} 0 classifying_space
+ }.
+
+Local Notation B := classifying_space.
+
+Definition group_type (G : ooGroup) : Type
+ := point (B G) = point (B G).
+
+Coercion group_type : ooGroup >-> Sortclass.
+
+Definition group_loops (X : pType)
+: ooGroup.
+Proof.
+
+ pose (x0 := point X);
+ pose (BG := (Build_pType
+ { x:X & merely (x = point X) }
+ (existT (fun x:X => merely (x = point X)) x0 (tr 1)))).
+
+ cut (IsConnected 0 BG).
+ {
+ exact (Build_ooGroup BG).
+}
+ cut (IsSurjection (unit_name (point BG))).
+ {
+ intros; refine (conn_pointed_type (point _)).
+}
+ apply BuildIsSurjection; simpl; intros [x p].
+ strip_truncations; apply tr; exists tt.
+ apply path_sigma_hprop; simpl.
+ exact (p^).
+Defined.
+
+Definition loops_group (X : pType)
+: loops X <~> group_loops X.
+admit.
+Defined.
+
+Definition ooGroupHom (G H : ooGroup)
+ := pMap (B G) (B H).
+
+Definition grouphom_fun {G H} (phi : ooGroupHom G H) : G -> H
+ := loops_functor phi.
+
+Coercion grouphom_fun : ooGroupHom >-> Funclass.
+
+Definition group_loops_functor
+ {X Y : pType} (f : pMap X Y)
+: ooGroupHom (group_loops X) (group_loops Y).
+Proof.
+ simple refine (Build_pMap _ _ _ _); simpl.
+ -
+ intros [x p].
+ exists (f x).
+ strip_truncations; apply tr.
+ exact (ap f p @ point_eq f).
+ -
+ apply path_sigma_hprop; simpl.
+ apply point_eq.
+Defined.
+
+Definition loops_functor_group
+ {X Y : pType} (f : pMap X Y)
+: loops_functor (group_loops_functor f) o loops_group X
+ == loops_group Y o loops_functor f.
+admit.
+Defined.
+
+Definition grouphom_compose {G H K : ooGroup}
+ (psi : ooGroupHom H K) (phi : ooGroupHom G H)
+: ooGroupHom G K
+ := pmap_compose psi phi.
+
+Definition group_loops_functor_compose
+ {X Y Z : pType}
+ (psi : pMap Y Z) (phi : pMap X Y)
+: grouphom_compose (group_loops_functor psi) (group_loops_functor phi)
+ == group_loops_functor (pmap_compose psi phi).
+Proof.
+ intros g.
+ unfold grouphom_fun, grouphom_compose.
+ refine (pointed_htpy (loops_functor_compose _ _) g @ _).
+ pose (p := eisretr (loops_group X) g).
+ change (loops_functor (group_loops_functor psi)
+ (loops_functor (group_loops_functor phi) g)
+ = loops_functor (group_loops_functor
+ (pmap_compose psi phi)) g).
+ rewrite <- p.
+ Fail Timeout 1 Time rewrite !loops_functor_group.
+ (* 0.004 s in 8.5rc1, 8.677 s in 8.5 *)
+ Timeout 1 do 3 rewrite loops_functor_group.
+Abort. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4574.v b/test-suite/bugs/closed/4574.v
new file mode 100644
index 00000000..39ba1903
--- /dev/null
+++ b/test-suite/bugs/closed/4574.v
@@ -0,0 +1,8 @@
+Require Import Setoid.
+
+Definition block A (a : A) := a.
+
+Goal forall A (a : A), block Type nat.
+Proof.
+Fail reflexivity.
+
diff --git a/test-suite/bugs/closed/4576.v b/test-suite/bugs/closed/4576.v
new file mode 100644
index 00000000..2c643ea7
--- /dev/null
+++ b/test-suite/bugs/closed/4576.v
@@ -0,0 +1,3 @@
+Definition foo := O.
+Arguments foo : simpl nomatch.
+Timeout 1 Eval cbn in id foo.
diff --git a/test-suite/bugs/closed/4580.v b/test-suite/bugs/closed/4580.v
new file mode 100644
index 00000000..4ffd5f0f
--- /dev/null
+++ b/test-suite/bugs/closed/4580.v
@@ -0,0 +1,6 @@
+Require Import Program.
+
+Class Foo (A : Type) := foo : A.
+
+Unset Refine Instance Mode.
+Program Instance f1 : Foo nat := S _.
diff --git a/test-suite/bugs/closed/4582.v b/test-suite/bugs/closed/4582.v
new file mode 100644
index 00000000..0842fb8f
--- /dev/null
+++ b/test-suite/bugs/closed/4582.v
@@ -0,0 +1,10 @@
+Require List.
+Import List.ListNotations.
+
+Variable Foo : nat -> nat.
+
+Delimit Scope Foo_scope with F.
+
+Notation " [ x ] " := (Foo x) : Foo_scope.
+
+Check ([1] : nat)%F.
diff --git a/test-suite/bugs/closed/4588.v b/test-suite/bugs/closed/4588.v
new file mode 100644
index 00000000..ff66277e
--- /dev/null
+++ b/test-suite/bugs/closed/4588.v
@@ -0,0 +1,10 @@
+Set Primitive Projections.
+
+(* This proof was accepted in Coq 8.5 because the subterm specs were not
+projected correctly *)
+Inductive foo : Prop := mkfoo { proj1 : False -> foo; proj2 : (forall P : Prop, P -> P) }.
+
+Fail Fixpoint loop (x : foo) : False :=
+ loop (proj2 x _ x).
+
+Fail Definition bad : False := loop (mkfoo (fun x => match x with end) (fun _ x => x)).
diff --git a/test-suite/bugs/closed/4596.v b/test-suite/bugs/closed/4596.v
new file mode 100644
index 00000000..592fdb65
--- /dev/null
+++ b/test-suite/bugs/closed/4596.v
@@ -0,0 +1,14 @@
+Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms.
+
+Definition T (x : bool) := x = true.
+
+Goal forall (S : Type) (b b0 : S -> nat -> bool) (str : S) (p : nat)
+ (s : forall n : nat, bool)
+ (s0 s1 : nat -> S -> S),
+ (forall (str0 : S) (n m : nat),
+ (if s m then T (b0 (s1 n str0) 0) else T (b (s1 n str0) 0)) -> T (b (s0 n str0) m) ->
+ T (b str0 m)) ->
+ T (b str p).
+Proof.
+intros ???????? H0.
+rewrite H0.
diff --git a/test-suite/bugs/closed/4603.v b/test-suite/bugs/closed/4603.v
new file mode 100644
index 00000000..e7567623
--- /dev/null
+++ b/test-suite/bugs/closed/4603.v
@@ -0,0 +1,10 @@
+Axiom A : Type.
+
+Goal True. exact I.
+Check (fun P => P A).
+Abort.
+
+Goal True.
+Definition foo (A : Type) : Prop:= True.
+ set (x:=foo). split.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4616.v b/test-suite/bugs/closed/4616.v
new file mode 100644
index 00000000..c862f820
--- /dev/null
+++ b/test-suite/bugs/closed/4616.v
@@ -0,0 +1,4 @@
+Set Primitive Projections.
+Record Foo' := Foo { foo : Type }.
+Axiom f : forall t : Foo', foo t.
+Extraction f.
diff --git a/test-suite/bugs/closed/4622.v b/test-suite/bugs/closed/4622.v
new file mode 100644
index 00000000..ffa478cb
--- /dev/null
+++ b/test-suite/bugs/closed/4622.v
@@ -0,0 +1,24 @@
+Set Primitive Projections.
+
+Record foo : Type := bar { x : unit }.
+
+Goal forall t u, bar t = bar u -> t = u.
+Proof.
+ intros.
+ injection H.
+ trivial.
+Qed.
+(* Was: Error: Pattern-matching expression on an object of inductive type foo has invalid information. *)
+
+(** Dependent pattern-matching is ok on this one as it has eta *)
+Definition baz (x : foo) :=
+ match x as x' return x' = x' with
+ | bar u => eq_refl
+ end.
+
+Inductive foo' : Type := bar' {x' : unit; y: foo'}.
+(** Dependent pattern-matching is not ok on this one *)
+Fail Definition baz' (x : foo') :=
+ match x as x' return x' = x' with
+ | bar' u y => eq_refl
+ end.
diff --git a/test-suite/bugs/closed/4627.v b/test-suite/bugs/closed/4627.v
new file mode 100644
index 00000000..e1206bb3
--- /dev/null
+++ b/test-suite/bugs/closed/4627.v
@@ -0,0 +1,49 @@
+Class sa (A:Type) := { }.
+
+Record predicate A (sa:sa A) :=
+ { pred_fun: A->Prop }.
+Record ABC : Type :=
+ { abc: Type }.
+Record T :=
+ { T_abc: ABC }.
+
+
+(*
+sa: forall _ : Type@{Top.179}, Prop
+predicate: forall (A : Type@{Top.205}) (_ : sa A), Type@{max(Set+1, Top.205)}
+T: Type@{Top.208+1}
+ABC: Type@{Top.208+1}
+abc: forall _ : ABC, Type@{Top.208}
+
+Top.205 <= Top.179 predicate <= sa.A
+Set < Top.208 Set < abc
+Set < Top.205 Set < predicate
+*)
+
+Definition foo : predicate T (Build_sa T) :=
+ {| pred_fun:= fun w => True |}.
+(* *)
+(* Top.208 < Top.205 <--- added by foo *)
+(* *)
+
+Check predicate nat (Build_sa nat).
+(*
+
+The issue is that the template polymorphic universe of [predicate], Top.205, does not get replaced with the universe of [nat] in the above line.
+ -Jason Gross
+
+8.5 -- predicate nat (Build_sa nat): Type@{max(Set+1, Top.205)}
+8.5 EXPECTED -- predicate nat (Build_sa nat): Type@{Set+1}
+8.4pl4 -- predicate nat {| |}: Type (* max(Set, (Set)+1) *)
+*)
+
+(* This works in 8.4pl4 and SHOULD work in 8.5 *)
+Definition bar : ABC :=
+ {| abc:= predicate nat (Build_sa nat) |}.
+(*
+The term "predicate nat (Build_sa nat)" has type
+ "Type@{max(Set+1, Top.205)}"
+while it is expected to have type "Type@{Top.208}"
+(universe inconsistency: Cannot enforce Top.205 <=
+Top.208 because Top.208 < Top.205).
+*) \ No newline at end of file
diff --git a/test-suite/bugs/closed/4628.v b/test-suite/bugs/closed/4628.v
new file mode 100644
index 00000000..7d4a15d6
--- /dev/null
+++ b/test-suite/bugs/closed/4628.v
@@ -0,0 +1,46 @@
+Module first.
+ Polymorphic Record BAR (A:Type) :=
+ { foo: A->Prop; bar: forall (x y: A), foo x -> foo y}.
+
+Section A.
+Context {A:Type}.
+
+Set Printing Universes.
+
+Hint Resolve bar.
+Goal forall (P:BAR A) x y, foo _ P x -> foo _ P y.
+intros.
+eauto.
+Qed.
+End A.
+End first.
+
+Module firstbest.
+ Polymorphic Record BAR (A:Type) :=
+ { foo: A->Prop; bar: forall (x y: A), foo x -> foo y}.
+
+Section A.
+Context {A:Type}.
+
+Set Printing Universes.
+
+Polymorphic Hint Resolve bar.
+Goal forall (P:BAR A) x y, foo _ P x -> foo _ P y.
+intros.
+eauto.
+Qed.
+End A.
+End firstbest.
+
+Module second.
+Axiom foo: Set.
+Axiom foo': Set.
+
+Polymorphic Record BAR (A:Type) :=
+ { bar: foo' -> foo}.
+Set Printing Universes.
+
+Lemma baz@{i}: forall (P:BAR@{Set} nat), foo' -> foo.
+ eauto using bar.
+Qed.
+End second.
diff --git a/test-suite/bugs/closed/4634.v b/test-suite/bugs/closed/4634.v
new file mode 100644
index 00000000..77e31e10
--- /dev/null
+++ b/test-suite/bugs/closed/4634.v
@@ -0,0 +1,16 @@
+Set Primitive Projections.
+
+Polymorphic Record pair {A B : Type} : Type :=
+ prod { pr1 : A; pr2 : B }.
+
+Notation " ( x ; y ) " := (@prod _ _ x y).
+Notation " x .1 " := (pr1 x) (at level 3).
+Notation " x .2 " := (pr2 x) (at level 3).
+
+Goal ((0; 1); 2).1.2 = 1.
+Proof.
+ cbv.
+ match goal with
+ | |- ?t = ?t => exact (eq_refl t)
+ end.
+Qed.
diff --git a/test-suite/bugs/closed/4644.v b/test-suite/bugs/closed/4644.v
new file mode 100644
index 00000000..f09b27c2
--- /dev/null
+++ b/test-suite/bugs/closed/4644.v
@@ -0,0 +1,52 @@
+(* Testing a regression of unification in 8.5 in problems of the form
+ "match ?y with ... end = ?x args" *)
+
+Lemma foo : exists b, forall a, match a with tt => tt end = b a.
+Proof.
+eexists. intro.
+refine (_ : _ = match _ with tt => _ end).
+refine eq_refl.
+Qed.
+
+(**********************************************************************)
+
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Export Coq.Classes.Morphisms.
+Require Import Coq.Lists.List.
+
+Global Set Implicit Arguments.
+
+Definition list_caset A (P : list A -> Type) (N : P nil) (C : forall x xs, P (x::xs))
+ ls
+ : P ls
+ := match ls with
+ | nil => N
+ | x::xs => C x xs
+ end.
+
+Axiom list_caset_Proper'
+ : forall {A P},
+ Proper (eq
+ ==> pointwise_relation _ (pointwise_relation _ eq)
+ ==> eq
+ ==> eq)
+ (@list_caset A (fun _ => P)).
+Goal forall (T T' : Set) (a3 : list T), exists y2, forall (a4 : T' -> bool),
+ match a3 with
+ | nil => 0
+ | (_ :: _)%list => 1
+ end = y2 a4.
+ clear; eexists; intros.
+ reflexivity. Undo.
+ Local Ltac t :=
+ lazymatch goal with
+ | [ |- match ?v with nil => ?N | cons x xs => @?C x xs end = _ :> ?P ]
+ => let T := type of v in
+ let A := match (eval hnf in T) with list ?A => A end in
+ refine (@list_caset_Proper' A P _ _ _ _ _ _ _ _ _
+ : @list_caset A (fun _ => P) N C v = match _ with nil => _ | cons x xs => _ end)
+ end.
+ (etransitivity; [ t | reflexivity ]) || fail 0 "too early".
+ Undo.
+ t.
diff --git a/test-suite/bugs/closed/4653.v b/test-suite/bugs/closed/4653.v
new file mode 100644
index 00000000..4514342c
--- /dev/null
+++ b/test-suite/bugs/closed/4653.v
@@ -0,0 +1,3 @@
+Definition T := Type.
+Module Type S. Parameter foo : let A := T in True. End S.
+Module M <: S. Lemma foo (A := T) : True. Proof I. End M.
diff --git a/test-suite/bugs/closed/4656.v b/test-suite/bugs/closed/4656.v
new file mode 100644
index 00000000..c89a86d6
--- /dev/null
+++ b/test-suite/bugs/closed/4656.v
@@ -0,0 +1,4 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *)
+Goal True.
+ constructor 1.
+Qed.
diff --git a/test-suite/bugs/closed/4661.v b/test-suite/bugs/closed/4661.v
new file mode 100644
index 00000000..03d2350a
--- /dev/null
+++ b/test-suite/bugs/closed/4661.v
@@ -0,0 +1,10 @@
+Module Type Test.
+ Parameter t : Type.
+End Test.
+
+Module Type Func (T:Test).
+ Parameter x : Type.
+End Func.
+
+Module Shortest_path (T : Test).
+Print Func.
diff --git a/test-suite/bugs/closed/4663.v b/test-suite/bugs/closed/4663.v
new file mode 100644
index 00000000..b7661988
--- /dev/null
+++ b/test-suite/bugs/closed/4663.v
@@ -0,0 +1,3 @@
+Coercion foo (n : nat) : Set.
+Admitted.
+Check (0 : Set).
diff --git a/test-suite/bugs/closed/4670.v b/test-suite/bugs/closed/4670.v
new file mode 100644
index 00000000..61139929
--- /dev/null
+++ b/test-suite/bugs/closed/4670.v
@@ -0,0 +1,7 @@
+Require Import Coq.Vectors.Vector.
+Module Bar.
+ Definition foo A n (l : Vector.t A n) : True.
+ Proof.
+ induction l ; exact I.
+ Defined.
+End Bar.
diff --git a/test-suite/bugs/closed/4673.v b/test-suite/bugs/closed/4673.v
new file mode 100644
index 00000000..1ae50818
--- /dev/null
+++ b/test-suite/bugs/closed/4673.v
@@ -0,0 +1,57 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-R" "." "Fiat" "-top" "BooleanRecognizerOptimized" "-R" "." "Top") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 2407 lines to 22 lines, then from 528 lines to 35 lines, then from 331 lines to 42 lines, then from 56 lines to 42 lines, then from 63 lines to 46 lines, then from 60 lines to 46 lines *) (* coqc version 8.5 (February 2016) compiled on Feb 21 2016 15:26:16 with OCaml 4.02.3
+ coqtop version 8.5 (February 2016) *)
+Axiom proof_admitted : False.
+Tactic Notation "admit" := case proof_admitted.
+Require Coq.Lists.List.
+Import Coq.Lists.List.
+Import Coq.Classes.Morphisms.
+
+Definition list_caset A (P : list A -> Type) (N : P nil) (C : forall x xs, P (x::xs))
+ ls
+ : P ls
+ := match ls with
+ | nil => N
+ | x::xs => C x xs
+ end.
+
+Global Instance list_caset_Proper' {A P}
+ : Proper (eq
+ ==> pointwise_relation _ (pointwise_relation _ eq)
+ ==> eq
+ ==> eq)
+ (@list_caset A (fun _ => P)).
+admit.
+Defined.
+
+Global Instance list_caset_Proper'' {A P}
+ : (Proper (eq ==> pointwise_relation _ (pointwise_relation _ eq) ==> forall_relation (fun _ => eq))
+ (list_caset A (fun _ => P))).
+Admitted.
+
+Goal forall (Char : Type) (P : forall _ : list bool, Prop) (l : list bool) (l0 : forall _ : forall _ : Char, bool, list bool)
+
+ (T : Type) (T0 : forall _ : T, Type) (t : T),
+
+ let predata := t in
+
+ forall (splitdata : T0 predata) (l5 : forall _ : T0 t, list nat) (T1 : Type) (b : forall (_ : T1) (_ : Char), bool)
+
+ (T2 : Type) (a11 : T2) (xs : list T2) (T3 : Type) (i0 : T3) (P0 : Set) (b1 : forall (_ : nat) (_ : P0), bool)
+
+ (l2 : forall (_ : forall _ : T1, list bool) (_ : forall _ : P0, list bool) (_ : T2), list bool)
+
+ (l1 : forall (_ : forall _ : forall _ : Char, bool, list bool) (_ : forall _ : P0, list bool) (_ : T3), list bool)
+
+ (_ : forall NT : forall _ : P0, list bool, @eq (list bool) (l1 l0 NT i0) (l2 (fun f : T1 => l0 (b f)) NT a11)),
+
+ P
+ (@list_caset T2 (fun _ : list T2 => list bool) l
+ (fun (_ : T2) (_ : list T2) => l1 l0 (fun a9 : P0 => @map nat bool (fun x0 : nat => b1 x0 a9) (l5 splitdata)) i0
+) xs).
+ intros.
+ subst predata;
+ let H := match goal with H : forall _, _ = _ |- _ => H end in
+ setoid_rewrite H || fail 0 "too early".
+ Undo.
+ setoid_rewrite H.
diff --git a/test-suite/bugs/closed/4679.v b/test-suite/bugs/closed/4679.v
new file mode 100644
index 00000000..c94fa31a
--- /dev/null
+++ b/test-suite/bugs/closed/4679.v
@@ -0,0 +1,18 @@
+Require Import Coq.Setoids.Setoid.
+Goal forall (T : nat -> Set -> Set) (U : Set)
+ (H : forall n : nat, T n (match n with
+ | 0 => fun x => x
+ | S _ => fun x => x
+ end (nat = nat)) = U),
+ T 0 (nat = nat) = U.
+Proof.
+ intros.
+ let H := match goal with H : forall _, eq _ _ |- _ => H end in
+ rewrite H || fail 0 "too early".
+ Undo.
+ let H := match goal with H : forall _, eq _ _ |- _ => H end in
+ setoid_rewrite (H 0) || fail 0 "too early".
+ Undo.
+ setoid_rewrite H. (* Error: Tactic failure: setoid rewrite failed: Nothing to rewrite. *)
+ reflexivity.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4684.v b/test-suite/bugs/closed/4684.v
new file mode 100644
index 00000000..9c0bed42
--- /dev/null
+++ b/test-suite/bugs/closed/4684.v
@@ -0,0 +1,32 @@
+(*Suppose a user wants to declare a new list-like notation with support for singletons in both 8.4 and 8.5. If they use*)
+Require Import Coq.Lists.List.
+Require Import Coq.Vectors.Vector.
+Import ListNotations.
+Import VectorNotations.
+Set Implicit Arguments.
+Inductive mylist T := mynil | mycons (_ : T) (_ : mylist T).
+Arguments mynil {_}, _.
+
+Delimit Scope mylist_scope with mylist.
+Bind Scope mylist_scope with mylist.
+Delimit Scope vector_scope with vector.
+
+Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
+Notation " [ x ] " := (mycons x mynil) : mylist_scope.
+Notation " [ x ; y ; .. ; z ] " := (mycons x (mycons y .. (mycons z mynil) ..)) : mylist_scope.
+
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+Check []%vector : Vector.t _ _.
+Check [ _ ]%mylist : mylist _.
+Check [ _ ]%list : list _.
+Check [ _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%list : list _.
+Check [ _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ; _ ]%mylist : mylist _.
diff --git a/test-suite/bugs/closed/4695.v b/test-suite/bugs/closed/4695.v
new file mode 100644
index 00000000..a4227181
--- /dev/null
+++ b/test-suite/bugs/closed/4695.v
@@ -0,0 +1,38 @@
+(*
+The Qed at the end of this file was slow in 8.5 and 8.5pl1 because the kernel
+term comparison after evaluation was done on constants according to their user
+names. The conversion still succeeded because delta applied, but was much
+slower than with a canonical names comparison.
+*)
+
+Module Mod0.
+
+ Fixpoint rec_ t d : nat :=
+ match d with
+ | O => O
+ | S d' =>
+ match t with
+ | true => rec_ t d'
+ | false => rec_ t d'
+ end
+ end.
+
+ Definition depth := 1000.
+
+ Definition rec t := rec_ t depth.
+
+End Mod0.
+
+
+Module Mod1.
+ Module M := Mod0.
+End Mod1.
+
+
+Axiom rec_prop : forall t d n, Mod1.M.rec_ t d = n.
+
+Lemma slow_qed : forall t n,
+ Mod0.rec t = n.
+Proof.
+ intros; unfold Mod0.rec; apply rec_prop.
+Timeout 2 Qed.
diff --git a/test-suite/bugs/closed/4708.v b/test-suite/bugs/closed/4708.v
new file mode 100644
index 00000000..ad2e5810
--- /dev/null
+++ b/test-suite/bugs/closed/4708.v
@@ -0,0 +1,8 @@
+(*Doc, it hurts when I poke myself.*)
+
+Notation "'" := 1. (* was:
+Setting notation at level 0.
+Toplevel input, characters 0-18:
+> Notation "'" := 1.
+> ^^^^^^^^^^^^^^^^^^
+Anomaly: Uncaught exception Invalid_argument("index out of bounds"). Please report. *)
diff --git a/test-suite/bugs/closed/4710.v b/test-suite/bugs/closed/4710.v
new file mode 100644
index 00000000..fdc85010
--- /dev/null
+++ b/test-suite/bugs/closed/4710.v
@@ -0,0 +1,12 @@
+Set Primitive Projections.
+Record Foo' := Foo { foo : nat }.
+Extraction foo.
+Record Foo2 (a : nat) := Foo2c { foo2p : nat; foo2b : bool }.
+Extraction Language Ocaml.
+Extraction foo2p.
+
+Definition bla (x : Foo2 0) := foo2p _ x.
+Extraction bla.
+
+Definition bla' (a : nat) (x : Foo2 a) := foo2b _ x.
+Extraction bla'.
diff --git a/test-suite/bugs/closed/4713.v b/test-suite/bugs/closed/4713.v
new file mode 100644
index 00000000..5d4d73be
--- /dev/null
+++ b/test-suite/bugs/closed/4713.v
@@ -0,0 +1,10 @@
+Module Type T.
+ Parameter t : Type.
+End T.
+Module M : T.
+ Definition t := unit.
+End M.
+
+Fail Module Z : T with Module t := M := M.
+Fail Module Z <: T with Module t := M := M.
+Fail Declare Module Z : T with Module t := M.
diff --git a/test-suite/bugs/closed/4718.v b/test-suite/bugs/closed/4718.v
new file mode 100644
index 00000000..12a4e8fc
--- /dev/null
+++ b/test-suite/bugs/closed/4718.v
@@ -0,0 +1,15 @@
+(*Congruence is weaker than reflexivity when it comes to higher level than necessary equalities:*)
+
+Goal @eq Set nat nat.
+congruence.
+Qed.
+
+Goal @eq Type nat nat.
+congruence. (*bug*)
+Qed.
+
+Variable T : Type.
+
+Goal @eq Type T T.
+congruence.
+Qed.
diff --git a/test-suite/bugs/closed/4722.v b/test-suite/bugs/closed/4722.v
new file mode 100644
index 00000000..f047624c
--- /dev/null
+++ b/test-suite/bugs/closed/4722.v
@@ -0,0 +1 @@
+(* -*- coq-prog-args: ("-emacs" "-R" "4722" "Foo") -*- *)
diff --git a/test-suite/bugs/closed/4722/tata b/test-suite/bugs/closed/4722/tata
new file mode 120000
index 00000000..b38e66e7
--- /dev/null
+++ b/test-suite/bugs/closed/4722/tata
@@ -0,0 +1 @@
+toto \ No newline at end of file
diff --git a/test-suite/bugs/closed/4723.v b/test-suite/bugs/closed/4723.v
new file mode 100644
index 00000000..88848121
--- /dev/null
+++ b/test-suite/bugs/closed/4723.v
@@ -0,0 +1,28 @@
+
+Require Coq.Program.Tactics.
+
+Record Matrix (m n : nat).
+
+Definition kp {m n p q: nat} (A: Matrix m n) (B: Matrix p q):
+ Matrix (m*p) (n*q). Admitted.
+
+Fail Program Fact kp_assoc
+ (xr xc yr yc zr zc: nat)
+ (x: Matrix xr xc) (y: Matrix yr yc) (z: Matrix zr zc):
+ kp x (kp y z) = kp (kp x y) z.
+
+Ltac Obligation Tactic := admit.
+Fail Program Fact kp_assoc
+ (xr xc yr yc zr zc: nat)
+ (x: Matrix xr xc) (y: Matrix yr yc) (z: Matrix zr zc):
+ kp x (kp y z) = kp (kp x y) z.
+
+Axiom cheat : forall {A}, A.
+Obligation Tactic := apply cheat.
+
+Program Fact kp_assoc
+ (xr xc yr yc zr zc: nat)
+ (x: Matrix xr xc) (y: Matrix yr yc) (z: Matrix zr zc):
+ kp x (kp y z) = kp (kp x y) z.
+admit.
+Admitted. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4725.v b/test-suite/bugs/closed/4725.v
new file mode 100644
index 00000000..fd5e0fb6
--- /dev/null
+++ b/test-suite/bugs/closed/4725.v
@@ -0,0 +1,38 @@
+Require Import EquivDec Equivalence List Program.
+Require Import Relation_Definitions.
+Import ListNotations.
+Generalizable All Variables.
+
+Fixpoint removeV `{eqDecV : @EqDec V eqV equivV}`(x : V) (l : list V) : list V
+:=
+ match l with
+ | nil => nil
+ | y::tl => if (equiv_dec x y) then removeV x tl else y::(removeV x tl)
+ end.
+
+Lemma remove_le {V:Type}{eqV:relation V}{equivV:@Equivalence V eqV}{eqDecV :
+@EqDec V eqV equivV} (xs : list V) (x : V) :
+ length (removeV x xs) < length (x :: xs).
+ Proof. Admitted.
+
+(* Function version *)
+Set Printing Universes.
+
+Require Import Recdef.
+
+Function nubV {V:Type}{eqV:relation V}{equivV:@Equivalence V eqV}{eqDecV :
+@EqDec V eqV equivV} (l : list V) { measure length l} :=
+ match l with
+ | nil => nil
+ | x::xs => x :: @nubV V eqV equivV eqDecV (removeV x xs)
+ end.
+Proof. intros. apply remove_le. Qed.
+
+(* Program version *)
+
+Program Fixpoint nubV `{eqDecV : @EqDec V eqV equivV} (l : list V)
+ { measure (@length V l) lt } :=
+ match l with
+ | nil => nil
+ | x::xs => x :: @nubV V eqV equivV eqDecV (removeV x xs) _
+ end.
diff --git a/test-suite/bugs/closed/4726.v b/test-suite/bugs/closed/4726.v
new file mode 100644
index 00000000..0037b6fd
--- /dev/null
+++ b/test-suite/bugs/closed/4726.v
@@ -0,0 +1,19 @@
+Set Universe Polymorphism.
+
+Definition le@{i j} : Type@{j} :=
+ (fun A : Type@{j} => A)
+ (unit : Type@{i}).
+Definition eq@{i j} : Type@{j} := let x := le@{i j} in le@{j i}.
+
+Record Inj@{i j} (A : Type@{i}) (B : Type@{j}) : Type@{j} :=
+ { inj : A }.
+
+Monomorphic Universe u1.
+Let ty1 : Type@{u1} := Set.
+Check Inj@{Set u1}.
+(* Would fail with univ inconsistency if the universe was minimized *)
+
+Record Inj'@{i j} (A : Type@{i}) (B : Type@{j}) : Type@{j} :=
+ { inj' : A; foo : Type@{j} := eq@{i j} }.
+Fail Check Inj'@{Set u1}. (* Do not drop constraint i = j *)
+Check Inj'@{Set Set}.
diff --git a/test-suite/bugs/closed/4727.v b/test-suite/bugs/closed/4727.v
new file mode 100644
index 00000000..3854bbff
--- /dev/null
+++ b/test-suite/bugs/closed/4727.v
@@ -0,0 +1,10 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *)
+Goal forall (P : Set) (l : P) (P0 : Set) (w w0 : P0) (T : Type) (a : P * T) (o : P -> option P0),
+ (forall (l1 l2 : P) (w1 : P0), o l1 = Some w1 -> o l2 = Some w1 -> l1 = l2) ->
+ o l = Some w -> o (fst a) = Some w0 -> {w = w0} + {w <> w0} -> False.
+Proof.
+ clear; intros ???????? inj H0 H1 H2.
+ destruct H2; intuition subst.
+ eapply inj in H1; [ | eauto ].
+ progress subst. (* should succeed, used to not succeed *)
+Abort.
diff --git a/test-suite/bugs/closed/4733.v b/test-suite/bugs/closed/4733.v
new file mode 100644
index 00000000..a6ebda61
--- /dev/null
+++ b/test-suite/bugs/closed/4733.v
@@ -0,0 +1,52 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *)
+(*Suppose a user wants to declare a new list-like notation with support for singletons in both 8.4 and 8.5. If they use*)
+Require Import Coq.Lists.List.
+Require Import Coq.Vectors.Vector.
+Import ListNotations.
+Import VectorNotations.
+Set Implicit Arguments.
+Inductive mylist T := mynil | mycons (_ : T) (_ : mylist T).
+Arguments mynil {_}, _.
+
+Delimit Scope mylist_scope with mylist.
+Bind Scope mylist_scope with mylist.
+Delimit Scope vector_scope with vector.
+
+Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
+Notation " [ x ] " := (mycons x mynil) : mylist_scope.
+Notation " [ x ; .. ; y ] " := (mycons x .. (mycons y mynil) ..) : mylist_scope.
+
+(** All of these should work fine in -compat 8.4 mode, just as they do in Coq 8.4. There needs to be a way to specify notations above so that all of these [Check]s go through in both 8.4 and 8.5 *)
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+Check []%vector : Vector.t _ _.
+Check [ _ ]%mylist : mylist _.
+Check [ _ ]%list : list _.
+Check [ _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%list : list _.
+Check [ _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ; _ ]%mylist : mylist _.
+
+Notation " [ x ; y ; .. ; z ] " := (mycons x (mycons y .. (mycons z mynil) ..)) : mylist_scope.
+(* Now these all work, but not so in 8.4. If we get the ability to remove notations, this section can also just be removed. *)
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+Check []%vector : Vector.t _ _.
+Check [ _ ]%mylist : mylist _.
+Check [ _ ]%list : list _.
+Check [ _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%list : list _.
+Check [ _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ; _ ]%mylist : mylist _.
diff --git a/test-suite/bugs/closed/4737.v b/test-suite/bugs/closed/4737.v
new file mode 100644
index 00000000..84ed45e4
--- /dev/null
+++ b/test-suite/bugs/closed/4737.v
@@ -0,0 +1,9 @@
+Goal True.
+Proof.
+exact I; cycle 1.
+Qed.
+
+Goal True.
+Proof.
+exact I; swap 1 2.
+Qed.
diff --git a/test-suite/bugs/closed/4745.v b/test-suite/bugs/closed/4745.v
new file mode 100644
index 00000000..c090125e
--- /dev/null
+++ b/test-suite/bugs/closed/4745.v
@@ -0,0 +1,35 @@
+(*I get an Anomaly in the following code.
+
+```*)
+Require Vector.
+
+Module M.
+ Lemma Vector_map_map :
+ forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n),
+ Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v.
+ Proof.
+ induction v; simpl; auto using f_equal.
+ Qed.
+
+ Lemma Vector_map_map_transparent :
+ forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n),
+ Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v.
+ Proof.
+ induction v; simpl; auto using f_equal.
+ Defined.
+ (* Anomaly: constant not found in kind_of_head: Coq.Vectors.Vector.t_ind. Please report. *)
+
+ (* strangely, explicitly passing the principle to induction works *)
+ Lemma Vector_map_map_transparent' :
+ forall A B C (f : A -> B) (g : B -> C) n (v : Vector.t A n),
+ Vector.map g (Vector.map f v) = Vector.map (fun a => g (f a)) v.
+ Proof.
+ induction v using Vector.t_ind; simpl; auto using f_equal.
+ Defined.
+End M.
+(*```
+
+Changing any of the following things eliminates the Anomaly
+ * moving the lemma out of the module M to the top level
+ * proving the lemma as a Fixpoint instead of using induction
+ * proving the analogous lemma on lists instead of vectors*)
diff --git a/test-suite/bugs/closed/4746.v b/test-suite/bugs/closed/4746.v
new file mode 100644
index 00000000..d64cc6fe
--- /dev/null
+++ b/test-suite/bugs/closed/4746.v
@@ -0,0 +1,14 @@
+Variables P Q : nat -> Prop.
+Variable f : nat -> nat.
+
+Goal forall (x:nat), (forall y, P y -> forall z, Q z -> y=f z -> False) -> False.
+Proof.
+intros.
+ecase H with (3:=eq_refl).
+Abort.
+
+Goal forall (x:nat), (forall y, y=x -> False) -> False.
+Proof.
+intros.
+unshelve ecase H with (1:=eq_refl).
+Qed.
diff --git a/test-suite/bugs/closed/4754.v b/test-suite/bugs/closed/4754.v
new file mode 100644
index 00000000..5bb3cd1b
--- /dev/null
+++ b/test-suite/bugs/closed/4754.v
@@ -0,0 +1,35 @@
+
+Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms.
+Definition f (v : option nat) := match v with
+ | Some k => Some k
+ | None => None
+ end.
+
+Axioms F G : (option nat -> option nat) -> Prop.
+Axiom FG : forall f, f None = None -> F f = G f.
+
+Axiom admit : forall {T}, T.
+
+Existing Instance eq_Reflexive.
+
+Global Instance foo (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl))
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+
+Global Instance bar (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> eq ==> Basics.flip Basics.impl)
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+
+Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k.
+Proof.
+ intro.
+ pose proof (_ : (Proper (_ ==> eq ==> _) and)).
+ setoid_rewrite (FG _ _); [ | reflexivity.. ].
+ Undo.
+ setoid_rewrite (FG _ eq_refl). (* Error: Tactic failure: setoid rewrite failed: Nothing to rewrite. in 8.5 *) Admitted. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4762.v b/test-suite/bugs/closed/4762.v
new file mode 100644
index 00000000..7a87b07a
--- /dev/null
+++ b/test-suite/bugs/closed/4762.v
@@ -0,0 +1,24 @@
+Inductive myand (P Q : Prop) := myconj : P -> Q -> myand P Q.
+
+Lemma foo P Q R : R = myand P Q -> P -> Q -> R.
+Proof. intros ->; constructor; auto. Qed.
+
+Hint Extern 0 (myand _ _) => eapply foo; [reflexivity| |] : test1.
+
+Goal forall P Q R : Prop, P -> Q -> R -> myand P (myand Q R).
+Proof.
+ intros.
+ eauto with test1.
+Qed.
+
+Hint Extern 0 =>
+ match goal with
+ | |- myand _ _ => eapply foo; [reflexivity| |]
+ end : test2.
+
+Goal forall P Q R : Prop, P -> Q -> R -> myand P (myand Q R).
+Proof.
+ intros.
+ eauto with test2. (* works *)
+Qed.
+
diff --git a/test-suite/bugs/closed/4763.v b/test-suite/bugs/closed/4763.v
new file mode 100644
index 00000000..ae8ed0e6
--- /dev/null
+++ b/test-suite/bugs/closed/4763.v
@@ -0,0 +1,13 @@
+Require Import Coq.Arith.Arith Coq.Classes.Morphisms Coq.Classes.RelationClasses.
+Coercion is_true : bool >-> Sortclass.
+Global Instance: Transitive leb.
+Admitted.
+
+Goal forall x y z, leb x y -> leb y z -> True.
+ intros ??? H H'.
+ lazymatch goal with
+ | [ H : is_true (?R ?x ?y), H' : is_true (?R ?y ?z) |- _ ]
+ => pose proof (transitivity H H' : is_true (R x z))
+ end.
+ exact I.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4764.v b/test-suite/bugs/closed/4764.v
new file mode 100644
index 00000000..e545cc1b
--- /dev/null
+++ b/test-suite/bugs/closed/4764.v
@@ -0,0 +1,5 @@
+Notation prop_fun x y := (fun (x : Prop) => y).
+Definition foo := fun (p : Prop) => p.
+Definition bar := fun (_ : Prop) => O.
+Print foo.
+Print bar.
diff --git a/test-suite/bugs/closed/4769.v b/test-suite/bugs/closed/4769.v
new file mode 100644
index 00000000..d87906f3
--- /dev/null
+++ b/test-suite/bugs/closed/4769.v
@@ -0,0 +1,94 @@
+
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-nois" "-R" "." "Top" "-top" "bug_hom_anom_10") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 156 lines to 41 lines, then from 237 lines to 45 lines, then from 163 lines to 66 lines, then from 342 lines to 121 lines, then from 353 lines to 184 lines, then from 343 lines to 255 lines, then from 435 lines to 322 lines, then from 475 lines to 351 lines, then from 442 lines to 377 lines, then from 505 lines to 410 lines, then from 591 lines to 481 lines, then from 596 lines to 535 lines, then from 647 lines to 570 lines, then from 669 lines to 596 lines, then from 687 lines to 620 lines, then from 728 lines to 652 lines, then from 1384 lines to 683 lines, then from 984 lines to 707 lines, then from 1124 lines to 734 lines, then from 775 lines to 738 lines, then from 950 lines to 763 lines, then from 857 lines to 798 lines, then from 983 lines to 752 lines, then from 1598 lines to 859 lines, then from 873 lines to 859 lines, then from 875 lines to 862 lines, then from 901 lines to 863 lines, then from 1047 lines to 865 lines, then from 929 lines to 871 lines, then from 989 lines to 884 lines, then from 900 lines to 884 lines, then from 884 lines to 751 lines, then from 763 lines to 593 lines, then from 482 lines to 232 lines, then from 416 lines to 227 lines, then from 290 lines to 231 lines, then from 348 lines to 235 lines, then from 249 lines to 235 lines, then from 249 lines to 172 lines, then from 186 lines to 172 lines, then from 140 lines to 113 lines, then from 127 lines to 113 lines *) (* coqc version trunk (June 2016) compiled on Jun 2 2016 10:16:20 with OCaml 4.02.3
+ coqtop version trunk (June 2016) *)
+
+Reserved Notation "x -> y" (at level 99, right associativity, y at level 200).
+Reserved Notation "x * y" (at level 40, left associativity).
+Delimit Scope type_scope with type.
+Open Scope type_scope.
+Global Set Universe Polymorphism.
+Notation "A -> B" := (forall (_ : A), B) : type_scope.
+Set Implicit Arguments.
+Global Set Nonrecursive Elimination Schemes.
+Record prod (A B : Type) := pair { fst : A ; snd : B }.
+Notation "x * y" := (prod x y) : type_scope.
+Axiom admit : forall {T}, T.
+Delimit Scope function_scope with function.
+Notation compose := (fun g f x => g (f x)).
+Notation "g 'o' f" := (compose g%function f%function) (at level 40, left associativity) : function_scope.
+Record PreCategory :=
+ Build_PreCategory {
+ object :> Type;
+ morphism : object -> object -> Type;
+ identity : forall x, morphism x x }.
+Bind Scope category_scope with PreCategory.
+Record Functor (C D : PreCategory) := { object_of :> C -> D }.
+Bind Scope functor_scope with Functor.
+Class Isomorphic {C : PreCategory} (s d : C) := {}.
+Definition oppositeC (C : PreCategory) : PreCategory
+ := @Build_PreCategory C (fun s d => morphism C d s) admit.
+Notation "C ^op" := (oppositeC C) (at level 3, format "C '^op'") : category_scope.
+Definition oppositeF C D (F : Functor C D) : Functor C^op D^op
+ := Build_Functor (C^op) (D^op) (object_of F).
+Definition set_cat : PreCategory := @Build_PreCategory Type (fun x y => x -> y) admit.
+Definition prodC (C D : PreCategory) : PreCategory
+ := @Build_PreCategory
+ (C * D)%type
+ (fun s d => (morphism C (fst s) (fst d)
+ * morphism D (snd s) (snd d))%type)
+ admit.
+Infix "*" := prodC : category_scope.
+Section composition.
+ Variables B C D E : PreCategory.
+ Definition composeF (G : Functor D E) (F : Functor C D) : Functor C E := Build_Functor C E (fun c => G (F c)).
+End composition.
+Infix "o" := composeF : functor_scope.
+Definition fstF {C D} : Functor (C * D) C := admit.
+Definition sndF {C D} : Functor (C * D) D := admit.
+Definition prodF C D D' (F : Functor C D) (F' : Functor C D') : Functor C (D * D') := admit.
+Local Infix "*" := prodF : functor_scope.
+Definition pairF C D C' D' (F : Functor C D) (F' : Functor C' D') : Functor (C * C') (D * D')
+ := (F o fstF) * (F' o sndF).
+Section hom_functor.
+ Variable C : PreCategory.
+ Local Notation obj_of c'c :=
+ ((morphism
+ C
+ (fst (c'c : object (C^op * C)))
+ (snd (c'c : object (C^op * C))))).
+ Definition hom_functor : Functor (C^op * C) set_cat
+ := Build_Functor (C^op * C) set_cat (fun c'c => obj_of c'c).
+End hom_functor.
+Definition identityF C : Functor C C := admit.
+Definition functor_category (C D : PreCategory) : PreCategory
+ := @Build_PreCategory (Functor C D) admit admit.
+Local Notation "C -> D" := (functor_category C D) : category_scope.
+Definition NaturalIsomorphism (C D : PreCategory) F G := @Isomorphic (C -> D) F G.
+
+Section Adjunction.
+ Variables C D : PreCategory.
+ Variable F : Functor C D.
+ Variable G : Functor D C.
+
+ Record AdjunctionHom :=
+ {
+ mate_of : @NaturalIsomorphism
+ (prodC (oppositeC C) D)
+ (@set_cat)
+ (@composeF
+ (prodC (oppositeC C) D)
+ (prodC (oppositeC D) D)
+ (@set_cat) (@hom_functor D)
+ (@pairF (oppositeC C)
+ (oppositeC D) D D
+ (@oppositeF C D F) (identityF D)))
+ (@composeF
+ (prodC (oppositeC C) D)
+ (prodC (oppositeC C) C)
+ (@set_cat) (@hom_functor C)
+ (@pairF (oppositeC C)
+ (oppositeC C) D C
+ (identityF (oppositeC C)) G))
+ }.
+End Adjunction. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4772.v b/test-suite/bugs/closed/4772.v
new file mode 100644
index 00000000..c3109fa3
--- /dev/null
+++ b/test-suite/bugs/closed/4772.v
@@ -0,0 +1,6 @@
+
+Record TruncType := BuildTruncType {
+ trunctype_type : Type
+}.
+
+Fail Arguments BuildTruncType _ _ {_}. (* This should fail *)
diff --git a/test-suite/bugs/closed/4780.v b/test-suite/bugs/closed/4780.v
new file mode 100644
index 00000000..4cec4318
--- /dev/null
+++ b/test-suite/bugs/closed/4780.v
@@ -0,0 +1,106 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-R" "." "Top" "-top" "bug_bad_induction_01") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 1889 lines to 144 lines, then from 158 lines to 144 lines *)
+(* coqc version 8.5pl1 (April 2016) compiled on Apr 18 2016 14:48:5 with OCaml 4.02.3
+ coqtop version 8.5pl1 (April 2016) *)
+Axiom proof_admitted : False.
+Tactic Notation "admit" := abstract case proof_admitted.
+Global Set Universe Polymorphism.
+Global Set Asymmetric Patterns.
+Notation "'exists' x .. y , p" := (sigT (fun x => .. (sigT (fun y => p)) ..))
+ (at level 200, x binder, right associativity,
+ format "'[' 'exists' '/ ' x .. y , '/ ' p ']'")
+ : type_scope.
+Definition relation (A : Type) := A -> A -> Type.
+Class Transitive {A} (R : relation A) := transitivity : forall x y z, R x y -> R y z -> R x z.
+Tactic Notation "etransitivity" open_constr(y) :=
+ let R := match goal with |- ?R ?x ?z => constr:(R) end in
+ let x := match goal with |- ?R ?x ?z => constr:(x) end in
+ let z := match goal with |- ?R ?x ?z => constr:(z) end in
+ refine (@transitivity _ R _ x y z _ _).
+Tactic Notation "etransitivity" := etransitivity _.
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation pr1 := projT1.
+Notation pr2 := projT2.
+Notation "x .1" := (projT1 x) (at level 3) : fibration_scope.
+Notation "x .2" := (projT2 x) (at level 3) : fibration_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a.
+Arguments idpath {A a} , [A] a.
+Arguments paths_rect [A] a P f y p.
+Notation "x = y :> A" := (@paths A x y) : type_scope.
+Notation "x = y" := (x = y :>_) : type_scope.
+Delimit Scope path_scope with path.
+Local Open Scope path_scope.
+Definition concat {A : Type} {x y z : A} (p : x = y) (q : y = z) : x = z :=
+ match p, q with idpath, idpath => idpath end.
+Instance transitive_paths {A} : Transitive (@paths A) | 0 := @concat A.
+Definition inverse {A : Type} {x y : A} (p : x = y) : y = x
+ := match p with idpath => idpath end.
+Notation "1" := idpath : path_scope.
+Notation "p @ q" := (concat p q) (at level 20) : path_scope.
+Notation "p ^" := (inverse p) (at level 3) : path_scope.
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x) : P y :=
+ match p with idpath => u end.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only parsing) : path_scope.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with idpath => idpath end.
+Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y):
+ p # (f x) = f y
+ := match p with idpath => idpath end.
+Lemma transport_compose {A B} {x y : A} (P : B -> Type) (f : A -> B)
+ (p : x = y) (z : P (f x))
+ : transport (fun x => P (f x)) p z = transport P (ap f p) z.
+admit.
+Defined.
+Local Open Scope path_scope.
+Generalizable Variables X A B C f g n.
+Definition path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (pq : {p : u.1 = v.1 & p # u.2 = v.2})
+ : u = v
+ := match pq with
+ | existT p q =>
+ match u, v return (forall p0 : (u.1 = v.1), (p0 # u.2 = v.2) -> (u=v)) with
+ | (x;y), (x';y') => fun p1 q1 =>
+ match p1 in (_ = x'') return (forall y'', (p1 # y = y'') -> (x;y)=(x'';y'')) with
+ | idpath => fun y' q2 =>
+ match q2 in (_ = y'') return (x;y) = (x;y'') with
+ | idpath => 1
+ end
+ end y' q1
+ end p q
+ end.
+Definition path_sigma {A : Type} (P : A -> Type) (u v : sigT P)
+ (p : u.1 = v.1) (q : p # u.2 = v.2)
+ : u = v
+ := path_sigma_uncurried P u v (p;q).
+Definition projT1_path `{P : A -> Type} {u v : sigT P} (p : u = v)
+ : u.1 = v.1
+ :=
+ ap (@projT1 _ _) p.
+Notation "p ..1" := (projT1_path p) (at level 3) : fibration_scope.
+Definition projT2_path `{P : A -> Type} {u v : sigT P} (p : u = v)
+ : p..1 # u.2 = v.2
+ := (transport_compose P (@projT1 _ _) p u.2)^
+ @ (@apD {x:A & P x} _ (@projT2 _ _) _ _ p).
+Notation "p ..2" := (projT2_path p) (at level 3) : fibration_scope.
+Definition eta_path_sigma_uncurried `{P : A -> Type} {u v : sigT P}
+ (p : u = v)
+ : path_sigma_uncurried _ _ _ (p..1; p..2) = p.
+admit.
+Defined.
+Definition eta_path_sigma `{P : A -> Type} {u v : sigT P} (p : u = v)
+ : path_sigma _ _ _ (p..1) (p..2) = p
+ := eta_path_sigma_uncurried p.
+
+Definition path_path_sigma_uncurried {A : Type} (P : A -> Type) (u v : sigT P)
+ (p q : u = v)
+ (rs : {r : p..1 = q..1 & transport (fun x => transport P x u.2 = v.2) r p..2 = q..2})
+ : p = q.
+Proof.
+ destruct rs, p, u.
+ etransitivity; [ | apply eta_path_sigma ].
+ simpl in *.
+ induction p0.
+ admit.
+Defined.
+
diff --git a/test-suite/bugs/closed/4782.v b/test-suite/bugs/closed/4782.v
new file mode 100644
index 00000000..dbd71035
--- /dev/null
+++ b/test-suite/bugs/closed/4782.v
@@ -0,0 +1,24 @@
+(* About typing of with bindings *)
+
+Record r : Type := mk_r { type : Type; cond : type -> Prop }.
+
+Inductive p : Prop := consp : forall (e : r) (x : type e), cond e x -> p.
+
+Goal p.
+Fail apply consp with (fun _ : bool => mk_r unit (fun x => True)) nil.
+
+(* A simplification of an example from coquelicot, which was failing
+ at some time after a fix #4782 was committed. *)
+
+Record T := { dom : Type }.
+Definition pairT A B := {| dom := (dom A * dom B)%type |}.
+Class C (A:Type).
+Parameter B:T.
+Instance c (A:T) : C (dom A).
+Instance cn : C (dom B).
+Parameter F : forall A:T, C (dom A) -> forall x:dom A, x=x -> A = A.
+Set Typeclasses Debug.
+Goal forall (A:T) (x:dom A), pairT A A = pairT A A.
+intros.
+apply (F _ _) with (x,x).
+
diff --git a/test-suite/bugs/closed/4785.v b/test-suite/bugs/closed/4785.v
new file mode 100644
index 00000000..c3c97d3f
--- /dev/null
+++ b/test-suite/bugs/closed/4785.v
@@ -0,0 +1,45 @@
+Require Coq.Lists.List Coq.Vectors.Vector.
+Require Coq.Compat.Coq85.
+
+Module A.
+Import Coq.Lists.List Coq.Vectors.Vector.
+Import ListNotations.
+Check [ ]%list : list _.
+Import VectorNotations ListNotations.
+Delimit Scope vector_scope with vector.
+Check [ ]%vector : Vector.t _ _.
+Check []%vector : Vector.t _ _.
+Check [ ]%list : list _.
+Check []%list : list _.
+
+Goal True.
+ idtac; []. (* Check that vector notations don't break the [ | .. | ] syntax of Ltac *)
+Abort.
+
+Inductive mylist A := mynil | mycons (x : A) (xs : mylist A).
+Delimit Scope mylist_scope with mylist.
+Bind Scope mylist_scope with mylist.
+Arguments mynil {_}, _.
+Arguments mycons {_} _ _.
+Notation " [] " := mynil (compat "8.5") : mylist_scope.
+Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
+Notation " [ x ] " := (mycons x nil) : mylist_scope.
+Notation " [ x ; y ; .. ; z ] " := (mycons x (mycons y .. (mycons z nil) ..)) : mylist_scope.
+
+Import Coq.Compat.Coq85.
+Locate Module VectorNotations.
+Import VectorDef.VectorNotations.
+
+Check []%vector : Vector.t _ _.
+Check []%mylist : mylist _.
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+End A.
+
+Module B.
+Import Coq.Compat.Coq85.
+
+Goal True.
+ idtac; []. (* Check that importing the compat file doesn't break the [ | .. | ] syntax of Ltac *)
+Abort.
+End B.
diff --git a/test-suite/bugs/closed/4785_compat_85.v b/test-suite/bugs/closed/4785_compat_85.v
new file mode 100644
index 00000000..9d65840a
--- /dev/null
+++ b/test-suite/bugs/closed/4785_compat_85.v
@@ -0,0 +1,46 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.5") -*- *)
+Require Coq.Lists.List Coq.Vectors.Vector.
+Require Coq.Compat.Coq85.
+
+Module A.
+Import Coq.Lists.List Coq.Vectors.Vector.
+Import ListNotations.
+Check [ ]%list : list _.
+Import VectorNotations ListNotations.
+Delimit Scope vector_scope with vector.
+Check [ ]%vector : Vector.t _ _.
+Check []%vector : Vector.t _ _.
+Check [ ]%list : list _.
+Fail Check []%list : list _.
+
+Goal True.
+ idtac; [ ]. (* Note that vector notations break the [ | .. | ] syntax of Ltac *)
+Abort.
+
+Inductive mylist A := mynil | mycons (x : A) (xs : mylist A).
+Delimit Scope mylist_scope with mylist.
+Bind Scope mylist_scope with mylist.
+Arguments mynil {_}, _.
+Arguments mycons {_} _ _.
+Notation " [] " := mynil (compat "8.5") : mylist_scope.
+Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
+Notation " [ x ] " := (mycons x nil) : mylist_scope.
+Notation " [ x ; y ; .. ; z ] " := (mycons x (mycons y .. (mycons z nil) ..)) : mylist_scope.
+
+Import Coq.Compat.Coq85.
+Locate Module VectorNotations.
+Import VectorDef.VectorNotations.
+
+Check []%vector : Vector.t _ _.
+Check []%mylist : mylist _.
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+End A.
+
+Module B.
+Import Coq.Compat.Coq85.
+
+Goal True.
+ idtac; []. (* Check that importing the compat file doesn't break the [ | .. | ] syntax of Ltac *)
+Abort.
+End B.
diff --git a/test-suite/bugs/closed/4787.v b/test-suite/bugs/closed/4787.v
new file mode 100644
index 00000000..b586cba5
--- /dev/null
+++ b/test-suite/bugs/closed/4787.v
@@ -0,0 +1,9 @@
+(* [Unset Bracketing Last Introduction Pattern] was not working *)
+
+Unset Bracketing Last Introduction Pattern.
+
+Goal forall T (x y : T * T), fst x = fst y /\ snd x = snd y -> x = y.
+do 10 ((intros [] || intro); simpl); reflexivity.
+Qed.
+
+
diff --git a/test-suite/bugs/closed/4798.v b/test-suite/bugs/closed/4798.v
new file mode 100644
index 00000000..dbc3d46f
--- /dev/null
+++ b/test-suite/bugs/closed/4798.v
@@ -0,0 +1,3 @@
+Check match 2 with 0 => 0 | S n => n end.
+Notation "|" := 1 (compat "8.4").
+Check match 2 with 0 => 0 | S n => n end. (* fails *)
diff --git a/test-suite/bugs/closed/4811.v b/test-suite/bugs/closed/4811.v
new file mode 100644
index 00000000..a9149626
--- /dev/null
+++ b/test-suite/bugs/closed/4811.v
@@ -0,0 +1,1685 @@
+(* Test about a slowness of f_equal in 8.5pl1 *)
+
+(* Submitted by Jason Gross *)
+
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-R" "src" "Crypto" "-R" "Bedrock" "Bedrock" "-R" "coqprime-8.5/Coqprime" "Coqprime" "-top" "GF255192") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 162 lines to 23 lines, then from 245 lines to 95 lines, then from 198 lines to 101 lines, then from 654 lines to 452 lines, then from 591 lines to 505 lines, then from 1770 lines to 580 lines, then from 2238 lines to 1715 lines, then from 1776 lines to 1738 lines, then from 1750 lines to 1679 lines, then from 1693 lines to 1679 lines *)
+(* coqc version 8.5pl1 (April 2016) compiled on Apr 18 2016 14:48:5 with OCaml 4.02.3
+ coqtop version 8.5pl1 (April 2016) *)
+Require Coq.ZArith.ZArith.
+
+Import Coq.ZArith.ZArith.
+
+Axiom F : Z -> Set.
+Definition Let_In {A P} (x : A) (f : forall y : A, P y)
+ := let y := x in f y.
+Local Open Scope Z_scope.
+Definition modulus : Z := 2^255 - 19.
+Axiom decode : list Z -> F modulus.
+Goal forall x9 x8 x7 x6 x5 x4 x3 x2 x1 x0 y9 y8 y7 y6 y5 y4 y3 y2 y1 y0 : Z,
+ let Zmul := Z.mul in
+ let Zadd := Z.add in
+ let Zsub := Z.sub in
+ let Zpow_pos := Z.pow_pos in
+ @eq (F (Zsub (Zpow_pos (Zpos (xO xH)) (xI (xI (xI (xI (xI (xI (xI xH)))))))) (Zpos (xI (xI (xO (xO xH)))))))
+ (@decode
+ (@Let_In Z (fun _ : Z => list Z)
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2)) (Zmul (Zmul x7 y3) (Zpos (xO xH))))
+ (Zmul x6 y4)) (Zmul (Zmul x5 y5) (Zpos (xO xH)))) (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH)))) (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (fun z : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4)) (Zmul x6 y5)) (Zmul x5 y6))
+ (Zmul x4 y7)) (Zmul x3 y8)) (Zmul x2 y9)))))
+ (fun z0 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z0 (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH)))) (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH))) (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH)))) (Zmul x6 y6)) (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (fun z1 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z1 (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6)) (Zmul x6 y7)) (Zmul x5 y8))
+ (Zmul x4 y9)))))
+ (fun z2 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z2 (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH)))) (Zmul x2 y2))
+ (Zmul (Zmul x1 y3) (Zpos (xO xH)))) (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH)))) (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (fun z3 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z3 (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2)) (Zmul x2 y3)) (Zmul x1 y4))
+ (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8)) (Zmul x6 y9)))))
+ (fun z4 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z4 (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH)))) (Zmul x4 y2))
+ (Zmul (Zmul x3 y3) (Zpos (xO xH)))) (Zmul x2 y4)) (Zmul (Zmul x1 y5) (Zpos (xO xH))))
+ (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH)))))))
+ (fun z5 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z5 (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2)) (Zmul x4 y3))
+ (Zmul x3 y4)) (Zmul x2 y5)) (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (fun z6 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z6 (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x8 y0) (Zmul (Zmul x7 y1) (Zpos (xO xH)))) (Zmul x6 y2))
+ (Zmul (Zmul x5 y3) (Zpos (xO xH)))) (Zmul x4 y4))
+ (Zmul (Zmul x3 y5) (Zpos (xO xH)))) (Zmul x2 y6))
+ (Zmul (Zmul x1 y7) (Zpos (xO xH)))) (Zmul x0 y8))
+ (Zmul (Zmul (Zmul (Zpos (xI (xI (xO (xO xH))))) x9) y9) (Zpos (xO xH)))))
+ (fun z7 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Z.shiftr z7 (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y0) (Zmul x8 y1)) (Zmul x7 y2)) (Zmul x6 y3))
+ (Zmul x5 y4)) (Zmul x4 y5)) (Zmul x3 y6)) (Zmul x2 y7))
+ (Zmul x1 y8)) (Zmul x0 y9)))
+ (fun z8 : Z =>
+ @Let_In Z (fun _ : Z => list Z)
+ (Zadd (Zmul (Zpos (xI (xI (xO (xO xH))))) (Z.shiftr z8 (Zpos (xI (xO (xO (xI xH)))))))
+ (Z.land z
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))))
+ (fun z9 : Z =>
+ @cons Z
+ (Z.land z9
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Zadd (Z.shiftr z9 (Zpos (xO (xI (xO (xI xH))))))
+ (Z.land z0
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z1
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z2
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z3
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z4
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z5
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z6
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z7
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land z8
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@nil Z)))))))))))))))))))))))
+ (@decode
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y1)
+ (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul
+ (Zmul x7 y3)
+ (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8))
+ (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x9 y2) (Zmul x8 y3))
+ (Zmul x7 y4))
+ (Zmul x6 y5))
+ (Zmul x5 y6))
+ (Zmul x4 y7)) (Zmul x3 y8))
+ (Zmul x2 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH)))
+ (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2))
+ (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6))
+ (Zmul x6 y7)) (Zmul x5 y8))
+ (Zmul x4 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH))))
+ (Zmul x2 y2)) (Zmul (Zmul x1 y3) (Zpos (xO xH))))
+ (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH))))
+ (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2)) (Zmul x2 y3))
+ (Zmul x1 y4)) (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8)) (Zmul x6 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH)))) (Zmul x4 y2))
+ (Zmul (Zmul x3 y3) (Zpos (xO xH)))) (Zmul x2 y4))
+ (Zmul (Zmul x1 y5) (Zpos (xO xH)))) (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2)) (Zmul x4 y3))
+ (Zmul x3 y4)) (Zmul x2 y5)) (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x8 y0) (Zmul (Zmul x7 y1) (Zpos (xO xH)))) (Zmul x6 y2))
+ (Zmul (Zmul x5 y3) (Zpos (xO xH)))) (Zmul x4 y4))
+ (Zmul (Zmul x3 y5) (Zpos (xO xH)))) (Zmul x2 y6)) (Zmul (Zmul x1 y7) (Zpos (xO xH))))
+ (Zmul x0 y8)) (Zmul (Zmul (Zmul (Zpos (xI (xI (xO (xO xH))))) x9) y9) (Zpos (xO xH)))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y0) (Zmul x8 y1)) (Zmul x7 y2)) (Zmul x6 y3)) (Zmul x5 y4))
+ (Zmul x4 y5)) (Zmul x3 y6)) (Zmul x2 y7)) (Zmul x1 y8)) (Zmul x0 y9)))
+ (Zpos (xI (xO (xO (xI xH)))))))
+ (Z.land
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH)))) (Zmul x6 y4)) (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH)))) (Zmul x2 y8))
+ (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y1)
+ (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul
+ (Zmul x7 y3)
+ (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul
+ (Zmul x5 y5)
+ (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8))
+ (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul x9 y2)
+ (Zmul x8 y3))
+ (Zmul x7 y4))
+ (Zmul x6 y5))
+ (Zmul x5 y6))
+ (Zmul x4 y7))
+ (Zmul x3 y8))
+ (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x2 y0)
+ (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul (Zmul x9 y3) (Zpos (xO xH)))
+ (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8))
+ (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2))
+ (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5))
+ (Zmul x7 y6)) (Zmul x6 y7))
+ (Zmul x5 y8)) (Zmul x4 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH))))
+ (Zmul x2 y2)) (Zmul (Zmul x1 y3) (Zpos (xO xH))))
+ (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH))))
+ (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2))
+ (Zmul x2 y3)) (Zmul x1 y4)) (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8))
+ (Zmul x6 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH))))
+ (Zmul x4 y2)) (Zmul (Zmul x3 y3) (Zpos (xO xH))))
+ (Zmul x2 y4)) (Zmul (Zmul x1 y5) (Zpos (xO xH))))
+ (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2)) (Zmul x4 y3))
+ (Zmul x3 y4)) (Zmul x2 y5)) (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x8 y0) (Zmul (Zmul x7 y1) (Zpos (xO xH)))) (Zmul x6 y2))
+ (Zmul (Zmul x5 y3) (Zpos (xO xH)))) (Zmul x4 y4))
+ (Zmul (Zmul x3 y5) (Zpos (xO xH)))) (Zmul x2 y6))
+ (Zmul (Zmul x1 y7) (Zpos (xO xH)))) (Zmul x0 y8))
+ (Zmul (Zmul (Zmul (Zpos (xI (xI (xO (xO xH))))) x9) y9) (Zpos (xO xH)))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y0) (Zmul x8 y1)) (Zmul x7 y2)) (Zmul x6 y3))
+ (Zmul x5 y4)) (Zmul x4 y5)) (Zmul x3 y6)) (Zmul x2 y7))
+ (Zmul x1 y8)) (Zmul x0 y9))) (Zpos (xI (xO (xO (xI xH)))))))
+ (Z.land
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH)))) (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH)))) (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH)))) (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH)))) (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH)))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4)) (Zmul x6 y5)) (Zmul x5 y6))
+ (Zmul x4 y7)) (Zmul x3 y8)) (Zmul x2 y9)))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH)))) (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH)))) (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH)))) (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4)) (Zmul x6 y5))
+ (Zmul x5 y6)) (Zmul x4 y7)) (Zmul x3 y8)) (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH)))) (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH))) (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH)))) (Zmul x6 y6)) (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH))))
+ (Zmul x6 y4)) (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4)) (Zmul x6 y5))
+ (Zmul x5 y6)) (Zmul x4 y7)) (Zmul x3 y8)) (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH)))) (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH))) (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH)))) (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH)))) (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6)) (Zmul x6 y7)) (Zmul x5 y8))
+ (Zmul x4 y9)))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH))) (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH))))
+ (Zmul x6 y4)) (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4))
+ (Zmul x6 y5)) (Zmul x5 y6)) (Zmul x4 y7))
+ (Zmul x3 y8)) (Zmul x2 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH)))) (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH))) (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH)))) (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH)))) (Zmul x4 y8))
+ (Zmul (Zmul x3 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6)) (Zmul x6 y7))
+ (Zmul x5 y8)) (Zmul x4 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH)))) (Zmul x2 y2))
+ (Zmul (Zmul x1 y3) (Zpos (xO xH)))) (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH)))) (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y1) (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH))))
+ (Zmul x6 y4)) (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6)) (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3)) (Zmul x7 y4))
+ (Zmul x6 y5)) (Zmul x5 y6))
+ (Zmul x4 y7)) (Zmul x3 y8)) (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH)))) (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH))) (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6)) (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6)) (Zmul x6 y7))
+ (Zmul x5 y8)) (Zmul x4 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH)))) (Zmul x2 y2))
+ (Zmul (Zmul x1 y3) (Zpos (xO xH)))) (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH)))) (Zmul x6 y8))
+ (Zmul (Zmul x5 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2)) (Zmul x2 y3)) (Zmul x1 y4))
+ (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8)) (Zmul x6 y9)))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul (Zmul x9 y1) (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul (Zmul x7 y3) (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8)) (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x9 y2) (Zmul x8 y3))
+ (Zmul x7 y4)) (Zmul x6 y5))
+ (Zmul x5 y6)) (Zmul x4 y7))
+ (Zmul x3 y8)) (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH)))
+ (Zmul x8 y4)) (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6)) (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6))
+ (Zmul x6 y7)) (Zmul x5 y8)) (Zmul x4 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH)))) (Zmul x2 y2))
+ (Zmul (Zmul x1 y3) (Zpos (xO xH)))) (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH)))) (Zmul x6 y8))
+ (Zmul (Zmul x5 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2)) (Zmul x2 y3))
+ (Zmul x1 y4)) (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8)) (Zmul x6 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH)))) (Zmul x4 y2))
+ (Zmul (Zmul x3 y3) (Zpos (xO xH)))) (Zmul x2 y4))
+ (Zmul (Zmul x1 y5) (Zpos (xO xH)))) (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH)))))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y1)
+ (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul
+ (Zmul x7 y3)
+ (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul (Zmul x5 y5) (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul (Zmul x3 y7) (Zpos (xO xH))))
+ (Zmul x2 y8))
+ (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x9 y2) (Zmul x8 y3))
+ (Zmul x7 y4))
+ (Zmul x6 y5))
+ (Zmul x5 y6))
+ (Zmul x4 y7)) (Zmul x3 y8))
+ (Zmul x2 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zmul x2 y0) (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y3) (Zpos (xO xH)))
+ (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8)) (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2))
+ (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5)) (Zmul x7 y6))
+ (Zmul x6 y7)) (Zmul x5 y8))
+ (Zmul x4 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH))))
+ (Zmul x2 y2)) (Zmul (Zmul x1 y3) (Zpos (xO xH))))
+ (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH))) (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH))))
+ (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2)) (Zmul x2 y3))
+ (Zmul x1 y4)) (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8)) (Zmul x6 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH)))) (Zmul x4 y2))
+ (Zmul (Zmul x3 y3) (Zpos (xO xH)))) (Zmul x2 y4))
+ (Zmul (Zmul x1 y5) (Zpos (xO xH)))) (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2)) (Zmul x4 y3))
+ (Zmul x3 y4)) (Zmul x2 y5)) (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y1)
+ (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul
+ (Zmul x7 y3)
+ (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul
+ (Zmul x5 y5)
+ (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul
+ (Zmul x3 y7)
+ (Zpos (xO xH))))
+ (Zmul x2 y8))
+ (Zmul (Zmul x1 y9) (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul x9 y2)
+ (Zmul x8 y3))
+ (Zmul x7 y4))
+ (Zmul x6 y5))
+ (Zmul x5 y6))
+ (Zmul x4 y7))
+ (Zmul x3 y8))
+ (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x2 y0)
+ (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y3)
+ (Zpos (xO xH)))
+ (Zmul x8 y4))
+ (Zmul (Zmul x7 y5) (Zpos (xO xH))))
+ (Zmul x6 y6))
+ (Zmul (Zmul x5 y7) (Zpos (xO xH))))
+ (Zmul x4 y8))
+ (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1)) (Zmul x1 y2))
+ (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x9 y4) (Zmul x8 y5))
+ (Zmul x7 y6)) (Zmul x6 y7))
+ (Zmul x5 y8)) (Zmul x4 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x4 y0) (Zmul (Zmul x3 y1) (Zpos (xO xH))))
+ (Zmul x2 y2)) (Zmul (Zmul x1 y3) (Zpos (xO xH))))
+ (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH)))
+ (Zmul x8 y6)) (Zmul (Zmul x7 y7) (Zpos (xO xH))))
+ (Zmul x6 y8)) (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2))
+ (Zmul x2 y3)) (Zmul x1 y4)) (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8))
+ (Zmul x6 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x6 y0) (Zmul (Zmul x5 y1) (Zpos (xO xH))))
+ (Zmul x4 y2)) (Zmul (Zmul x3 y3) (Zpos (xO xH))))
+ (Zmul x2 y4)) (Zmul (Zmul x1 y5) (Zpos (xO xH))))
+ (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH))))))) (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2))
+ (Zmul x4 y3)) (Zmul x3 y4)) (Zmul x2 y5))
+ (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x8 y0) (Zmul (Zmul x7 y1) (Zpos (xO xH))))
+ (Zmul x6 y2)) (Zmul (Zmul x5 y3) (Zpos (xO xH))))
+ (Zmul x4 y4)) (Zmul (Zmul x3 y5) (Zpos (xO xH))))
+ (Zmul x2 y6)) (Zmul (Zmul x1 y7) (Zpos (xO xH)))) (Zmul x0 y8))
+ (Zmul (Zmul (Zmul (Zpos (xI (xI (xO (xO xH))))) x9) y9) (Zpos (xO xH)))))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI xH)))))))))))))))))))))))))))
+ (@cons Z
+ (Z.land
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd
+ (Z.shiftr
+ (Zadd (Zmul x0 y0)
+ (Zmul
+ (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y1)
+ (Zpos (xO xH)))
+ (Zmul x8 y2))
+ (Zmul
+ (Zmul x7 y3)
+ (Zpos (xO xH))))
+ (Zmul x6 y4))
+ (Zmul
+ (Zmul x5 y5)
+ (Zpos (xO xH))))
+ (Zmul x4 y6))
+ (Zmul
+ (Zmul x3 y7)
+ (Zpos (xO xH))))
+ (Zmul x2 y8))
+ (Zmul
+ (Zmul x1 y9)
+ (Zpos (xO xH))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd (Zadd (Zmul x1 y0) (Zmul x0 y1))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul x9 y2)
+ (Zmul x8 y3))
+ (Zmul x7 y4))
+ (Zmul x6 y5))
+ (Zmul x5 y6))
+ (Zmul x4 y7))
+ (Zmul x3 y8))
+ (Zmul x2 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x2 y0)
+ (Zmul (Zmul x1 y1) (Zpos (xO xH))))
+ (Zmul x0 y2))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zmul
+ (Zmul x9 y3)
+ (Zpos (xO xH)))
+ (Zmul x8 y4))
+ (Zmul
+ (Zmul x7 y5)
+ (Zpos (xO xH))))
+ (Zmul x6 y6))
+ (Zmul
+ (Zmul x5 y7)
+ (Zpos (xO xH))))
+ (Zmul x4 y8))
+ (Zmul (Zmul x3 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x3 y0) (Zmul x2 y1))
+ (Zmul x1 y2)) (Zmul x0 y3))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x9 y4) (Zmul x8 y5))
+ (Zmul x7 y6))
+ (Zmul x6 y7))
+ (Zmul x5 y8))
+ (Zmul x4 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x4 y0)
+ (Zmul (Zmul x3 y1) (Zpos (xO xH))))
+ (Zmul x2 y2))
+ (Zmul (Zmul x1 y3) (Zpos (xO xH))))
+ (Zmul x0 y4))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul (Zmul x9 y5) (Zpos (xO xH)))
+ (Zmul x8 y6))
+ (Zmul (Zmul x7 y7) (Zpos (xO xH))))
+ (Zmul x6 y8))
+ (Zmul (Zmul x5 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x5 y0) (Zmul x4 y1)) (Zmul x3 y2))
+ (Zmul x2 y3)) (Zmul x1 y4))
+ (Zmul x0 y5))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zadd (Zmul x9 y6) (Zmul x8 y7)) (Zmul x7 y8))
+ (Zmul x6 y9))))) (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zmul x6 y0)
+ (Zmul (Zmul x5 y1) (Zpos (xO xH))))
+ (Zmul x4 y2)) (Zmul (Zmul x3 y3) (Zpos (xO xH))))
+ (Zmul x2 y4)) (Zmul (Zmul x1 y5) (Zpos (xO xH))))
+ (Zmul x0 y6))
+ (Zmul (Zpos (xI (xI (xO (xO xH)))))
+ (Zadd (Zadd (Zmul (Zmul x9 y7) (Zpos (xO xH))) (Zmul x8 y8))
+ (Zmul (Zmul x7 y9) (Zpos (xO xH)))))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x7 y0) (Zmul x6 y1)) (Zmul x5 y2))
+ (Zmul x4 y3)) (Zmul x3 y4)) (Zmul x2 y5))
+ (Zmul x1 y6)) (Zmul x0 y7))
+ (Zmul (Zpos (xI (xI (xO (xO xH))))) (Zadd (Zmul x9 y8) (Zmul x8 y9)))))
+ (Zpos (xI (xO (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zmul x8 y0) (Zmul (Zmul x7 y1) (Zpos (xO xH))))
+ (Zmul x6 y2)) (Zmul (Zmul x5 y3) (Zpos (xO xH))))
+ (Zmul x4 y4)) (Zmul (Zmul x3 y5) (Zpos (xO xH))))
+ (Zmul x2 y6)) (Zmul (Zmul x1 y7) (Zpos (xO xH))))
+ (Zmul x0 y8))
+ (Zmul (Zmul (Zmul (Zpos (xI (xI (xO (xO xH))))) x9) y9) (Zpos (xO xH)))))
+ (Zpos (xO (xI (xO (xI xH))))))
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd
+ (Zadd (Zadd (Zadd (Zmul x9 y0) (Zmul x8 y1)) (Zmul x7 y2))
+ (Zmul x6 y3)) (Zmul x5 y4)) (Zmul x4 y5))
+ (Zmul x3 y6)) (Zmul x2 y7)) (Zmul x1 y8)) (Zmul x0 y9)))
+ (Zpos
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI
+ (xI (xI (xI (xI (xI (xI (xI xH))))))))))))))))))))))))))
+ (@nil Z)))))))))))).
+ cbv beta zeta.
+ intros.
+ (timeout 1 (apply f_equal; reflexivity)) || fail 0 "too early".
+ Undo.
+ Time Timeout 1 f_equal. (* Finished transaction in 0. secs (0.3u,0.s) in 8.4 *)
diff --git a/test-suite/bugs/closed/4813.v b/test-suite/bugs/closed/4813.v
new file mode 100644
index 00000000..5f8ea74c
--- /dev/null
+++ b/test-suite/bugs/closed/4813.v
@@ -0,0 +1,9 @@
+(* On the strength of "apply with" (see also #4782) *)
+
+Record ProverT := { Facts : Type }.
+Record ProverT_correct (P : ProverT) := { Valid : Facts P -> Prop ;
+ Valid_weaken : Valid = Valid }.
+Definition reflexivityValid (_ : unit) := True.
+Definition reflexivityProver_correct : ProverT_correct {| Facts := unit |}.
+Proof.
+ eapply Build_ProverT_correct with (Valid := reflexivityValid).
diff --git a/test-suite/bugs/closed/4816.v b/test-suite/bugs/closed/4816.v
new file mode 100644
index 00000000..00a52384
--- /dev/null
+++ b/test-suite/bugs/closed/4816.v
@@ -0,0 +1,29 @@
+Section foo.
+Polymorphic Universes A B.
+Fail Constraint A <= B.
+End foo.
+(* gives an anomaly Universe undefined *)
+
+Universes X Y.
+Section Foo.
+ Polymorphic Universes Z W.
+ Polymorphic Constraint W < Z.
+
+ Fail Definition bla := Type@{W}.
+ Polymorphic Definition bla := Type@{W}.
+ Section Bar.
+ Fail Constraint X <= Z.
+ End Bar.
+End Foo.
+
+Require Coq.Classes.RelationClasses.
+
+Class PreOrder (A : Type) (r : A -> A -> Type) : Type :=
+{ refl : forall x, r x x }.
+
+Section qux.
+ Polymorphic Universes A.
+ Section bar.
+ Fail Context {A : Type@{A}} {rA : A -> A -> Prop} {PO : PreOrder A rA}.
+ End bar.
+End qux.
diff --git a/test-suite/bugs/closed/4818.v b/test-suite/bugs/closed/4818.v
new file mode 100644
index 00000000..904abb22
--- /dev/null
+++ b/test-suite/bugs/closed/4818.v
@@ -0,0 +1,24 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-R" "." "Prob" "-top" "Product") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 391 lines to 77 lines, then from 857 lines to 119 lines, then from 1584 lines to 126 lines, then from 362 lines to 135 lines, then from 149 lines to 135 lines *)
+(* coqc version 8.5pl1 (June 2016) compiled on Jun 9 2016 17:27:17 with OCaml 4.02.3
+ coqtop version 8.5pl1 (June 2016) *)
+Set Universe Polymorphism.
+
+Inductive GCov (I : Type) : Type := | Foo : I -> GCov I.
+
+Section Product.
+
+Variables S IS : Type.
+Variable locS : IS -> True.
+
+Goal GCov (IS * S) -> GCov IS.
+intros X0. induction X0; intros.
+destruct i.
+specialize (locS i).
+clear -locS.
+destruct locS. Show Universes.
+Admitted.
+
+(*
+Anomaly: Universe Product.5189 undefined. Please report.
+*)
diff --git a/test-suite/bugs/closed/4858.v b/test-suite/bugs/closed/4858.v
new file mode 100644
index 00000000..a2fa9383
--- /dev/null
+++ b/test-suite/bugs/closed/4858.v
@@ -0,0 +1,7 @@
+Require Import Nsatz.
+Goal True.
+try nsatz_compute
+ (PEc 0%Z :: PEc (-1)%Z
+ :: PEpow (PEsub (PEX Z 2) (PEX Z 3)) 1
+ :: PEsub (PEX Z 1) (PEX Z 1) :: nil).
+Abort.
diff --git a/test-suite/bugs/closed/4863.v b/test-suite/bugs/closed/4863.v
new file mode 100644
index 00000000..1e47f295
--- /dev/null
+++ b/test-suite/bugs/closed/4863.v
@@ -0,0 +1,33 @@
+Require Import Classes.DecidableClass.
+
+Inductive Foo : Set :=
+| foo1 | foo2.
+
+Lemma Decidable_sumbool : forall P, {P}+{~P} -> Decidable P.
+Proof.
+ intros P H.
+ refine (Build_Decidable _ (if H then true else false) _).
+ intuition congruence.
+Qed.
+
+Hint Extern 100 (Decidable (?A = ?B)) => abstract (abstract (abstract (apply Decidable_sumbool; decide equality))) : typeclass_instances.
+
+Goal forall (a b : Foo), {a=b}+{a<>b}.
+intros.
+abstract (abstract (decide equality)). (*abstract works here*)
+Qed.
+
+Check ltac:(abstract (exact I)) : True.
+
+Goal forall (a b : Foo), Decidable (a=b) * Decidable (a=b).
+intros.
+split. typeclasses eauto.
+typeclasses eauto. Qed.
+
+Goal forall (a b : Foo), Decidable (a=b) * Decidable (a=b).
+intros.
+split.
+refine _.
+refine _.
+Defined.
+(*fails*)
diff --git a/test-suite/bugs/closed/4865.v b/test-suite/bugs/closed/4865.v
new file mode 100644
index 00000000..c5bf3289
--- /dev/null
+++ b/test-suite/bugs/closed/4865.v
@@ -0,0 +1,52 @@
+(* Check discharge of arguments scopes + other checks *)
+
+(* This is bug #4865 *)
+
+Notation "<T>" := true : bool_scope.
+Section A.
+ Check negb <T>.
+ Global Arguments negb : clear scopes.
+ Fail Check negb <T>.
+End A.
+
+(* Check that no scope is re-computed *)
+Fail Check negb <T>.
+
+(* Another test about arguments scopes in sections *)
+
+Notation "0" := true.
+Section B.
+ Variable x : nat.
+ Let T := nat -> nat.
+ Definition f y : T := fun z => x + y + z.
+ Fail Check f 1 0. (* 0 in nat, 0 in bool *)
+ Fail Check f 0 0. (* 0 in nat, 0 in bool *)
+ Check f 0 1. (* 0 and 1 in nat *)
+ Global Arguments f _%nat_scope _%nat_scope.
+ Check f 0 0. (* both 0 in nat *)
+End B.
+
+(* Check that only the scope for the extra product on x is re-computed *)
+Check f 0 0 0. (* All 0 in nat *)
+
+Section C.
+ Variable x : nat.
+ Let T := nat -> nat.
+ Definition g y : T := fun z => x + y + z.
+ Global Arguments g : clear scopes.
+ Check g 1. (* 1 in nat *)
+End C.
+
+(* Check that only the scope for the extra product on x is re-computed *)
+Check g 0. (* 0 in nat *)
+Fail Check g 0 1 0. (* 2nd 0 in bool *)
+Fail Check g 0 0 1. (* 2nd 0 in bool *)
+
+(* Another test on arguments scopes: checking scope for expanding arities *)
+(* Not sure this is very useful, but why not *)
+
+Fixpoint arr n := match n with 0%nat => nat | S n => nat -> arr n end.
+Fixpoint lam n : arr n := match n with 0%nat => 0%nat | S n => fun x => lam n end.
+Notation "0" := true.
+Arguments Scope lam [nat_scope nat_scope].
+Check (lam 1 0).
diff --git a/test-suite/bugs/closed/4869.v b/test-suite/bugs/closed/4869.v
new file mode 100644
index 00000000..6d21b66f
--- /dev/null
+++ b/test-suite/bugs/closed/4869.v
@@ -0,0 +1,18 @@
+Universes i.
+
+Fail Constraint i < Set.
+Fail Constraint i <= Set.
+Fail Constraint i = Set.
+Constraint Set <= i.
+Constraint Set < i.
+Fail Constraint i < j. (* undeclared j *)
+Fail Constraint i < Type. (* anonymous *)
+
+Set Universe Polymorphism.
+
+Section Foo.
+ Universe j.
+ Constraint Set < j.
+
+ Definition foo := Type@{j}.
+End Foo. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4873.v b/test-suite/bugs/closed/4873.v
new file mode 100644
index 00000000..f2f917b4
--- /dev/null
+++ b/test-suite/bugs/closed/4873.v
@@ -0,0 +1,72 @@
+Require Import Coq.Classes.Morphisms.
+Require Import Relation_Definitions.
+Require Import Coq.Compat.Coq85.
+
+Fixpoint tuple' T n : Type :=
+ match n with
+ | O => T
+ | S n' => (tuple' T n' * T)%type
+ end.
+
+Definition tuple T n : Type :=
+ match n with
+ | O => unit
+ | S n' => tuple' T n'
+ end.
+
+Fixpoint to_list' {T} (n:nat) {struct n} : tuple' T n -> list T :=
+ match n with
+ | 0 => fun x => (x::nil)%list
+ | S n' => fun xs : tuple' T (S n') => let (xs', x) := xs in (x :: to_list' n' xs')%list
+ end.
+
+Definition to_list {T} (n:nat) : tuple T n -> list T :=
+ match n with
+ | 0 => fun _ => nil
+ | S n' => fun xs : tuple T (S n') => to_list' n' xs
+ end.
+
+Program Fixpoint from_list' {T} (y:T) (n:nat) (xs:list T) : length xs = n -> tuple' T n :=
+ match n return _ with
+ | 0 =>
+ match xs return (length xs = 0 -> tuple' T 0) with
+ | nil => fun _ => y
+ | _ => _ (* impossible *)
+ end
+ | S n' =>
+ match xs return (length xs = S n' -> tuple' T (S n')) with
+ | cons x xs' => fun _ => (from_list' x n' xs' _, y)
+ | _ => _ (* impossible *)
+ end
+ end.
+Goal True.
+ pose from_list'_obligation_3 as e.
+ repeat (let e' := fresh in
+ rename e into e';
+ (pose (e' nat) as e || pose (e' 0) as e || pose (e' nil) as e || pose (e' eq_refl) as e);
+ subst e').
+ progress hnf in e.
+ pose (eq_refl : e = eq_refl).
+ exact I.
+Qed.
+
+Program Definition from_list {T} (n:nat) (xs:list T) : length xs = n -> tuple T n :=
+match n return _ with
+| 0 =>
+ match xs return (length xs = 0 -> tuple T 0) with
+ | nil => fun _ : 0 = 0 => tt
+ | _ => _ (* impossible *)
+ end
+| S n' =>
+ match xs return (length xs = S n' -> tuple T (S n')) with
+ | cons x xs' => fun _ => from_list' x n' xs' _
+ | _ => _ (* impossible *)
+ end
+end.
+
+Lemma to_list_from_list : forall {T} (n:nat) (xs:list T) pf, to_list n (from_list n xs pf) = xs.
+Proof.
+ destruct xs; simpl; intros; subst; auto.
+ generalize dependent t. simpl in *.
+ induction xs; simpl in *; intros; congruence.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4877.v b/test-suite/bugs/closed/4877.v
new file mode 100644
index 00000000..7e3c78dc
--- /dev/null
+++ b/test-suite/bugs/closed/4877.v
@@ -0,0 +1,12 @@
+Ltac induction_last :=
+ let v := match goal with
+ | |- forall x y, _ = _ -> _ => 1
+ | |- forall x y, _ -> _ = _ -> _ => 2
+ | |- forall x y, _ -> _ -> _ = _ -> _ => 3
+ end in
+ induction v.
+
+Goal forall n m : nat, True -> n = m -> m = n.
+ induction_last.
+ reflexivity.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/4880.v b/test-suite/bugs/closed/4880.v
new file mode 100644
index 00000000..5569798d
--- /dev/null
+++ b/test-suite/bugs/closed/4880.v
@@ -0,0 +1,11 @@
+Require Import Coq.Reals.Reals Coq.nsatz.Nsatz.
+Local Open Scope R.
+
+Goal forall x y : R,
+ x*x = y * y ->
+ x*x = -y * -y ->
+ x*(x*x) = 0 -> (* The associativity does not actually matter, *)
+ (x*x)*x = 0. (* just otherwise [assumption] would solve the goal. *)
+Proof.
+ nsatz.
+Qed.
diff --git a/test-suite/bugs/closed/4882.v b/test-suite/bugs/closed/4882.v
new file mode 100644
index 00000000..8c26af70
--- /dev/null
+++ b/test-suite/bugs/closed/4882.v
@@ -0,0 +1,50 @@
+
+Definition Foo {T}{a : T} : T := a.
+
+Module A.
+
+ Declare Implicit Tactic eauto.
+
+ Goal forall A (x : A), A.
+ intros.
+ apply Foo. (* Check defined evars are normalized *)
+ (* Qed. *)
+ Abort.
+
+End A.
+
+Module B.
+
+ Definition Foo {T}{a : T} : T := a.
+
+ Declare Implicit Tactic eassumption.
+
+ Goal forall A (x : A), A.
+ intros.
+ apply Foo.
+ (* Qed. *)
+ Abort.
+
+End B.
+
+Module C.
+
+ Declare Implicit Tactic first [exact True|assumption].
+
+ Goal forall (x : True), True.
+ intros.
+ apply (@Foo _ _).
+ Qed.
+
+End C.
+
+Module D.
+
+ Declare Implicit Tactic assumption.
+
+ Goal forall A (x : A), A.
+ intros.
+ exact _.
+ Qed.
+
+End D.
diff --git a/test-suite/bugs/closed/4893.v b/test-suite/bugs/closed/4893.v
new file mode 100644
index 00000000..9a35bcf9
--- /dev/null
+++ b/test-suite/bugs/closed/4893.v
@@ -0,0 +1,4 @@
+Goal True.
+evar (P: Prop).
+assert (H : P); [|subst P]; [exact I|].
+let T := type of H in not_evar T.
diff --git a/test-suite/bugs/closed/4904.v b/test-suite/bugs/closed/4904.v
new file mode 100644
index 00000000..a47c3b07
--- /dev/null
+++ b/test-suite/bugs/closed/4904.v
@@ -0,0 +1,11 @@
+Module A.
+Module B.
+Notation mynat := nat.
+Notation nat := nat.
+End B.
+End A.
+
+Print A.B.nat. (* Notation A.B.nat := nat *)
+Import A.
+Print B.mynat.
+Print B.nat.
diff --git a/test-suite/bugs/closed/4932.v b/test-suite/bugs/closed/4932.v
new file mode 100644
index 00000000..219d532a
--- /dev/null
+++ b/test-suite/bugs/closed/4932.v
@@ -0,0 +1,44 @@
+(* Testing recursive notations with binders seen as terms *)
+
+Inductive ftele : Type :=
+| fb {T:Type} : T -> ftele
+| fr {T} : (T -> ftele) -> ftele.
+
+Fixpoint args ftele : Type :=
+ match ftele with
+ | fb _ => unit
+ | fr f => sigT (fun t => args (f t))
+ end.
+
+Definition fpack := sigT args.
+Definition pack fp fa : fpack := existT _ fp fa.
+
+Notation "'tele' x .. z := b" :=
+ (
+ (fun x => ..
+ (fun z =>
+ pack
+ (fr (fun x => .. ( fr (fun z => fb b) ) .. ) )
+ (existT _ x .. (existT _ z tt) .. )
+ ) ..
+ )
+ ) (at level 85, x binder, z binder).
+
+Check fun '((y,z):nat*nat) => pack (fr (fun '((y,z):nat*nat) => fb tt))
+ (existT _ (y,z) tt).
+
+Example test := tele (t : Type) := tt.
+Example test' := test nat.
+Print test.
+
+Example test2 := tele (t : Type) (x:t) := tt.
+Example test2' := test2 nat 0.
+Print test2.
+
+Example test3 := tele (t : Type) (y:=0) (x:t) := tt.
+Example test3' := test3 nat 0.
+Print test3.
+
+Example test4 := tele (t : Type) '((y,z):nat*nat) (x:t) := tt.
+Example test4' := test4 nat (1,2) 3.
+Print test4.
diff --git a/test-suite/bugs/closed/4955.v b/test-suite/bugs/closed/4955.v
new file mode 100644
index 00000000..dce1f764
--- /dev/null
+++ b/test-suite/bugs/closed/4955.v
@@ -0,0 +1,98 @@
+(* An example involving a first-order unification triggering a cyclic constraint *)
+
+Module A.
+Notation "{ x : A | P }" := (sigT (fun x:A => P)).
+Notation "( x ; y )" := (existT _ x y) : fibration_scope.
+Open Scope fibration_scope.
+Notation "p @ q" := (eq_trans p q) (at level 20).
+Notation "p ^" := (eq_sym p) (at level 3).
+Definition transport {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x)
+: P y :=
+ match p with eq_refl => u end.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only
+parsing).
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with eq_refl => eq_refl end.
+Definition apD {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y): p # (f
+x) = f y
+ := match p with eq_refl => eq_refl end.
+Axiom transport_compose
+ : forall {A B} {x y : A} (P : B -> Type) (f : A -> B) (p : x = y) (z : P (f
+x)),
+ transport (fun x => P (f x)) p z = transport P (ap f p) z.
+Delimit Scope morphism_scope with morphism.
+Delimit Scope category_scope with category.
+Delimit Scope object_scope with object.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Delimit Scope functor_scope with functor.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s)
+(object_of d) }.
+Arguments object_of {C%category D%category} f%functor c%object : rename, simpl
+nomatch.
+Arguments morphism_of [C%category] [D%category] f%functor [s%object d%object]
+m%morphism : rename, simpl nomatch.
+Section path_functor.
+ Variable C : PreCategory.
+ Variable D : PreCategory.
+
+ Local Notation path_functor'_T F G
+ := { HO : object_of F = object_of G
+ | transport (fun GO => forall s d, morphism C s d -> morphism D (GO s)
+(GO d))
+ HO
+ (morphism_of F)
+ = morphism_of G }
+ (only parsing).
+ Definition path_functor'_sig_inv (F G : Functor C D) : F = G ->
+path_functor'_T F G
+ := fun H'
+ => (ap object_of H';
+ (transport_compose _ object_of _ _) ^ @ apD (@morphism_of _ _) H').
+
+End path_functor.
+End A.
+
+(* A variant of it with more axioms *)
+
+Module B.
+Notation "{ x : A | P }" := (sigT (fun x:A => P)).
+Notation "( x ; y )" := (existT _ x y).
+Notation "p @ q" := (eq_trans p q) (at level 20).
+Notation "p ^" := (eq_sym p) (at level 3).
+Axiom transport : forall {A : Type} (P : A -> Type) {x y : A} (p : x = y) (u : P x), P y.
+Notation "p # x" := (transport _ p x) (right associativity, at level 65, only
+parsing).
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y
+ := match p with eq_refl => eq_refl end.
+Axiom apD : forall {A:Type} {B:A->Type} (f:forall a:A, B a) {x y:A} (p:x=y), p # (f
+x) = f y.
+Axiom transport_compose
+ : forall {A B} {x y : A} (P : B -> Type) (f : A -> B) (p : x = y) (z : P (f
+x)),
+ transport (fun x => P (f x)) p z = transport P (ap f p) z.
+Record PreCategory := { object :> Type ; morphism : object -> object -> Type }.
+Record Functor (C D : PreCategory) :=
+ { object_of :> C -> D;
+ morphism_of : forall s d, morphism C s d -> morphism D (object_of s)
+(object_of d) }.
+Arguments object_of {C D} f c : rename, simpl nomatch.
+Arguments morphism_of [C] [D] f [s d] m : rename, simpl nomatch.
+Section path_functor.
+ Variable C D : PreCategory.
+ Local Notation path_functor'_T F G
+ := { HO : object_of F = object_of G
+ | transport (fun GO => forall s d, morphism C s d -> morphism D (GO s)
+(GO d))
+ HO
+ (morphism_of F)
+ = morphism_of G }.
+ Definition path_functor'_sig_inv (F G : Functor C D) : F = G ->
+path_functor'_T F G
+ := fun H'
+ => (ap object_of H';
+ (transport_compose _ object_of _ _) ^ @ apD (@morphism_of _ _) H').
+
+End path_functor.
+End B.
diff --git a/test-suite/bugs/closed/4966.v b/test-suite/bugs/closed/4966.v
new file mode 100644
index 00000000..bd93cdc8
--- /dev/null
+++ b/test-suite/bugs/closed/4966.v
@@ -0,0 +1,10 @@
+(* Interpretation of auto as an argument of an ltac function (i.e. as an ident) was wrongly "auto with *" *)
+
+Axiom proof_admitted : False.
+Hint Extern 0 => case proof_admitted : unused.
+Ltac do_tac tac := tac.
+
+Goal False.
+ Set Ltac Profiling.
+ Fail solve [ do_tac auto ].
+Abort.
diff --git a/test-suite/bugs/closed/4970.v b/test-suite/bugs/closed/4970.v
new file mode 100644
index 00000000..7a896582
--- /dev/null
+++ b/test-suite/bugs/closed/4970.v
@@ -0,0 +1,3 @@
+(* Check "{{" is not confused with "{" in notations *)
+Reserved Notation "x {{ y }}" (at level 40).
+Notation "x {{ y }}" := (x y) (only parsing).
diff --git a/test-suite/bugs/closed/5011.v b/test-suite/bugs/closed/5011.v
new file mode 100644
index 00000000..c3043ca5
--- /dev/null
+++ b/test-suite/bugs/closed/5011.v
@@ -0,0 +1,2 @@
+Record decoder (n : nat) W := { decode : W -> nat }.
+Existing Class decoder.
diff --git a/test-suite/bugs/closed/5036.v b/test-suite/bugs/closed/5036.v
new file mode 100644
index 00000000..12c958be
--- /dev/null
+++ b/test-suite/bugs/closed/5036.v
@@ -0,0 +1,10 @@
+Section foo.
+ Context (F : Type -> Type).
+ Context (admit : forall {T}, F T = True).
+ Hint Rewrite (fun T => @admit T).
+ Lemma bad : F False.
+ Proof.
+ autorewrite with core.
+ constructor.
+ Qed.
+End foo. (* Anomaly: Universe Top.16 undefined. Please report. *) \ No newline at end of file
diff --git a/test-suite/bugs/closed/5043.v b/test-suite/bugs/closed/5043.v
new file mode 100644
index 00000000..4e6a0f87
--- /dev/null
+++ b/test-suite/bugs/closed/5043.v
@@ -0,0 +1,8 @@
+Unset Keep Admitted Variables.
+
+Section a.
+ Context (x : Type).
+ Definition foo : Type.
+ Admitted.
+End a.
+Check foo : Type.
diff --git a/test-suite/bugs/closed/5045.v b/test-suite/bugs/closed/5045.v
new file mode 100644
index 00000000..dc38738d
--- /dev/null
+++ b/test-suite/bugs/closed/5045.v
@@ -0,0 +1,3 @@
+Axiom silly : 1 = 1 -> nat -> nat.
+Goal forall pf : 1 = 1, silly pf 0 = 0 -> True.
+ Fail generalize (@eq nat).
diff --git a/test-suite/bugs/closed/5065.v b/test-suite/bugs/closed/5065.v
new file mode 100644
index 00000000..6bd677ba
--- /dev/null
+++ b/test-suite/bugs/closed/5065.v
@@ -0,0 +1,6 @@
+Inductive foo := C1 : bar -> foo with bar := C2 : foo -> bar.
+
+Lemma L1 : foo -> True with L2 : bar -> True.
+intros; clear L1 L2; abstract (exact I).
+intros; exact I.
+Qed. \ No newline at end of file
diff --git a/test-suite/bugs/closed/5066.v b/test-suite/bugs/closed/5066.v
new file mode 100644
index 00000000..eed7f0f3
--- /dev/null
+++ b/test-suite/bugs/closed/5066.v
@@ -0,0 +1,7 @@
+Require Import Vector.
+
+Fail Program Fixpoint vector_rev {A : Type} {n1 n2 : nat} (v1 : Vector.t A n1) (v2 : Vector.t A n2) : Vector.t A (n1+n2) :=
+ match v1 with
+ | nil _ => v2
+ | cons _ e n' sv => vector_rev sv (cons A e n2 v2)
+ end.
diff --git a/test-suite/bugs/closed/5077.v b/test-suite/bugs/closed/5077.v
new file mode 100644
index 00000000..7e7f2c37
--- /dev/null
+++ b/test-suite/bugs/closed/5077.v
@@ -0,0 +1,8 @@
+(* Testing robustness of typing for a fixpoint with evars in its type *)
+
+Inductive foo (n : nat) : Type := .
+Definition foo_denote {n} (x : foo n) : Type := match x with end.
+
+Definition baz : forall n (x : foo n), foo_denote x.
+refine (fix go n (x : foo n) : foo_denote x := _).
+Abort.
diff --git a/test-suite/bugs/closed/5078.v b/test-suite/bugs/closed/5078.v
new file mode 100644
index 00000000..ca73cbcc
--- /dev/null
+++ b/test-suite/bugs/closed/5078.v
@@ -0,0 +1,5 @@
+(* Test coercion from ident to evaluable reference *)
+Tactic Notation "unfold_hyp" hyp(H) := cbv delta [H].
+Goal True -> Type.
+ intro H''.
+ Fail unfold_hyp H''.
diff --git a/test-suite/bugs/closed/5093.v b/test-suite/bugs/closed/5093.v
new file mode 100644
index 00000000..3ded4dd3
--- /dev/null
+++ b/test-suite/bugs/closed/5093.v
@@ -0,0 +1,11 @@
+Axiom P : nat -> Prop.
+Axiom PS : forall n, P n -> P (S n).
+Axiom P0 : P 0.
+
+Hint Resolve PS : foobar.
+Hint Resolve P0 : foobar.
+
+Goal P 100.
+Proof.
+Fail typeclasses eauto 100 with foobar.
+typeclasses eauto 101 with foobar.
diff --git a/test-suite/bugs/closed/5095.v b/test-suite/bugs/closed/5095.v
new file mode 100644
index 00000000..b6f38e3e
--- /dev/null
+++ b/test-suite/bugs/closed/5095.v
@@ -0,0 +1,5 @@
+(* Checking let-in abstraction *)
+Goal let x := Set in let y := x in True.
+ intros x y.
+ (* There used to have a too strict dependency test there *)
+ set (s := Set) in (value of x).
diff --git a/test-suite/bugs/closed/5096.v b/test-suite/bugs/closed/5096.v
new file mode 100644
index 00000000..20a537ab
--- /dev/null
+++ b/test-suite/bugs/closed/5096.v
@@ -0,0 +1,219 @@
+Require Import Coq.FSets.FMapPositive Coq.PArith.BinPos Coq.Lists.List.
+
+Set Asymmetric Patterns.
+
+Notation eta x := (fst x, snd x).
+
+Inductive expr {var : Type} : Type :=
+| Const : expr
+| LetIn : expr -> (var -> expr) -> expr.
+
+Definition Expr := forall var, @expr var.
+
+Fixpoint count_binders (e : @expr unit) : nat :=
+match e with
+| LetIn _ eC => 1 + @count_binders (eC tt)
+| _ => 0
+end.
+
+Definition CountBinders (e : Expr) : nat := count_binders (e _).
+
+Class Context (Name : Type) (var : Type) :=
+ { ContextT : Type;
+ extendb : ContextT -> Name -> var -> ContextT;
+ empty : ContextT }.
+Coercion ContextT : Context >-> Sortclass.
+Arguments ContextT {_ _ _}, {_ _} _.
+Arguments extendb {_ _ _} _ _ _.
+Arguments empty {_ _ _}.
+
+Module Export Named.
+Inductive expr Name : Type :=
+| Const : expr Name
+| LetIn : Name -> expr Name -> expr Name -> expr Name.
+End Named.
+
+Global Arguments Const {_}.
+Global Arguments LetIn {_} _ _ _.
+
+Definition split_onames {Name : Type} (ls : list (option Name))
+ : option (Name) * list (option Name)
+ := match ls with
+ | cons n ls'
+ => (n, ls')
+ | nil => (None, nil)
+ end.
+
+Section internal.
+ Context (InName OutName : Type)
+ {InContext : Context InName (OutName)}
+ {ReverseContext : Context OutName (InName)}
+ (InName_beq : InName -> InName -> bool).
+
+ Fixpoint register_reassign (ctxi : InContext) (ctxr : ReverseContext)
+ (e : expr InName) (new_names : list (option OutName))
+ : option (expr OutName)
+ := match e in Named.expr _ return option (expr _) with
+ | Const => Some Const
+ | LetIn n ex eC
+ => let '(n', new_names') := eta (split_onames new_names) in
+ match n', @register_reassign ctxi ctxr ex nil with
+ | Some n', Some x
+ => let ctxi := @extendb _ _ _ ctxi n n' in
+ let ctxr := @extendb _ _ _ ctxr n' n in
+ option_map (LetIn n' x) (@register_reassign ctxi ctxr eC new_names')
+ | None, Some x
+ => let ctxi := ctxi in
+ @register_reassign ctxi ctxr eC new_names'
+ | _, None => None
+ end
+ end.
+
+End internal.
+
+Global Instance pos_context (var : Type) : Context positive var
+ := { ContextT := PositiveMap.t var;
+ extendb ctx key v := PositiveMap.add key v ctx;
+ empty := PositiveMap.empty _ }.
+
+Global Arguments register_reassign {_ _ _ _} ctxi ctxr e _.
+
+Section language5.
+ Context (Name : Type).
+
+ Local Notation expr := (@Top.expr Name).
+ Local Notation nexpr := (@Named.expr Name).
+
+ Fixpoint ocompile (e : expr) (ls : list (option Name)) {struct e}
+ : option (nexpr)
+ := match e in @Top.expr _ return option (nexpr) with
+ | Top.Const => Some Named.Const
+ | Top.LetIn ex eC
+ => match @ocompile ex nil, split_onames ls with
+ | Some x, (Some n, ls')%core
+ => option_map (fun C => Named.LetIn n x C) (@ocompile (eC n) ls')
+ | _, _ => None
+ end
+ end.
+
+ Definition compile (e : expr) (ls : list Name) := @ocompile e (List.map (@Some _) ls).
+End language5.
+
+Global Arguments compile {_} e ls.
+
+Fixpoint merge_liveness (ls1 ls2 : list unit) :=
+ match ls1, ls2 with
+ | cons x xs, cons y ys => cons tt (@merge_liveness xs ys)
+ | nil, ls | ls, nil => ls
+ end.
+
+Section internal1.
+ Context (Name : Type)
+ (OutName : Type)
+ {Context : Context Name (list unit)}.
+
+ Definition compute_livenessf_step
+ (compute_livenessf : forall (ctx : Context) (e : expr Name) (prefix : list unit), list unit)
+ (ctx : Context)
+ (e : expr Name) (prefix : list unit)
+ : list unit
+ := match e with
+ | Const => prefix
+ | LetIn n ex eC
+ => let lx := @compute_livenessf ctx ex prefix in
+ let lx := merge_liveness lx (prefix ++ repeat tt 1) in
+ let ctx := @extendb _ _ _ ctx n (lx) in
+ @compute_livenessf ctx eC (prefix ++ repeat tt 1)
+ end.
+
+ Fixpoint compute_liveness ctx e prefix
+ := @compute_livenessf_step (@compute_liveness) ctx e prefix.
+
+ Fixpoint insert_dead_names_gen def (ls : list unit) (lsn : list OutName)
+ : list (option OutName)
+ := match ls with
+ | nil => nil
+ | cons live xs
+ => match lsn with
+ | cons n lsn' => Some n :: @insert_dead_names_gen def xs lsn'
+ | nil => def :: @insert_dead_names_gen def xs nil
+ end
+ end.
+ Definition insert_dead_names def (e : expr Name)
+ := insert_dead_names_gen def (compute_liveness empty e nil).
+End internal1.
+
+Global Arguments insert_dead_names {_ _ _} def e lsn.
+
+Definition Let_In {A P} (x : A) (f : forall a : A, P a) : P x := let y := x in f y.
+
+Section language7.
+ Context {Context : Context unit (positive)}.
+
+ Local Notation nexpr := (@Named.expr unit).
+
+ Definition CompileAndEliminateDeadCode (e : Expr) (ls : list unit)
+ : option (nexpr)
+ := let e := compile (Name:=positive) (e _) (List.map Pos.of_nat (seq 1 (CountBinders e))) in
+ match e with
+ | Some e => Let_In (insert_dead_names None e ls) (* help vm_compute by factoring this out *)
+ (fun names => register_reassign empty empty e names)
+ | None => None
+ end.
+End language7.
+
+Global Arguments CompileAndEliminateDeadCode {_} e ls.
+
+Definition ContextOn {Name1 Name2} f {var} (Ctx : Context Name1 var) : Context Name2 var
+ := {| ContextT := Ctx;
+ extendb ctx n v := extendb ctx (f n) v;
+ empty := empty |}.
+
+Definition Register := Datatypes.unit.
+
+Global Instance RegisterContext {var : Type} : Context Register var
+ := ContextOn (fun _ => 1%positive) (pos_context var).
+
+Definition syntax := Named.expr Register.
+
+Definition AssembleSyntax e ls (res := CompileAndEliminateDeadCode e ls)
+ := match res return match res with None => _ | _ => _ end with
+ | Some v => v
+ | None => I
+ end.
+
+Definition dummy_registers (n : nat) : list Register
+ := List.map (fun _ => tt) (seq 0 n).
+Definition DefaultRegisters (e : Expr) : list Register
+ := dummy_registers (CountBinders e).
+
+Definition DefaultAssembleSyntax e := @AssembleSyntax e (DefaultRegisters e).
+
+Notation "'slet' x := A 'in' b" := (Top.LetIn A (fun x => b)) (at level 200, b at level 200).
+Notation "#[ var ]#" := (@Top.Const var).
+
+Definition compiled_syntax : Expr := fun (var : Type) =>
+(
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ slet x1 := #[ var ]# in
+ @Top.Const var).
+
+Definition v :=
+ Eval cbv [compiled_syntax] in (DefaultAssembleSyntax (compiled_syntax)).
+
+Timeout 2 Eval vm_compute in v.
diff --git a/test-suite/bugs/closed/5097.v b/test-suite/bugs/closed/5097.v
new file mode 100644
index 00000000..37b239cf
--- /dev/null
+++ b/test-suite/bugs/closed/5097.v
@@ -0,0 +1,7 @@
+(* Tracing existing evars along the weakening rule ("clear") *)
+Goal forall y, exists x, x=0->x=y.
+intros.
+eexists ?[x].
+intros.
+let x:=constr:(ltac:(clear y; exact 0)) in idtac x.
+Abort.
diff --git a/test-suite/bugs/closed/5123.v b/test-suite/bugs/closed/5123.v
new file mode 100644
index 00000000..bcde510e
--- /dev/null
+++ b/test-suite/bugs/closed/5123.v
@@ -0,0 +1,33 @@
+(* IN 8.5pl2 and 8.6 (4da2131), the following shows different typeclass resolution behaviors following an unshelve tactical vs. an Unshelve command: *)
+
+(*Pose an open constr to prevent immediate typeclass resolution in holes:*)
+Tactic Notation "opose" open_constr(x) "as" ident(H) := pose x as H.
+
+Inductive vect A : nat -> Type :=
+| vnil : vect A 0
+| vcons : forall (h:A) (n:nat), vect A n -> vect A (S n).
+
+Class Eqdec A := eqdec : forall a b : A, {a=b}+{a<>b}.
+
+Require Bool.
+
+Instance Bool_eqdec : Eqdec bool := Bool.bool_dec.
+
+Context `{vect_sigT_eqdec : forall A : Type, Eqdec A -> Eqdec {a : nat & vect A a}}.
+
+Typeclasses eauto := debug.
+
+Goal True.
+ unshelve opose (@vect_sigT_eqdec _ _ _ _) as H.
+ all:cycle 2.
+ eapply existT. (*BUG: Why does this do typeclass resolution in the evar?*)
+ Focus 5.
+Abort.
+
+Goal True.
+ opose (@vect_sigT_eqdec _ _ _ _) as H.
+ Unshelve.
+ all:cycle 3.
+ eapply existT. (*This does no typeclass resultion, which is correct.*)
+ Focus 5.
+Abort. \ No newline at end of file
diff --git a/test-suite/bugs/closed/5127.v b/test-suite/bugs/closed/5127.v
new file mode 100644
index 00000000..831e8fb5
--- /dev/null
+++ b/test-suite/bugs/closed/5127.v
@@ -0,0 +1,15 @@
+Fixpoint arrow (n: nat) :=
+ match n with
+ | S n => bool -> arrow n
+ | O => bool
+ end.
+
+Fixpoint apply (n : nat) : arrow n -> bool :=
+ match n return arrow n -> bool with
+ | S n => fun f => apply _ (f true)
+ | O => fun x => x
+ end.
+
+Axiom f : arrow 10000.
+Definition v : bool := Eval compute in apply _ f.
+Definition w : bool := Eval vm_compute in v.
diff --git a/test-suite/bugs/closed/5145.v b/test-suite/bugs/closed/5145.v
new file mode 100644
index 00000000..0533d21e
--- /dev/null
+++ b/test-suite/bugs/closed/5145.v
@@ -0,0 +1,10 @@
+Class instructions :=
+ {
+ W : Type;
+ ldi : nat -> W
+ }.
+
+Fail Definition foo :=
+ let y2 := ldi 0 in
+ let '(CF, _) := (true, 0) in
+ y2.
diff --git a/test-suite/bugs/closed/5149.v b/test-suite/bugs/closed/5149.v
new file mode 100644
index 00000000..684dba19
--- /dev/null
+++ b/test-suite/bugs/closed/5149.v
@@ -0,0 +1,47 @@
+Goal forall x x' : nat, x = x' -> S x = S x -> exists y, S y = S x.
+intros.
+eexists.
+rewrite <- H.
+eassumption.
+Qed.
+
+Goal forall (base_type_code : Type) (t : base_type_code) (flat_type : Type)
+ (t' : flat_type) (exprf interp_flat_type0 interp_flat_type1 :
+flat_type -> Type)
+ (v v' : interp_flat_type1 t'),
+ v = v' ->
+ forall (interpf : forall t0 : flat_type, exprf t0 -> interp_flat_type1 t0)
+ (SmartVarVar : forall t0 : flat_type, interp_flat_type1 t0 ->
+interp_flat_type0 t0)
+ (Tbase : base_type_code -> flat_type) (x : exprf (Tbase t))
+ (x' : interp_flat_type1 (Tbase t)) (T : Type)
+ (flatten_binding_list : forall t0 : flat_type,
+ interp_flat_type0 t0 -> interp_flat_type1 t0 -> list T)
+ (P : T -> list T -> Prop) (prod : Type -> Type -> Type)
+ (s : forall x0 : base_type_code, prod (exprf (Tbase x0))
+(interp_flat_type1 (Tbase x0)) -> T)
+ (pair : forall A B : Type, A -> B -> prod A B),
+ P (s t (pair (exprf (Tbase t)) (interp_flat_type1 (Tbase t)) x x'))
+ (flatten_binding_list t' (SmartVarVar t' v') v) ->
+ (forall (t0 : base_type_code) (t'0 : flat_type) (v0 : interp_flat_type1
+t'0)
+ (x0 : exprf (Tbase t0)) (x'0 : interp_flat_type1 (Tbase t0)),
+ P (s t0 (pair (exprf (Tbase t0)) (interp_flat_type1 (Tbase t0)) x0
+x'0))
+ (flatten_binding_list t'0 (SmartVarVar t'0 v0) v0) -> interpf
+(Tbase t0) x0 = x'0) ->
+ interpf (Tbase t) x = x'.
+Proof.
+ intros ?????????????????????? interpf_SmartVarVar.
+ solve [ unshelve (subst; eapply interpf_SmartVarVar; eassumption) ] || fail
+"too early".
+ Undo.
+ (** Implicitely at the dot. The first fails because unshelve adds a goal, and solve hence fails. The second has an ambiant unification problem that is solved after solve *)
+ Fail solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption) ].
+ solve [eapply interpf_SmartVarVar; subst; eassumption].
+ Undo.
+ Unset Solve Unification Constraints.
+ (* User control of when constraints are solved *)
+ solve [ unshelve (eapply interpf_SmartVarVar; subst; eassumption); solve_constraints ].
+Qed.
+
diff --git a/test-suite/bugs/closed/5161.v b/test-suite/bugs/closed/5161.v
new file mode 100644
index 00000000..d28303b8
--- /dev/null
+++ b/test-suite/bugs/closed/5161.v
@@ -0,0 +1,27 @@
+(* Check that the presence of binders with type annotation do not
+ prevent the recursive binder part to be found *)
+
+From Coq Require Import Utf8.
+
+Delimit Scope C_scope with C.
+Global Open Scope C_scope.
+
+Delimit Scope uPred_scope with I.
+
+Definition FORALL {T : Type} (f : T → Prop) : Prop := ∀ x, f x.
+
+Notation "∀ x .. y , P" :=
+ (FORALL (λ x, .. (FORALL (λ y, P)) ..)%I)
+ (at level 200, x binder, y binder, right associativity) : uPred_scope.
+Infix "∧" := and : uPred_scope.
+
+(* The next command fails with
+ In recursive notation with binders, Φ is expected to come without type.
+ I would expect this notation to work fine, since the ∀ does support
+ type annotation.
+*)
+Notation "'{{{' P } } } e {{{ x .. y ; pat , Q } } }" :=
+ (∀ Φ : _ → _,
+ (∀ x, .. (∀ y, Q ∧ Φ pat) .. ))%I
+ (at level 20, x closed binder, y closed binder,
+ format "{{{ P } } } e {{{ x .. y ; pat , Q } } }") : uPred_scope.
diff --git a/test-suite/bugs/closed/5180.v b/test-suite/bugs/closed/5180.v
new file mode 100644
index 00000000..261092ee
--- /dev/null
+++ b/test-suite/bugs/closed/5180.v
@@ -0,0 +1,64 @@
+Universes a b c ω ω'.
+Definition Typeω := Type@{ω}.
+Definition Type2 : Typeω := Type@{c}.
+Definition Type1 : Type2 := Type@{b}.
+Definition Type0 : Type1 := Type@{a}.
+
+Set Universe Polymorphism.
+Set Printing Universes.
+
+Definition Typei' (n : nat)
+ := match n return Type@{ω'} with
+ | 0 => Type0
+ | 1 => Type1
+ | 2 => Type2
+ | _ => Typeω
+ end.
+Definition TypeOfTypei' {n} (x : Typei' n) : Type@{ω'}
+ := match n return Typei' n -> Type@{ω'} with
+ | 0 | 1 | 2 | _ => fun x => x
+ end x.
+Definition Typei (n : nat) : Typei' (S n)
+ := match n return Typei' (S n) with
+ | 0 => Type0
+ | 1 => Type1
+ | _ => Type2
+ end.
+Definition TypeOfTypei {n} (x : TypeOfTypei' (Typei n)) : Type@{ω'}
+ := match n return TypeOfTypei' (Typei n) -> Type@{ω'} with
+ | 0 | 1 | _ => fun x => x
+ end x.
+Check Typei 0 : Typei 1.
+Check Typei 1 : Typei 2.
+
+Definition lift' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n))
+ := match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with
+ | 0 | 1 | 2 | _ => fun x => (x : Type)
+ end.
+Definition lift'' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n))
+ := match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with
+ | 0 | 1 | 2 | _ => fun x => x
+ end. (* The command has indeed failed with message:
+In environment
+n : nat
+x : TypeOfTypei' (Typei 0)
+The term "x" has type "TypeOfTypei' (Typei 0)" while it is expected to have type
+ "TypeOfTypei' (Typei 1)" (universe inconsistency: Cannot enforce b = a because a < b).
+ *)
+Check (fun x : TypeOfTypei' (Typei 0) => TypeOfTypei' (Typei 1)).
+
+Definition lift''' {n} : TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)).
+ refine match n return TypeOfTypei' (Typei n) -> TypeOfTypei' (Typei (S n)) with
+ | 0 | 1 | 2 | _ => fun x => _
+ end.
+ exact x.
+ Undo.
+ (* The command has indeed failed with message:
+In environment
+n : nat
+x : TypeOfTypei' (Typei 0)
+The term "x" has type "TypeOfTypei' (Typei 0)" while it is expected to have type
+ "TypeOfTypei' (Typei 1)" (universe inconsistency: Cannot enforce b = a because a < b).
+ *)
+ all:compute in *.
+ all:exact x. \ No newline at end of file
diff --git a/test-suite/bugs/closed/5181.v b/test-suite/bugs/closed/5181.v
new file mode 100644
index 00000000..0e6d4719
--- /dev/null
+++ b/test-suite/bugs/closed/5181.v
@@ -0,0 +1,3 @@
+Definition foo (x y : nat) := x.
+Fail Arguments foo {_} : assert.
+
diff --git a/test-suite/bugs/closed/5188.v b/test-suite/bugs/closed/5188.v
new file mode 100644
index 00000000..e29ebfb4
--- /dev/null
+++ b/test-suite/bugs/closed/5188.v
@@ -0,0 +1,5 @@
+Set Printing All.
+Axiom relation : forall (T : Type), Set.
+Axiom T : forall A (R : relation A), Set.
+Set Printing Universes.
+Parameter (A:_) (R:_) (e:@T A R).
diff --git a/test-suite/bugs/closed/5198.v b/test-suite/bugs/closed/5198.v
new file mode 100644
index 00000000..7254afb4
--- /dev/null
+++ b/test-suite/bugs/closed/5198.v
@@ -0,0 +1,39 @@
+(* -*- mode: coq; coq-prog-args: ("-emacs" "-boot" "-nois") -*- *)
+(* File reduced by coq-bug-finder from original input, then from 286 lines to
+27 lines, then from 224 lines to 53 lines, then from 218 lines to 56 lines,
+then from 269 lines to 180 lines, then from 132 lines to 48 lines, then from
+253 lines to 65 lines, then from 79 lines to 65 lines *)
+(* coqc version 8.6.0 (November 2016) compiled on Nov 12 2016 14:43:52 with
+OCaml 4.02.3
+ coqtop version jgross-Leopard-WS:/home/jgross/Downloads/coq/coq-v8.6,v8.6
+(7e992fa784ee6fa48af8a2e461385c094985587d) *)
+Axiom admit : forall {T}, T.
+Set Printing Implicit.
+Inductive nat := O | S (_ : nat).
+Axiom f : forall (_ _ : nat), nat.
+Class ZLikeOps (e : nat)
+ := { LargeT : Type ; SmallT : Type ; CarryAdd : forall (_ _ : LargeT), LargeT
+}.
+Class BarrettParameters :=
+ { b : nat ; k : nat ; ops : ZLikeOps (f b k) }.
+Axiom barrett_reduce_function_bundled : forall {params : BarrettParameters}
+ (_ : @LargeT _ (@ops params)),
+ @SmallT _ (@ops params).
+
+Global Instance ZZLikeOps e : ZLikeOps (f (S O) e)
+ := { LargeT := nat ; SmallT := nat ; CarryAdd x y := y }.
+Definition SRep := nat.
+Local Instance x86_25519_Barrett : BarrettParameters
+ := { b := S O ; k := O ; ops := ZZLikeOps O }.
+Definition SRepAdd : forall (_ _ : SRep), SRep
+ := let v := (fun x y => barrett_reduce_function_bundled (CarryAdd x y)) in
+ v.
+Definition SRepAdd' : forall (_ _ : SRep), SRep
+ := (fun x y => barrett_reduce_function_bundled (CarryAdd x y)).
+(* Error:
+In environment
+x : SRep
+y : SRep
+The term "x" has type "SRep" while it is expected to have type
+ "@LargeT ?e ?ZLikeOps".
+ *)
diff --git a/test-suite/bugs/closed/5203.v b/test-suite/bugs/closed/5203.v
new file mode 100644
index 00000000..ed137395
--- /dev/null
+++ b/test-suite/bugs/closed/5203.v
@@ -0,0 +1,5 @@
+Goal True.
+ Typeclasses eauto := debug.
+ Fail solve [ typeclasses eauto ].
+ Fail typeclasses eauto.
+ \ No newline at end of file
diff --git a/test-suite/bugs/closed/5208.v b/test-suite/bugs/closed/5208.v
new file mode 100644
index 00000000..b7a684a2
--- /dev/null
+++ b/test-suite/bugs/closed/5208.v
@@ -0,0 +1,222 @@
+Require Import Program.
+
+Require Import Coq.Strings.String.
+Require Import Coq.Strings.Ascii.
+Require Import Coq.Numbers.BinNums.
+
+Set Implicit Arguments.
+Set Strict Implicit.
+Set Universe Polymorphism.
+Set Printing Universes.
+
+Local Open Scope positive.
+
+Definition field : Type := positive.
+
+Section poly.
+ Universe U.
+
+ Inductive fields : Type :=
+ | pm_Leaf : fields
+ | pm_Branch : fields -> option Type@{U} -> fields -> fields.
+
+ Definition fields_left (f : fields) : fields :=
+ match f with
+ | pm_Leaf => pm_Leaf
+ | pm_Branch l _ _ => l
+ end.
+
+ Definition fields_right (f : fields) : fields :=
+ match f with
+ | pm_Leaf => pm_Leaf
+ | pm_Branch _ _ r => r
+ end.
+
+ Definition fields_here (f : fields) : option Type@{U} :=
+ match f with
+ | pm_Leaf => None
+ | pm_Branch _ s _ => s
+ end.
+
+ Fixpoint fields_get (p : field) (m : fields) {struct p} : option Type@{U} :=
+ match p with
+ | xH => match m with
+ | pm_Leaf => None
+ | pm_Branch _ x _ => x
+ end
+ | xO p' => fields_get p' match m with
+ | pm_Leaf => pm_Leaf
+ | pm_Branch L _ _ => L
+ end
+ | xI p' => fields_get p' match m with
+ | pm_Leaf => pm_Leaf
+ | pm_Branch _ _ R => R
+ end
+ end.
+
+ Definition fields_leaf : fields := pm_Leaf.
+
+ Inductive member (val : Type@{U}) : fields -> Type :=
+ | pmm_H : forall L R, member val (pm_Branch L (Some val) R)
+ | pmm_L : forall (V : option Type@{U}) L R, member val L -> member val (pm_Branch L V R)
+ | pmm_R : forall (V : option Type@{U}) L R, member val R -> member val (pm_Branch L V R).
+ Arguments pmm_H {_ _ _}.
+ Arguments pmm_L {_ _ _ _} _.
+ Arguments pmm_R {_ _ _ _} _.
+
+ Fixpoint get_member (val : Type@{U}) p {struct p}
+ : forall m, fields_get p m = @Some Type@{U} val -> member val m :=
+ match p as p return forall m, fields_get p m = @Some Type@{U} val -> member@{U} val m with
+ | xH => fun m =>
+ match m as m return fields_get xH m = @Some Type@{U} val -> member@{U} val m with
+ | pm_Leaf => fun pf : None = @Some Type@{U} _ =>
+ match pf in _ = Z return match Z with
+ | Some _ => _
+ | None => unit
+ end
+ with
+ | eq_refl => tt
+ end
+ | pm_Branch _ None _ => fun pf : None = @Some Type@{U} _ =>
+ match pf in _ = Z return match Z with
+ | Some _ => _
+ | None => unit
+ end
+ with
+ | eq_refl => tt
+ end
+ | pm_Branch _ (Some x) _ => fun pf : @Some Type@{U} x = @Some Type@{U} val =>
+ match eq_sym pf in _ = Z return member@{U} val (pm_Branch _ Z _) with
+ | eq_refl => pmm_H
+ end
+ end
+ | xO p' => fun m =>
+ match m as m return fields_get (xO p') m = @Some Type@{U} val -> member@{U} val m with
+ | pm_Leaf => fun pf : fields_get p' pm_Leaf = @Some Type@{U} val =>
+ @get_member _ p' pm_Leaf pf
+ | pm_Branch l _ _ => fun pf : fields_get p' l = @Some Type@{U} val =>
+ @pmm_L _ _ _ _ (@get_member _ p' l pf)
+ end
+ | xI p' => fun m =>
+ match m as m return fields_get (xI p') m = @Some Type@{U} val -> member@{U} val m with
+ | pm_Leaf => fun pf : fields_get p' pm_Leaf = @Some Type@{U} val =>
+ @get_member _ p' pm_Leaf pf
+ | pm_Branch l _ r => fun pf : fields_get p' r = @Some Type@{U} val =>
+ @pmm_R _ _ _ _ (@get_member _ p' r pf)
+ end
+ end.
+
+ Inductive record : fields -> Type :=
+ | pr_Leaf : record pm_Leaf
+ | pr_Branch : forall L R (V : option Type@{U}),
+ record L ->
+ match V return Type@{U} with
+ | None => unit
+ | Some t => t
+ end ->
+ record R ->
+ record (pm_Branch L V R).
+
+
+ Definition record_left {L} {V : option Type@{U}} {R}
+ (r : record (pm_Branch L V R)) : record L :=
+ match r in record z
+ return match z with
+ | pm_Branch L _ _ => record L
+ | _ => unit
+ end
+ with
+ | pr_Branch _ l _ _ => l
+ | pr_Leaf => tt
+ end.
+Set Printing All.
+ Definition record_at {L} {V : option Type@{U}} {R} (r : record (pm_Branch L V R))
+ : match V return Type@{U} with
+ | None => unit
+ | Some t => t
+ end :=
+ match r in record z
+ return match z (* return ?X *) with
+ | pm_Branch _ V _ => match V return Type@{U} with
+ | None => unit
+ | Some t => t
+ end
+ | _ => unit
+ end
+ with
+ | pr_Branch _ _ v _ => v
+ | pr_Leaf => tt
+ end.
+
+ Definition record_here {L : fields} (v : Type@{U}) {R : fields}
+ (r : record (pm_Branch L (@Some Type@{U} v) R)) : v :=
+ match r in record z
+ return match z return Type@{U} with
+ | pm_Branch _ (Some v) _ => v
+ | _ => unit
+ end
+ with
+ | pr_Branch _ _ v _ => v
+ | pr_Leaf => tt
+ end.
+
+ Definition record_right {L V R} (r : record (pm_Branch L V R)) : record R :=
+ match r in record z return match z with
+ | pm_Branch _ _ R => record R
+ | _ => unit
+ end
+ with
+ | pr_Branch _ _ _ r => r
+ | pr_Leaf => tt
+ end.
+
+ Fixpoint record_get {val : Type@{U}} {pm : fields} (m : member val pm) : record pm -> val :=
+ match m in member _ pm return record pm -> val with
+ | pmm_H => fun r => record_here r
+ | pmm_L m' => fun r => record_get m' (record_left r)
+ | pmm_R m' => fun r => record_get m' (record_right r)
+ end.
+
+ Fixpoint record_set {val : Type@{U}} {pm : fields} (m : member val pm) (x : val) {struct m}
+ : record pm -> record pm :=
+ match m in member _ pm return record pm -> record pm with
+ | pmm_H => fun r =>
+ pr_Branch (Some _)
+ (record_left r)
+ x
+ (record_right r)
+ | pmm_L m' => fun r =>
+ pr_Branch _
+ (record_set m' x (record_left r))
+ (record_at r)
+ (record_right r)
+ | pmm_R m' => fun r =>
+ pr_Branch _ (record_left r)
+ (record_at r)
+ (record_set m' x (record_right r))
+ end.
+End poly.
+Axiom cheat : forall {A}, A.
+Lemma record_get_record_set_different:
+ forall (T: Type) (vars: fields)
+ (pmr pmw: member T vars)
+ (diff: pmr <> pmw)
+ (r: record vars) (val: T),
+ record_get pmr (record_set pmw val r) = record_get pmr r.
+Proof.
+ intros.
+ revert pmr diff r val.
+ induction pmw; simpl; intros.
+ - dependent destruction pmr.
+ + congruence.
+ + auto.
+ + auto.
+ - dependent destruction pmr.
+ + auto.
+ + simpl. apply IHpmw. congruence.
+ + auto.
+ - dependent destruction pmr.
+ + auto.
+ + auto.
+ + simpl. apply IHpmw. congruence.
+Qed.
diff --git a/test-suite/bugs/closed/HoTT_coq_002.v b/test-suite/bugs/closed/HoTT_coq_002.v
index ba69f6b1..dba4d599 100644
--- a/test-suite/bugs/closed/HoTT_coq_002.v
+++ b/test-suite/bugs/closed/HoTT_coq_002.v
@@ -9,7 +9,7 @@ Section SpecializedFunctor.
(* Variable objC : Type. *)
Context `(C : SpecializedCategory objC).
- Polymorphic Record SpecializedFunctor := {
+ Record SpecializedFunctor := {
ObjectOf' : objC -> Type;
ObjectC : Object C
}.
diff --git a/test-suite/bugs/closed/HoTT_coq_020.v b/test-suite/bugs/closed/HoTT_coq_020.v
index 4938b80f..73da464b 100644
--- a/test-suite/bugs/closed/HoTT_coq_020.v
+++ b/test-suite/bugs/closed/HoTT_coq_020.v
@@ -22,8 +22,8 @@ Polymorphic Record NaturalTransformation objC C objD D (F G : Functor (objC := o
Ltac present_obj from to :=
match goal with
- | [ _ : appcontext[from ?obj ?C] |- _ ] => progress change (from obj C) with (to obj C) in *
- | [ |- appcontext[from ?obj ?C] ] => progress change (from obj C) with (to obj C) in *
+ | [ _ : context[from ?obj ?C] |- _ ] => progress change (from obj C) with (to obj C) in *
+ | [ |- context[from ?obj ?C] ] => progress change (from obj C) with (to obj C) in *
end.
Section NaturalTransformationComposition.
@@ -59,8 +59,8 @@ Polymorphic Definition FunctorFrom0 objC (C : Category objC) : Functor Cat0 C
:= Build_Functor Cat0 C (fun x => match x with end).
Section Law0.
- Variable objC : Type.
- Variable C : Category objC.
+ Polymorphic Variable objC : Type.
+ Polymorphic Variable C : Category objC.
Set Printing All.
Set Printing Universes.
diff --git a/test-suite/bugs/closed/HoTT_coq_047.v b/test-suite/bugs/closed/HoTT_coq_047.v
index 29496be5..bef3c33c 100644
--- a/test-suite/bugs/closed/HoTT_coq_047.v
+++ b/test-suite/bugs/closed/HoTT_coq_047.v
@@ -1,3 +1,5 @@
+Unset Structural Injection.
+
Inductive nCk : nat -> nat -> Type :=
|zz : nCk 0 0
| incl { m n : nat } : nCk m n -> nCk (S m) (S n)
diff --git a/test-suite/bugs/closed/HoTT_coq_058.v b/test-suite/bugs/closed/HoTT_coq_058.v
index 5e5d5ab3..3d16e7ac 100644
--- a/test-suite/bugs/closed/HoTT_coq_058.v
+++ b/test-suite/bugs/closed/HoTT_coq_058.v
@@ -95,10 +95,10 @@ Goal forall (T : Type) (T0 : T -> T -> Type)
| tt => idpath
end)) (x1; p) = (x1; p).
intros.
-let F := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(F) end in
-let H := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(H) end in
-let X := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(X) end in
-let T := match goal with |- appcontext[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(T) end in
+let F := match goal with |- context[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(F) end in
+let H := match goal with |- context[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(H) end in
+let X := match goal with |- context[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(X) end in
+let T := match goal with |- context[@transport _ (fun x0 => @?F x0) _ _ (@path_forall ?H ?X ?T ?f ?g ?e)] => constr:(T) end in
let t0 := fresh "t0" in
let t1 := fresh "t1" in
let T1 := lazymatch type of F with (?T -> _) -> _ => constr:(T) end in
@@ -116,7 +116,7 @@ let T1 := lazymatch type of F with (?T -> _) -> _ => constr:(T) end in
let GL1' := fresh in
set (GL0' := GL0);
- let arg := match GL0 with appcontext[x0 ?arg] => constr:(arg) end in
+ let arg := match GL0 with context[x0 ?arg] => constr:(arg) end in
assert (t1 = arg) by (subst t1; reflexivity); subst t1;
pattern (x0 arg) in GL0';
match goal with
diff --git a/test-suite/bugs/closed/HoTT_coq_117.v b/test-suite/bugs/closed/HoTT_coq_117.v
index 5fbcfef4..de60fd0a 100644
--- a/test-suite/bugs/closed/HoTT_coq_117.v
+++ b/test-suite/bugs/closed/HoTT_coq_117.v
@@ -16,10 +16,29 @@ Definition path_forall `{Funext} {A : Type} {P : A -> Type} (f g : forall x : A,
Admitted.
Inductive Empty : Set := .
-Instance contr_from_Empty {_ : Funext} (A : Type) :
+Fail Instance contr_from_Empty {_ : Funext} (A : Type) :
+ Contr_internal (Empty -> A) :=
+ BuildContr _
+ (Empty_rect (fun _ => A))
+ (fun f => path_forall _ f (fun x => Empty_rect _ x)).
+
+Fail Instance contr_from_Empty {F : Funext} (A : Type) :
Contr_internal (Empty -> A) :=
BuildContr _
(Empty_rect (fun _ => A))
(fun f => path_forall _ f (fun x => Empty_rect _ x)).
+
+(** This could be disallowed, this uses the Funext argument *)
+Instance contr_from_Empty {_ : Funext} (A : Type) :
+ Contr_internal (Empty -> A) :=
+ BuildContr _
+ (Empty_rect (fun _ => A))
+ (fun f => path_forall _ f (fun x => Empty_rect (fun _ => _ x = f x) x)).
+
+Instance contr_from_Empty' {_ : Funext} (A : Type) :
+ Contr_internal (Empty -> A) :=
+ BuildContr _
+ (Empty_rect (fun _ => A))
+ (fun f => path_forall _ f (fun x => Empty_rect (fun _ => _ x = f x) x)).
(* Toplevel input, characters 15-220:
Anomaly: unknown meta ?190. Please report. *)
diff --git a/test-suite/bugs/closed/PLACEHOLDER.v b/test-suite/bugs/closed/PLACEHOLDER.v
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test-suite/bugs/closed/PLACEHOLDER.v
diff --git a/test-suite/bugs/closed/bug_4836.v b/test-suite/bugs/closed/bug_4836.v
new file mode 100644
index 00000000..5838dcd8
--- /dev/null
+++ b/test-suite/bugs/closed/bug_4836.v
@@ -0,0 +1 @@
+(* -*- coq-prog-args: ("-compile" "bugs/closed/PLACEHOLDER.v") -*- *)
diff --git a/test-suite/bugs/closed/bug_4836/PLACEHOLDER b/test-suite/bugs/closed/bug_4836/PLACEHOLDER
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test-suite/bugs/closed/bug_4836/PLACEHOLDER
diff --git a/test-suite/bugs/opened/3383.v b/test-suite/bugs/opened/3383.v
deleted file mode 100644
index 9a14641a..00000000
--- a/test-suite/bugs/opened/3383.v
+++ /dev/null
@@ -1,7 +0,0 @@
-Goal forall b : bool, match b as b' return if b' then True else True with true => I | false => I end = match b as b' return if b' then True else True with true => I | false => I end.
-intro.
-Fail lazymatch goal with
-| [ |- appcontext[match ?b as b' return @?P b' with true => ?t | false => ?f end] ]
- => change (match b as b' return P b with true => t | false => f end) with (@bool_rect P t f)
-end. (* Toplevel input, characters 153-154:
-Error: The reference P was not found in the current environment. *)
diff --git a/test-suite/bugs/opened/3410.v b/test-suite/bugs/opened/3410.v
deleted file mode 100644
index 0d259181..00000000
--- a/test-suite/bugs/opened/3410.v
+++ /dev/null
@@ -1 +0,0 @@
-Fail repeat match goal with H:_ |- _ => setoid_rewrite X in H end.
diff --git a/test-suite/bugs/opened/3889.v b/test-suite/bugs/opened/3889.v
new file mode 100644
index 00000000..6b287324
--- /dev/null
+++ b/test-suite/bugs/opened/3889.v
@@ -0,0 +1,11 @@
+Require Import Program.
+
+Inductive Even : nat -> Prop :=
+| evenO : Even O
+| evenS : forall n, Odd n -> Even (S n)
+with Odd : nat -> Prop :=
+| oddS : forall n, Even n -> Odd (S n).
+Axiom admit : forall {T}, T.
+Program Fixpoint doubleE {n} (e : Even n) : Even (2 * n) := admit
+with doubleO {n} (o : Odd n) : Odd (S (2 * n)) := _.
+Next Obligation of doubleE.
diff --git a/test-suite/bugs/opened/3890.v b/test-suite/bugs/opened/3890.v
new file mode 100644
index 00000000..f9ac9be2
--- /dev/null
+++ b/test-suite/bugs/opened/3890.v
@@ -0,0 +1,18 @@
+Class Foo.
+Class Bar := b : Type.
+
+Instance foo : Foo := _.
+(* 1 subgoals, subgoal 1 (ID 4)
+
+ ============================
+ Foo *)
+
+Instance bar : Bar.
+exact Type.
+Defined.
+(* bar is defined *)
+
+About foo.
+(* foo not a defined object. *)
+
+Fail Defined.
diff --git a/test-suite/bugs/opened/3916.v b/test-suite/bugs/opened/3916.v
new file mode 100644
index 00000000..fd95503e
--- /dev/null
+++ b/test-suite/bugs/opened/3916.v
@@ -0,0 +1,3 @@
+Require Import List.
+
+Fail Hint Resolve -> in_map. (* Also happens when using <- instead of -> *)
diff --git a/test-suite/bugs/opened/3919.v-disabled b/test-suite/bugs/opened/3919.v-disabled
new file mode 100644
index 00000000..0d661de9
--- /dev/null
+++ b/test-suite/bugs/opened/3919.v-disabled
@@ -0,0 +1,13 @@
+Require Import MSets.
+Require Import Orders.
+
+Declare Module Signal : OrderedType.
+
+Module S := MSetAVL.Make(Signal).
+Module Sdec := Decide(S).
+Export Sdec.
+
+Hint Extern 0 (Signal.eq ?x ?y) => now symmetry.
+
+Goal forall o s, Signal.eq o s.
+Proof. fsetdec. Qed.
diff --git a/test-suite/bugs/opened/3922.v-disabled b/test-suite/bugs/opened/3922.v-disabled
new file mode 100644
index 00000000..ce4f509c
--- /dev/null
+++ b/test-suite/bugs/opened/3922.v-disabled
@@ -0,0 +1,83 @@
+Set Universe Polymorphism.
+Notation Type0 := Set.
+
+Definition Type1 := Eval hnf in let gt := (Set : Type@{i}) in Type@{i}.
+
+Notation compose := (fun g f x => g (f x)).
+
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
+Open Scope function_scope.
+
+Definition pointwise_paths {A} {P:A->Type} (f g:forall x:A, P x)
+ := forall x:A, f x = g x.
+
+Notation "f == g" := (pointwise_paths f g) (at level 70, no associativity) : type_scope.
+
+Class Contr_internal (A : Type) := BuildContr {
+ center : A ;
+ contr : (forall y : A, center = y)
+}.
+
+Inductive trunc_index : Type :=
+| minus_two : trunc_index
+| trunc_S : trunc_index -> trunc_index.
+
+Notation "n .+1" := (trunc_S n) (at level 2, left associativity, format "n .+1") : trunc_scope.
+Local Open Scope trunc_scope.
+Notation "-2" := minus_two (at level 0) : trunc_scope.
+Notation "-1" := (-2.+1) (at level 0) : trunc_scope.
+
+Fixpoint IsTrunc_internal (n : trunc_index) (A : Type) : Type :=
+ match n with
+ | -2 => Contr_internal A
+ | n'.+1 => forall (x y : A), IsTrunc_internal n' (x = y)
+ end.
+
+Class IsTrunc (n : trunc_index) (A : Type) : Type :=
+ Trunc_is_trunc : IsTrunc_internal n A.
+
+Notation Contr := (IsTrunc -2).
+Notation IsHProp := (IsTrunc -1).
+
+Monomorphic Axiom dummy_funext_type : Type0.
+Monomorphic Class Funext := { dummy_funext_value : dummy_funext_type }.
+
+Inductive Unit : Type1 :=
+ tt : Unit.
+
+Record TruncType (n : trunc_index) := BuildTruncType {
+ trunctype_type : Type ;
+ istrunc_trunctype_type : IsTrunc n trunctype_type
+}.
+
+Arguments BuildTruncType _ _ {_}.
+
+Coercion trunctype_type : TruncType >-> Sortclass.
+
+Notation "n -Type" := (TruncType n) (at level 1) : type_scope.
+Notation hProp := (-1)-Type.
+
+Notation BuildhProp := (BuildTruncType -1).
+
+Private Inductive Trunc (n : trunc_index) (A :Type) : Type :=
+ tr : A -> Trunc n A.
+Arguments tr {n A} a.
+
+Global Instance istrunc_truncation (n : trunc_index) (A : Type@{i})
+: IsTrunc@{j} n (Trunc@{i} n A).
+Admitted.
+
+Definition Trunc_ind {n A}
+ (P : Trunc n A -> Type) {Pt : forall aa, IsTrunc n (P aa)}
+ : (forall a, P (tr a)) -> (forall aa, P aa)
+:= (fun f aa => match aa with tr a => fun _ => f a end Pt).
+Definition merely (A : Type@{i}) : hProp@{i} := BuildhProp (Trunc -1 A).
+Definition cconst_factors_contr `{Funext} {X Y : Type} (f : X -> Y)
+ (P : Type) `{Pc : X -> Contr P}
+ (g : X -> P) (h : P -> Y) (p : h o g == f)
+: Unit.
+Proof.
+ assert (merely X -> IsHProp P) by admit.
+ refine (let g' := Trunc_ind (fun _ => P) g : merely X -> P in _);
+ [ assumption.. | ].
+ Fail pose (g' := Trunc_ind (fun _ => P) g : merely X -> P).
diff --git a/test-suite/bugs/opened/3926.v b/test-suite/bugs/opened/3926.v
new file mode 100644
index 00000000..cfad7635
--- /dev/null
+++ b/test-suite/bugs/opened/3926.v
@@ -0,0 +1,30 @@
+Notation compose := (fun g f x => g (f x)).
+Notation "g 'o' f" := (compose g f) (at level 40, left associativity) : function_scope.
+Open Scope function_scope.
+Inductive paths {A : Type} (a : A) : A -> Type := idpath : paths a a where "x = y" := (@paths _ x y) : type_scope.
+Arguments idpath {A a} , [A] a.
+Definition ap {A B:Type} (f:A -> B) {x y:A} (p:x = y) : f x = f y := match p with idpath => idpath end.
+Class IsEquiv {A B : Type} (f : A -> B) := { equiv_inv : B -> A }.
+Notation "f ^-1" := (@equiv_inv _ _ f _) (at level 3, format "f '^-1'") : equiv_scope.
+Local Open Scope equiv_scope.
+Axiom eisretr : forall {A B} (f : A -> B) `{IsEquiv A B f} x, f (f^-1 x) = x.
+Generalizable Variables A B C f g.
+Global Instance isequiv_compose `{IsEquiv A B f} `{IsEquiv B C g} : IsEquiv (compose g f) | 1000
+ := Build_IsEquiv A C (compose g f) (compose f^-1 g^-1).
+Definition isequiv_homotopic {A B} (f : A -> B) {g : A -> B} `{IsEquiv A B f} (h : forall x, f x = g x) : IsEquiv g
+ := Build_IsEquiv _ _ g (f ^-1).
+Global Instance isequiv_inverse {A B} (f : A -> B) `{IsEquiv A B f} : IsEquiv f^-1 | 10000
+ := Build_IsEquiv B A f^-1 f.
+Definition cancelR_isequiv {A B C} (f : A -> B) {g : B -> C}
+ `{IsEquiv A B f} `{IsEquiv A C (g o f)}
+ : IsEquiv g.
+Proof.
+ Unset Typeclasses Modulo Eta.
+ exact (isequiv_homotopic (compose (compose g f) f^-1)
+ (fun b => ap g (eisretr f b))) || fail "too early".
+ Undo.
+ Set Typeclasses Modulo Eta.
+ Set Typeclasses Dependency Order.
+ Set Typeclasses Debug.
+ Fail exact (isequiv_homotopic (compose (compose g f) f^-1)
+ (fun b => ap g (eisretr f b))).
diff --git a/test-suite/bugs/opened/3928.v-disabled b/test-suite/bugs/opened/3928.v-disabled
new file mode 100644
index 00000000..b470eb22
--- /dev/null
+++ b/test-suite/bugs/opened/3928.v-disabled
@@ -0,0 +1,12 @@
+Typeclasses eauto := bfs.
+
+Class Foo := {}.
+Class Bar := {}.
+
+Instance: Bar.
+Instance: Foo -> Bar -> Foo -> Foo | 1.
+Instance: Bar -> Foo | 100.
+Instance: Foo -> Bar -> Foo -> Foo | 1.
+
+Set Typeclasses Debug.
+Timeout 1 Check (_ : Foo). (* timeout *)
diff --git a/test-suite/bugs/opened/3938.v b/test-suite/bugs/opened/3938.v
new file mode 100644
index 00000000..2d0d1930
--- /dev/null
+++ b/test-suite/bugs/opened/3938.v
@@ -0,0 +1,6 @@
+Require Import Coq.Arith.PeanoNat.
+Hint Extern 1 => admit : typeclass_instances.
+Goal forall a b (f : nat -> Set), Nat.eq a b -> f a = f b.
+ intros a b f H.
+ rewrite H. (* Toplevel input, characters 15-25:
+Anomaly: Evar ?X11 was not declared. Please report. *)
diff --git a/test-suite/bugs/opened/3946.v b/test-suite/bugs/opened/3946.v
new file mode 100644
index 00000000..e77bdbc6
--- /dev/null
+++ b/test-suite/bugs/opened/3946.v
@@ -0,0 +1,11 @@
+Require Import ZArith.
+
+Inductive foo := Foo : Z.le 0 1 -> foo.
+
+Definition bar (f : foo) := let (f) := f in f.
+
+(* Doesn't work: *)
+(* Arguments bar f.*)
+
+(* Does work *)
+Arguments bar f _.
diff --git a/test-suite/bugs/opened/3948.v b/test-suite/bugs/opened/3948.v
new file mode 100644
index 00000000..16581308
--- /dev/null
+++ b/test-suite/bugs/opened/3948.v
@@ -0,0 +1,25 @@
+Module Type S.
+Parameter t : Type.
+End S.
+
+Module Bar(X : S).
+Proof.
+ Definition elt := X.t.
+ Axiom fold : elt.
+End Bar.
+
+Module Make (X: S) := Bar(X).
+
+Declare Module X : S.
+
+Module Type Interface.
+ Parameter constant : unit.
+End Interface.
+
+Module DepMap : Interface.
+ Module Dom := Make(X).
+ Definition constant : unit :=
+ let _ := @Dom.fold in tt.
+End DepMap.
+
+Print Assumptions DepMap.constant. \ No newline at end of file
diff --git a/test-suite/bugs/opened/4701.v b/test-suite/bugs/opened/4701.v
new file mode 100644
index 00000000..9286f0f1
--- /dev/null
+++ b/test-suite/bugs/opened/4701.v
@@ -0,0 +1,23 @@
+(*Suppose we have*)
+
+ Inductive my_if {A B} : bool -> Type :=
+ | then_case (_ : A) : my_if true
+ | else_case (_ : B) : my_if false.
+ Notation "'If' b 'Then' A 'Else' B" := (@my_if A B b) (at level 10).
+
+(*then here are three inductive type declarations that work:*)
+
+ Inductive I1 :=
+ | i1 (x : I1).
+ Inductive I2 :=
+ | i2 (x : nat).
+ Inductive I3 :=
+ | i3 (b : bool) (x : If b Then I3 Else nat).
+
+(*and here is one that does not, despite being equivalent to [I3]:*)
+
+ Fail Inductive I4 :=
+ | i4 (b : bool) (x : if b then I4 else nat). (* Error: Non strictly positive occurrence of "I4" in
+ "forall b : bool, (if b then I4 else nat) -> I4". *)
+
+(*I think this one should work. I believe this is a conservative extension over CIC: Since [match] statements returning types can always be re-encoded as inductive type families, the analysis should be independent of whether the constructor uses an inductive or a [match] statement.*)
diff --git a/test-suite/bugs/opened/4717.v b/test-suite/bugs/opened/4717.v
new file mode 100644
index 00000000..9ad47467
--- /dev/null
+++ b/test-suite/bugs/opened/4717.v
@@ -0,0 +1,19 @@
+(*See below. They sometimes work, and sometimes do not. Is this a bug?*)
+
+Require Import Omega Psatz.
+
+Definition foo := nat.
+
+Goal forall (n : foo), 0 = n - n.
+Proof. intros. omega. (* works *) Qed.
+
+Goal forall (x n : foo), x = x + n - n.
+Proof.
+ intros.
+ Fail omega. (* Omega can't solve this system *)
+ Fail lia. (* Cannot find witness. *)
+ unfold foo in *.
+ omega. (* works *)
+Qed.
+
+(* Guillaume Melquiond: What matters is the equality. In the first case, it is @eq nat. In the second case, it is @eq foo. The same issue exists for ring and field. So it is not a bug, but it is worth fixing.*)
diff --git a/test-suite/bugs/opened/4721.v b/test-suite/bugs/opened/4721.v
new file mode 100644
index 00000000..1f184b39
--- /dev/null
+++ b/test-suite/bugs/opened/4721.v
@@ -0,0 +1,13 @@
+Variables S1 S2 : Set.
+
+Goal @eq Type S1 S2 -> @eq Type S1 S2.
+intro H.
+Fail tauto.
+assumption.
+Qed.
+
+(*This is in 8.5pl1, and Matthieq Sozeau says: "That's a regression in tauto indeed, which now requires exact equality of the universes, through a non linear goal pattern matching:
+match goal with ?X1 |- ?X1 forces both instances of X1 to be convertible,
+with no additional universe constraints currently, but the two types are
+initially different. This can be fixed easily to allow the same flexibility
+as in 8.4 (or assumption) to unify the universes as well."*)
diff --git a/test-suite/bugs/opened/4728.v b/test-suite/bugs/opened/4728.v
new file mode 100644
index 00000000..230b4beb
--- /dev/null
+++ b/test-suite/bugs/opened/4728.v
@@ -0,0 +1,72 @@
+(*I'd like the final [Check] in the following to work:*)
+
+Ltac fin_eta_expand :=
+ [ > lazymatch goal with
+ | [ H : _ |- _ ] => clear H
+ end..
+ | lazymatch goal with
+ | [ H : ?T |- ?T ]
+ => exact H
+ | [ |- ?G ]
+ => fail 0 "No hypothesis matching" G
+ end ];
+ let n := numgoals in
+ tryif constr_eq numgoals 0
+ then idtac
+ else fin_eta_expand.
+
+Ltac pre_eta_expand x :=
+ let T := type of x in
+ let G := match goal with |- ?G => G end in
+ unify T G;
+ unshelve econstructor;
+ destruct x;
+ fin_eta_expand.
+
+Ltac eta_expand x :=
+ let v := constr:(ltac:(pre_eta_expand x)) in
+ idtac v;
+ let v := (eval cbv beta iota zeta in v) in
+ exact v.
+
+Notation eta_expand x := (ltac:(eta_expand x)) (only parsing).
+
+Ltac partial_unify eqn :=
+ lazymatch eqn with
+ | ?x = ?x => idtac
+ | ?f ?x = ?g ?y
+ => partial_unify (f = g);
+ (tryif unify x y then
+ idtac
+ else tryif has_evar x then
+ unify x y
+ else tryif has_evar y then
+ unify x y
+ else
+ idtac)
+ | ?x = ?y
+ => idtac;
+ (tryif unify x y then
+ idtac
+ else tryif has_evar x then
+ unify x y
+ else tryif has_evar y then
+ unify x y
+ else
+ idtac)
+ end.
+
+Tactic Notation "{" open_constr(old_record) "with" open_constr(new_record) "}" :=
+ let old_record' := eta_expand old_record in
+ partial_unify (old_record = new_record);
+ eexact new_record.
+
+Set Implicit Arguments.
+Record prod A B := pair { fst : A ; snd : B }.
+Infix "*" := prod : type_scope.
+Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
+
+Notation "{ old 'with' new }" := (ltac:({ old with new })) (only parsing).
+
+Check ltac:({ (1, 1) with {| snd := 2 |} }).
+Fail Check { (1, 1) with {| snd := 2 |} }. (* Error: Cannot infer this placeholder of type "Type"; should succeed *)
diff --git a/test-suite/bugs/opened/4755.v b/test-suite/bugs/opened/4755.v
new file mode 100644
index 00000000..9cc0d361
--- /dev/null
+++ b/test-suite/bugs/opened/4755.v
@@ -0,0 +1,34 @@
+(*I'm not sure which behavior is better. But if the change is intentional, it should be documented (I don't think it is), and it'd be nice if there were a flag for this, or if -compat 8.4 restored the old behavior.*)
+
+Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms.
+Definition f (v : option nat) := match v with
+ | Some k => Some k
+ | None => None
+ end.
+
+Axioms F G : (option nat -> option nat) -> Prop.
+Axiom FG : forall f, f None = None -> F f = G f.
+
+Axiom admit : forall {T}, T.
+
+Existing Instance eq_Reflexive.
+
+Global Instance foo (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl))
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+
+Global Instance bar (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> eq ==> Basics.flip Basics.impl)
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+
+Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k.
+Proof.
+ intro.
+ pose proof (_ : (Proper (_ ==> eq ==> _) and)).
+ Fail setoid_rewrite (FG _ _); []. (* In 8.5: Error: Tactic failure: Incorrect number of goals (expected 2 tactics); works in 8.4 *)
diff --git a/test-suite/bugs/opened/4771.v b/test-suite/bugs/opened/4771.v
new file mode 100644
index 00000000..396d74bd
--- /dev/null
+++ b/test-suite/bugs/opened/4771.v
@@ -0,0 +1,22 @@
+Module Type Foo.
+
+Parameter Inline t : nat.
+
+End Foo.
+
+Module F(X : Foo).
+
+Tactic Notation "foo" ref(x) := idtac.
+
+Ltac g := foo X.t.
+
+End F.
+
+Module N.
+Definition t := 0 + 0.
+End N.
+
+Module K := F(N).
+
+(* Was
+Anomaly: Uncaught exception Not_found. Please report. *)
diff --git a/test-suite/bugs/opened/4778.v b/test-suite/bugs/opened/4778.v
new file mode 100644
index 00000000..633d158e
--- /dev/null
+++ b/test-suite/bugs/opened/4778.v
@@ -0,0 +1,35 @@
+Require Import Coq.Setoids.Setoid Coq.Classes.Morphisms.
+Definition f (v : option nat) := match v with
+ | Some k => Some k
+ | None => None
+ end.
+
+Axioms F G : (option nat -> option nat) -> Prop.
+Axiom FG : forall f, f None = None -> F f = G f.
+
+Axiom admit : forall {T}, T.
+
+Existing Instance eq_Reflexive.
+
+(* This instance is needed in 8.4, but is useless in 8.5 *)
+Global Instance foo (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> forall_relation (fun _ => Basics.flip Basics.impl))
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+
+(*
+(* This is required in 8.5, but useless in 8.4 *)
+Global Instance bar (A := nat)
+ : Proper ((pointwise_relation _ eq)
+ ==> eq ==> eq ==> Basics.flip Basics.impl)
+ (@option_rect A (fun _ => Prop)) | 0.
+exact admit.
+Qed.
+*)
+
+Goal forall k, option_rect (fun _ => Prop) (fun v : nat => v = v /\ F f) True k. Proof.
+ intro.
+ pose proof (_ : (Proper (_ ==> eq ==> _) and)).
+ Fail setoid_rewrite (FG _ _); [ | reflexivity.. ]. (* this should succeed without [Fail], as it does in 8.4 *)
diff --git a/test-suite/bugs/opened/4781.v b/test-suite/bugs/opened/4781.v
new file mode 100644
index 00000000..8b651ac2
--- /dev/null
+++ b/test-suite/bugs/opened/4781.v
@@ -0,0 +1,94 @@
+Ltac force_clear :=
+ clear;
+ repeat match goal with
+ | [ H : _ |- _ ] => clear H
+ | [ H := _ |- _ ] => clearbody H
+ end.
+
+Class abstract_term {T} (x : T) := by_abstract_term : T.
+Hint Extern 0 (@abstract_term ?T ?x) => force_clear; change T; abstract (exact x) : typeclass_instances.
+
+Goal True.
+(* These work: *)
+ let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ pose x.
+ let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := (eval cbv iota in (let v : T := x in v)) in
+ pose x.
+ let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := match constr:(Set) with ?y => constr:(y) end in
+ pose x.
+(* This fails with an error: *)
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := match constr:(x) with ?y => constr:(y) end in
+ pose x. (* The command has indeed failed with message:
+Error: Variable y should be bound to a term. *)
+(* And the rest fail with Anomaly: Uncaught exception Not_found. Please report. *)
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := match constr:(x) with ?y => y end in
+ pose x.
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := (eval cbv iota in x) in
+ pose x.
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let x := type of x in
+ pose x. (* should succeed *)
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:(_ : abstract_term term) in
+ let x := type of x in
+ pose x. (* should succeed *)
+
+(*Apparently what [cbv iota] doesn't see can't hurt it, and [pose] is perfectly happy with abstracted lemmas only some of the time.
+
+Even stranger, consider:*)
+ let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let y := (eval cbv iota in (let v : T := x in v)) in
+ pose y;
+ let x' := fresh "x'" in
+ pose x as x'.
+ let x := (eval cbv delta [x'] in x') in
+ pose x;
+ let z := (eval cbv iota in x) in
+ pose z.
+
+(*This works fine. But if I change the period to a semicolon, I get:*)
+
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let y := (eval cbv iota in (let v : T := x in v)) in
+ pose y;
+ let x' := fresh "x'" in
+ pose x as x';
+ let x := (eval cbv delta [x'] in x') in
+ pose x. (* Anomaly: Uncaught exception Not_found. Please report. *)
+ (* should succeed *)
+(*and if I use the second one instead of [pose x] (note that using [idtac] works fine), I get:*)
+
+ Fail let term := constr:(I) in
+ let T := type of term in
+ let x := constr:((_ : abstract_term term) : T) in
+ let y := (eval cbv iota in (let v : T := x in v)) in
+ pose y;
+ let x' := fresh "x'" in
+ pose x as x';
+ let x := (eval cbv delta [x'] in x') in
+ let z := (eval cbv iota in x) in (* Error: Variable x should be bound to a term. *)
+ idtac. (* should succeed *)
diff --git a/test-suite/bugs/opened/4803.v b/test-suite/bugs/opened/4803.v
new file mode 100644
index 00000000..4530548b
--- /dev/null
+++ b/test-suite/bugs/opened/4803.v
@@ -0,0 +1,48 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *)
+(*Suppose a user wants to declare a new list-like notation with support for singletons in both 8.4 and 8.5. If they use*)
+Require Import Coq.Lists.List.
+Require Import Coq.Vectors.Vector.
+Import ListNotations.
+Import VectorNotations.
+Set Implicit Arguments.
+Inductive mylist T := mynil | mycons (_ : T) (_ : mylist T).
+Arguments mynil {_}, _.
+
+Delimit Scope mylist_scope with mylist.
+Bind Scope mylist_scope with mylist.
+Delimit Scope vector_scope with vector.
+
+Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
+Notation " [ x ] " := (mycons x mynil) : mylist_scope.
+Notation " [ x ; .. ; y ] " := (mycons x .. (mycons y mynil) ..) : mylist_scope.
+
+(** All of these should work fine in -compat 8.4 mode, just as they do in Coq 8.4. There needs to be a way to specify notations above so that all of these [Check]s go through in both 8.4 and 8.5 *)
+Check [ ]%mylist : mylist _.
+Check [ ]%list : list _.
+Check []%vector : Vector.t _ _.
+Check [ _ ]%mylist : mylist _.
+Check [ _ ]%list : list _.
+Check [ _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%list : list _.
+Check [ _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ]%mylist : mylist _.
+Check [ _ ; _ ; _ ; _ ]%list : list _.
+Check [ _ ; _ ; _ ; _ ]%vector : Vector.t _ _.
+Check [ _ ; _ ; _ ; _ ]%mylist : mylist _.
+
+(** Now check that we can add and then remove notations from the parser *)
+(* We should be able to stick some vernacular here to remove [] from the parser *)
+Fail Remove Notation "[]".
+Goal True.
+ (* This should not be a syntax error; before moving this file to closed, uncomment this line. *)
+ (* idtac; []. *)
+ constructor.
+Qed.
+
+Check { _ : _ & _ }.
+Reserved Infix "&" (at level 0).
+Fail Remove Infix "&".
+(* Check { _ : _ & _ }. *)
diff --git a/test-suite/bugs/opened/4813.v b/test-suite/bugs/opened/4813.v
new file mode 100644
index 00000000..b7517017
--- /dev/null
+++ b/test-suite/bugs/opened/4813.v
@@ -0,0 +1,5 @@
+(* An example one would like to see succeeding *)
+
+Record T := BT { t : Set }.
+Record U (x : T) := BU { u : t x -> Prop }.
+Fail Definition A (H : unit -> Prop) : U (BT unit) := BU _ H.
diff --git a/test-suite/complexity/ring2.v b/test-suite/complexity/ring2.v
index 52dae265..04fa5907 100644
--- a/test-suite/complexity/ring2.v
+++ b/test-suite/complexity/ring2.v
@@ -39,7 +39,7 @@ Admitted.
Ltac Zcst t :=
match isZcst t with
true => t
- | _ => constr:NotConstant
+ | _ => constr:(NotConstant)
end.
Add Ring Zr : Zth
diff --git a/test-suite/csdp.cache b/test-suite/csdp.cache
deleted file mode 100644
index 297ac255..00000000
--- a/test-suite/csdp.cache
+++ /dev/null
Binary files differ
diff --git a/test-suite/failure/int31.v b/test-suite/failure/int31.v
new file mode 100644
index 00000000..b1d11224
--- /dev/null
+++ b/test-suite/failure/int31.v
@@ -0,0 +1,17 @@
+Require Import Int31 BigN.
+
+Open Scope int31_scope.
+
+(* This used to go through because of an unbalanced stack bug in the bytecode
+interpreter *)
+
+Lemma bad : False.
+assert (1 = 2).
+change 1 with (add31 (addmuldiv31 65 (add31 1 1) 2) 1).
+Fail vm_compute; reflexivity.
+(*
+discriminate.
+Qed.
+*)
+Abort.
+
diff --git a/test-suite/failure/positivity.v b/test-suite/failure/positivity.v
index 91de8733..8089de2b 100644
--- a/test-suite/failure/positivity.v
+++ b/test-suite/failure/positivity.v
@@ -5,5 +5,47 @@
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-Fail Inductive t : Set :=
- c : (t -> nat) -> t.
+
+(* Negative occurrence *)
+Fail Inductive t : Type :=
+ c : (t -> nat) -> t.
+
+(* Non-strictely positive occurrence *)
+Fail Inductive t : Type :=
+ c : ((t -> nat) -> nat) -> t.
+
+(* Self-nested type (no proof of
+ soundness yet *)
+Fail Inductive t (A:Type) : Type :=
+ c : t (t A) -> t A.
+
+(* Nested inductive types *)
+
+Inductive pos (A:Type) :=
+ p : pos A -> pos A.
+
+Inductive nnpos (A:Type) :=
+ nnp : ((A -> nat) -> nat) -> nnpos A.
+
+Inductive neg (A:Type) :=
+ n : (A->neg A) -> neg A.
+
+Inductive arg : Type -> Prop :=
+ a : forall A, arg A -> arg A.
+
+(* Strictly covariant parameter: accepted. *)
+Fail Fail Inductive t :=
+ c : pos t -> t.
+
+(* Non-strictly covariant parameter: not
+ strictly positive. *)
+Fail Inductive t :=
+ c : nnpos t -> t.
+
+(* Contravariant parameter: not positive. *)
+Fail Inductive t :=
+ c : neg t -> t.
+
+(* Strict index: not positive. *)
+Fail Inductive t :=
+ c : arg t -> t.
diff --git a/test-suite/ide/undo013.fake b/test-suite/ide/undo013.fake
index f44156aa..921a9d0f 100644
--- a/test-suite/ide/undo013.fake
+++ b/test-suite/ide/undo013.fake
@@ -23,5 +23,5 @@ ADD { Qed. }
ADD { apply H. }
# </replay>
ADD { Qed. }
-QUERY { Fail idtac. }
+QUERY { Fail Show. }
QUERY { Check (aa,bb,cc). }
diff --git a/test-suite/ide/undo014.fake b/test-suite/ide/undo014.fake
index 6d58b061..f5fe7747 100644
--- a/test-suite/ide/undo014.fake
+++ b/test-suite/ide/undo014.fake
@@ -22,5 +22,5 @@ ADD { destruct H. }
ADD { Qed. }
ADD { apply H. }
ADD { Qed. }
-QUERY { Fail idtac. }
+QUERY { Fail Show. }
QUERY { Check (aa,bb,cc). }
diff --git a/test-suite/ide/undo015.fake b/test-suite/ide/undo015.fake
index ac17985a..a1e5c947 100644
--- a/test-suite/ide/undo015.fake
+++ b/test-suite/ide/undo015.fake
@@ -25,5 +25,5 @@ ADD { destruct H. }
ADD { Qed. }
ADD { apply H. }
ADD { Qed. }
-QUERY { Fail idtac. }
+QUERY { Fail Show. }
QUERY { Check (aa,bb,cc). }
diff --git a/test-suite/ide/undo016.fake b/test-suite/ide/undo016.fake
index bdb81ecd..f9414c1e 100644
--- a/test-suite/ide/undo016.fake
+++ b/test-suite/ide/undo016.fake
@@ -27,5 +27,5 @@ ADD { destruct H. }
ADD { Qed. }
ADD { apply H. }
ADD { Qed. }
-QUERY { Fail idtac. }
+QUERY { Fail Show. }
QUERY { Check (aa,bb,cc). }
diff --git a/test-suite/interactive/proof_block.v b/test-suite/interactive/proof_block.v
new file mode 100644
index 00000000..31e34937
--- /dev/null
+++ b/test-suite/interactive/proof_block.v
@@ -0,0 +1,66 @@
+Goal False /\ True.
+Proof.
+split.
+ idtac.
+ idtac.
+ exact I.
+idtac.
+idtac.
+exact I.
+Qed.
+
+Lemma baz : (exists n, n = 3 /\ n = 3) /\ True.
+Proof.
+split. { eexists. split. par: trivial. }
+trivial.
+Qed.
+
+Lemma baz1 : (True /\ False) /\ True.
+Proof.
+split. { split. par: trivial. }
+trivial.
+Qed.
+
+Lemma foo : (exists n, n = 3 /\ n = 3) /\ True.
+Proof.
+split.
+ { idtac.
+ unshelve eexists.
+ { apply 3. }
+ { split.
+ { idtac. trivialx. }
+ { reflexivity. } } }
+ trivial.
+Qed.
+
+Lemma foo1 : False /\ True.
+Proof.
+split.
+ { exact I. }
+ { exact I. }
+Qed.
+
+Definition banana := true + 4.
+
+Check banana.
+
+Lemma bar : (exists n, n = 3 /\ n = 3) /\ True.
+Proof.
+split.
+ - idtac.
+ unshelve eexists.
+ + apply 3.
+ + split.
+ * idtacx. trivial.
+ * reflexivity.
+ - trivial.
+Qed.
+
+Lemma baz2 : ((1=0 /\ False) /\ True) /\ False.
+Proof.
+split. split. split.
+ - solve [ auto ].
+ - solve [ trivial ].
+ - solve [ trivial ].
+ - exact 6.
+Qed. \ No newline at end of file
diff --git a/test-suite/micromega/bertot.v b/test-suite/micromega/bertot.v
index bcf222f9..29171aed 100644
--- a/test-suite/micromega/bertot.v
+++ b/test-suite/micromega/bertot.v
@@ -11,6 +11,8 @@ Require Import Psatz.
Open Scope Z_scope.
+
+
Goal (forall x y n,
( ~ x < n /\ x <= n /\ 2 * y = x*(x+1) -> 2 * y = n*(n+1))
/\
diff --git a/test-suite/micromega/qexample.v b/test-suite/micromega/qexample.v
index 47e6005b..d001e8f7 100644
--- a/test-suite/micromega/qexample.v
+++ b/test-suite/micromega/qexample.v
@@ -6,32 +6,29 @@
(* *)
(************************************************************************)
-Require Import Psatz.
+Require Import Lqa.
Require Import QArith.
Lemma plus_minus : forall x y,
0 == x + y -> 0 == x -y -> 0 == x /\ 0 == y.
Proof.
intros.
- psatzl Q.
+ lra.
Qed.
-
-
-
(* Other (simple) examples *)
Open Scope Q_scope.
Lemma binomial : forall x y:Q, ((x+y)^2 == x^2 + (2 # 1) *x*y + y^2).
Proof.
intros.
- psatzl Q.
+ lra.
Qed.
Lemma hol_light19 : forall m n, (2 # 1) * m + n == (n + m) + m.
Proof.
- intros ; psatzl Q.
+ intros ; lra.
Qed.
Open Scope Z_scope.
Open Scope Q_scope.
@@ -60,7 +57,11 @@ Lemma vcgen_25 : forall
(( 1# 1) == (-2 # 1) * i + it).
Proof.
intros.
- psatzl Q.
+ lra.
+Qed.
+
+Goal forall x : Q, x * x >= 0.
+ intro; nra.
Qed.
Goal forall x, -x^2 >= 0 -> x - 1 >= 0 -> False.
diff --git a/test-suite/micromega/rexample.v b/test-suite/micromega/rexample.v
index 2eed7e95..bd522701 100644
--- a/test-suite/micromega/rexample.v
+++ b/test-suite/micromega/rexample.v
@@ -6,16 +6,22 @@
(* *)
(************************************************************************)
-Require Import Psatz.
+Require Import Lra.
Require Import Reals.
Open Scope R_scope.
+
+Lemma cst_test : 5^5 = 5 * 5 * 5 *5 *5.
+Proof.
+ lra.
+Qed.
+
Lemma yplus_minus : forall x y,
0 = x + y -> 0 = x -y -> 0 = x /\ 0 = y.
Proof.
intros.
- psatzl R.
+ lra.
Qed.
(* Other (simple) examples *)
@@ -23,13 +29,13 @@ Qed.
Lemma binomial : forall x y, ((x+y)^2 = x^2 + 2 *x*y + y^2).
Proof.
intros.
- psatzl R.
+ lra.
Qed.
Lemma hol_light19 : forall m n, 2 * m + n = (n + m) + m.
Proof.
- intros ; psatzl R.
+ intros ; lra.
Qed.
@@ -57,7 +63,7 @@ Lemma vcgen_25 : forall
(( 1 ) = (-2 ) * i + it).
Proof.
intros.
- psatzl R.
+ lra.
Qed.
Goal forall x, -x^2 >= 0 -> x - 1 >= 0 -> False.
@@ -72,5 +78,11 @@ Proof.
Qed.
Lemma l1 : forall x y z : R, Rabs (x - z) <= Rabs (x - y) + Rabs (y - z).
-intros; split_Rabs; psatzl R.
-Qed. \ No newline at end of file
+intros; split_Rabs; lra.
+Qed.
+
+(* Bug 5073 *)
+Lemma opp_eq_0_iff a : -a = 0 <-> a = 0.
+Proof.
+ lra.
+Qed.
diff --git a/test-suite/micromega/square.v b/test-suite/micromega/square.v
index 8767f687..abf8be72 100644
--- a/test-suite/micromega/square.v
+++ b/test-suite/micromega/square.v
@@ -53,8 +53,7 @@ Qed.
Theorem sqrt2_not_rational : ~exists x:Q, x^2==2#1.
Proof.
- unfold Qeq; intros [x]; simpl (Qden (2#1)); rewrite Z.mul_1_r.
- intros HQeq.
+ unfold Qeq; intros (x,HQeq); simpl (Qden (2#1)) in HQeq; rewrite Z.mul_1_r in HQeq.
assert (Heq : (Qnum x ^ 2 = 2 * ' Qden x ^ 2%Q)%Z) by
(rewrite QnumZpower in HQeq ; rewrite QdenZpower in HQeq ; auto).
assert (Hnx : (Qnum x <> 0)%Z)
diff --git a/test-suite/micromega/zomicron.v b/test-suite/micromega/zomicron.v
index 0ec1dbfb..239bc693 100644
--- a/test-suite/micromega/zomicron.v
+++ b/test-suite/micromega/zomicron.v
@@ -8,9 +8,10 @@ Proof.
lia.
Qed.
+
Lemma two_x_y_eq_1 : forall x y, 2 * x + 2 * y = 1 -> False.
Proof.
- intros.
+ intros.
lia.
Qed.
@@ -20,6 +21,12 @@ Proof.
lia.
Qed.
+Lemma unused : forall x y, y >= 0 /\ x = 1 -> x = 1.
+Proof.
+ intros x y.
+ lia.
+Qed.
+
Lemma omega_nightmare : forall x y, 27 <= 11 * x + 13 * y <= 45 -> -10 <= 7 * x - 9 * y <= 4 -> False.
Proof.
intros ; intuition auto.
@@ -33,4 +40,53 @@ Lemma compact_proof : forall z,
Proof.
intros.
lia.
-Qed. \ No newline at end of file
+Qed.
+
+Lemma dummy_ex : exists (x:Z), x = x.
+Proof.
+ eexists.
+ lia.
+ Unshelve.
+ exact Z0.
+Qed.
+
+Lemma unused_concl : forall x,
+ False -> x > 0 -> x < 0.
+Proof.
+ intro.
+ lia.
+Qed.
+
+Lemma unused_concl_match : forall (x:Z),
+ False -> match x with
+ | Z0 => True
+ | _ => x = x
+ end.
+Proof.
+ intros.
+ lia.
+Qed.
+
+Lemma fresh : forall (__arith : Prop),
+ __arith -> True.
+Proof.
+ intros.
+ lia.
+Qed.
+
+Class Foo {x : Z} := { T : Type ; dec : T -> Z }.
+Goal forall bound {F : @Foo bound} (x y : T), 0 <= dec x < bound -> 0 <= dec y
+< bound -> dec x + dec y >= bound -> dec x + dec y < 2 * bound.
+Proof.
+ intros.
+ lia.
+Qed.
+
+(* Bug 5073 *)
+Lemma opp_eq_0_iff a : -a = 0 <-> a = 0.
+Proof.
+ lia.
+Qed.
+
+
+
diff --git a/test-suite/misc/deps/A/A.v b/test-suite/misc/deps/A/A.v
new file mode 100644
index 00000000..49aaf4a7
--- /dev/null
+++ b/test-suite/misc/deps/A/A.v
@@ -0,0 +1 @@
+Definition b := true.
diff --git a/test-suite/misc/deps/B/A.v b/test-suite/misc/deps/B/A.v
new file mode 100644
index 00000000..c01a30dc
--- /dev/null
+++ b/test-suite/misc/deps/B/A.v
@@ -0,0 +1 @@
+Definition b := false.
diff --git a/test-suite/misc/deps/B/B.v b/test-suite/misc/deps/B/B.v
new file mode 100644
index 00000000..f3cda70a
--- /dev/null
+++ b/test-suite/misc/deps/B/B.v
@@ -0,0 +1,7 @@
+Require A.
+
+Definition c := A.b.
+Lemma foo : c = false.
+Proof.
+reflexivity.
+Qed.
diff --git a/test-suite/misc/deps/checksum.v b/test-suite/misc/deps/checksum.v
new file mode 100644
index 00000000..450045e4
--- /dev/null
+++ b/test-suite/misc/deps/checksum.v
@@ -0,0 +1,2 @@
+Require Import A.
+Fail Require Import B.
diff --git a/test-suite/output-modulo-time/ltacprof.out b/test-suite/output-modulo-time/ltacprof.out
new file mode 100644
index 00000000..cc04c2c9
--- /dev/null
+++ b/test-suite/output-modulo-time/ltacprof.out
@@ -0,0 +1,12 @@
+total time: 1.528s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─sleep' -------------------------------- 100.0% 100.0% 1 1.528s
+─constructor --------------------------- 0.0% 0.0% 1 0.000s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─sleep' -------------------------------- 100.0% 100.0% 1 1.528s
+─constructor --------------------------- 0.0% 0.0% 1 0.000s
+
diff --git a/test-suite/output-modulo-time/ltacprof.v b/test-suite/output-modulo-time/ltacprof.v
new file mode 100644
index 00000000..6611db70
--- /dev/null
+++ b/test-suite/output-modulo-time/ltacprof.v
@@ -0,0 +1,8 @@
+(* -*- coq-prog-args: ("-emacs" "-profile-ltac-cutoff" "0.0") -*- *)
+Ltac sleep' := do 100 (do 100 (do 100 idtac)).
+Ltac sleep := sleep'.
+
+Theorem x : True.
+Proof.
+ idtac. idtac. sleep. constructor.
+Defined.
diff --git a/test-suite/output-modulo-time/ltacprof_cutoff.out b/test-suite/output-modulo-time/ltacprof_cutoff.out
new file mode 100644
index 00000000..0cd5777c
--- /dev/null
+++ b/test-suite/output-modulo-time/ltacprof_cutoff.out
@@ -0,0 +1,31 @@
+total time: 1.584s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─foo2 ---------------------------------- 0.0% 100.0% 1 1.584s
+─sleep --------------------------------- 100.0% 100.0% 3 0.572s
+─foo1 ---------------------------------- 0.0% 63.9% 1 1.012s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─foo2 ---------------------------------- 0.0% 100.0% 1 1.584s
+â””foo1 ---------------------------------- 0.0% 63.9% 1 1.012s
+
+total time: 1.584s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─sleep --------------------------------- 100.0% 100.0% 3 0.572s
+─foo2 ---------------------------------- 0.0% 100.0% 1 1.584s
+─foo1 ---------------------------------- 0.0% 63.9% 1 1.012s
+─foo0 ---------------------------------- 0.0% 31.3% 1 0.496s
+
+ tactic local total calls max
+────────────────────────────────────────┴──────┴──────┴───────┴─────────┘
+─foo2 ---------------------------------- 0.0% 100.0% 1 1.584s
+ ├─foo1 -------------------------------- 0.0% 63.9% 1 1.012s
+ │ ├─sleep ----------------------------- 32.6% 32.6% 1 0.516s
+ │ └─foo0 ------------------------------ 0.0% 31.3% 1 0.496s
+ │ └sleep ----------------------------- 31.3% 31.3% 1 0.496s
+ └─sleep ------------------------------- 36.1% 36.1% 1 0.572s
+
diff --git a/test-suite/output-modulo-time/ltacprof_cutoff.v b/test-suite/output-modulo-time/ltacprof_cutoff.v
new file mode 100644
index 00000000..50131470
--- /dev/null
+++ b/test-suite/output-modulo-time/ltacprof_cutoff.v
@@ -0,0 +1,12 @@
+(* -*- coq-prog-args: ("-emacs" "-profile-ltac") -*- *)
+Require Coq.ZArith.BinInt.
+Ltac sleep := do 50 (idtac; let sleep := (eval vm_compute in Coq.ZArith.BinInt.Z.div_eucl) in idtac).
+
+Ltac foo0 := idtac; sleep.
+Ltac foo1 := sleep; foo0.
+Ltac foo2 := sleep; foo1.
+Goal True.
+ foo2.
+ Show Ltac Profile CutOff 47.
+ constructor.
+Qed.
diff --git a/test-suite/output/Arguments.out b/test-suite/output/Arguments.out
index 2c7b04c6..a2ee2d4c 100644
--- a/test-suite/output/Arguments.out
+++ b/test-suite/output/Arguments.out
@@ -101,4 +101,4 @@ Error: Unknown interpretation for notation "$".
w 3 true = tt
: Prop
The command has indeed failed with message:
-Error: Extra argument _.
+Error: Extra arguments: _, _.
diff --git a/test-suite/output/Arguments.v b/test-suite/output/Arguments.v
index 05eeaac6..bd924047 100644
--- a/test-suite/output/Arguments.v
+++ b/test-suite/output/Arguments.v
@@ -17,7 +17,7 @@ Definition fcomp A B C f (g : A -> B) (x : A) : C := f (g x).
Arguments fcomp {_ _ _}%type_scope f g x /.
About fcomp.
Definition volatile := fun x : nat => x.
-Arguments volatile /.
+Arguments volatile / _.
About volatile.
Set Implicit Arguments.
Section S1.
diff --git a/test-suite/output/ArgumentsScope.v b/test-suite/output/ArgumentsScope.v
index 1ff53294..3a90cb79 100644
--- a/test-suite/output/ArgumentsScope.v
+++ b/test-suite/output/ArgumentsScope.v
@@ -11,11 +11,11 @@ About b.
About negb''.
About negb'.
About negb.
-Global Arguments Scope negb'' [ _ ].
-Global Arguments Scope negb' [ _ ].
-Global Arguments Scope negb [ _ ].
-Global Arguments Scope a [ _ ].
-Global Arguments Scope b [ _ ].
+Global Arguments negb'' _ : clear scopes.
+Global Arguments negb' _ : clear scopes.
+Global Arguments negb _ : clear scopes.
+Global Arguments a _ : clear scopes.
+Global Arguments b _ : clear scopes.
About a.
About b.
About negb.
diff --git a/test-suite/output/Arguments_renaming.out b/test-suite/output/Arguments_renaming.out
index 1e3cc37d..b084ad49 100644
--- a/test-suite/output/Arguments_renaming.out
+++ b/test-suite/output/Arguments_renaming.out
@@ -1,13 +1,17 @@
The command has indeed failed with message:
Error: To rename arguments the "rename" flag must be specified.
Argument A renamed to B.
-The command has indeed failed with message:
-Error: To rename arguments the "rename" flag must be specified.
-Argument A renamed to T.
+File "stdin", line 2, characters 0-25:
+Warning: This command is just asserting the names of arguments of identity.
+If this is what you want add ': assert' to silence the warning. If you want
+to clear implicit arguments add ': clear implicits'. If you want to clear
+notation scopes add ': clear scopes' [arguments-assert,vernacular]
@eq_refl
: forall (B : Type) (y : B), y = y
-@eq_refl nat
- : forall x : nat, x = x
+eq_refl
+ : ?y = ?y
+where
+?y : [ |- nat]
Inductive eq (A : Type) (x : A) : A -> Prop := eq_refl : x = x
For eq_refl: Arguments are renamed to B, y
@@ -99,15 +103,15 @@ Expands to: Constant Top.myplus
@myplus
: forall Z : Type, Z -> nat -> nat -> nat
The command has indeed failed with message:
-Error: All arguments lists must declare the same names.
+Error: Argument lists should agree on the names they provide.
The command has indeed failed with message:
-Error: The following arguments are not declared: x.
+Error: Sequences of implicit arguments must be of different lengths.
The command has indeed failed with message:
-Error: Arguments names must be distinct.
+Error: Some argument names are duplicated: F
The command has indeed failed with message:
Error: Argument z cannot be declared implicit.
The command has indeed failed with message:
-Error: Extra argument y.
+Error: Extra arguments: y.
The command has indeed failed with message:
Error: To rename arguments the "rename" flag must be specified.
Argument A renamed to R.
diff --git a/test-suite/output/Arguments_renaming.v b/test-suite/output/Arguments_renaming.v
index e68fbd69..0cb33134 100644
--- a/test-suite/output/Arguments_renaming.v
+++ b/test-suite/output/Arguments_renaming.v
@@ -1,6 +1,6 @@
Fail Arguments eq_refl {B y}, [B] y.
-Fail Arguments identity T _ _.
-Arguments eq_refl A x.
+Arguments identity A _ _.
+Arguments eq_refl A x : assert.
Arguments eq_refl {B y}, [B] y : rename.
Check @eq_refl.
@@ -46,9 +46,9 @@ About myplus.
Check @myplus.
Fail Arguments eq_refl {F g}, [H] k.
-Fail Arguments eq_refl {F}, [F].
-Fail Arguments eq_refl {F F}, [F] F.
-Fail Arguments eq {F} x [z].
+Fail Arguments eq_refl {F}, [F] : rename.
+Fail Arguments eq_refl {F F}, [F] F : rename.
+Fail Arguments eq {F} x [z] : rename.
Fail Arguments eq {F} x z y.
Fail Arguments eq {R} s t.
diff --git a/test-suite/output/Binder.out b/test-suite/output/Binder.out
new file mode 100644
index 00000000..34558e9a
--- /dev/null
+++ b/test-suite/output/Binder.out
@@ -0,0 +1,8 @@
+foo = fun '(x, y) => x + y
+ : nat * nat -> nat
+forall '(a, b), a /\ b
+ : Prop
+foo = λ '(x, y), x + y
+ : nat * nat → nat
+∀ '(a, b), a ∧ b
+ : Prop
diff --git a/test-suite/output/Binder.v b/test-suite/output/Binder.v
new file mode 100644
index 00000000..9aced9f6
--- /dev/null
+++ b/test-suite/output/Binder.v
@@ -0,0 +1,7 @@
+Definition foo '(x,y) := x + y.
+Print foo.
+Check forall '(a,b), a /\ b.
+
+Require Import Utf8.
+Print foo.
+Check forall '(a,b), a /\ b.
diff --git a/test-suite/output/Cases.out b/test-suite/output/Cases.out
index 09f032d4..8ce6f979 100644
--- a/test-suite/output/Cases.out
+++ b/test-suite/output/Cases.out
@@ -6,6 +6,8 @@ fix F (t : t) : P t :=
end
: forall P : t -> Type,
(let x := t in forall x0 : x, P x0 -> P (k x0)) -> forall t : t, P t
+
+Argument scopes are [function_scope function_scope _]
= fun d : TT => match d with
| @CTT _ _ b => b
end
@@ -24,7 +26,7 @@ match Nat.eq_dec x y with
end
: forall (x y : nat) (P : nat -> Type), P x -> P y -> P y
-Argument scopes are [nat_scope nat_scope _ _ _]
+Argument scopes are [nat_scope nat_scope function_scope _ _]
foo =
fix foo (A : Type) (l : list A) {struct l} : option A :=
match l with
@@ -48,9 +50,25 @@ f =
fun H : B =>
match H with
| AC x =>
- (let b0 := b in
- if b0 as b return (P b -> True)
+ let b0 := b in
+ (if b0 as b return (P b -> True)
then fun _ : P true => Logic.I
else fun _ : P false => Logic.I) x
end
: B -> True
+The command has indeed failed with message:
+Non exhaustive pattern-matching: no clause found for pattern
+gadtTy _ _
+The command has indeed failed with message:
+In environment
+texpDenote : forall t : type, texp t -> typeDenote t
+t : type
+e : texp t
+t1 : type
+t2 : type
+t0 : type
+b : tbinop t1 t2 t0
+e1 : texp t1
+e2 : texp t2
+The term "0" has type "nat" while it is expected to have type
+ "typeDenote t0".
diff --git a/test-suite/output/Cases.v b/test-suite/output/Cases.v
index 4116a5eb..40748964 100644
--- a/test-suite/output/Cases.v
+++ b/test-suite/output/Cases.v
@@ -66,14 +66,43 @@ Print foo'.
(* Was bug #3293 (eta-expansion at "match" printing time was failing because
of let-in's interpreted as being part of the expansion) *)
-Variable b : bool.
-Variable P : bool -> Prop.
+Axiom b : bool.
+Axiom P : bool -> Prop.
Inductive B : Prop := AC : P b -> B.
Definition f : B -> True.
Proof.
-intros [].
-destruct b as [|] ; intros _ ; exact Logic.I.
+intros [x].
+destruct b as [|] ; exact Logic.I.
Defined.
Print f.
+
+(* Was enhancement request #5142 (error message reported on the most
+ general return clause heuristic) *)
+
+Inductive gadt : Type -> Type :=
+| gadtNat : nat -> gadt nat
+| gadtTy : forall T, T -> gadt T.
+
+Fail Definition gadt_id T (x: gadt T) : gadt T :=
+ match x with
+ | gadtNat n => gadtNat n
+ end.
+
+(* A variant of #5142 (see Satrajit Roy's example on coq-club (Oct 17, 2016)) *)
+
+Inductive type:Set:=Nat.
+Inductive tbinop:type->type->type->Set:= TPlus : tbinop Nat Nat Nat.
+Inductive texp:type->Set:=
+ |TNConst:nat->texp Nat
+ |TBinop:forall t1 t2 t, tbinop t1 t2 t->texp t1->texp t2->texp t.
+Definition typeDenote(t:type):Set:= match t with Nat => nat end.
+
+(* We expect a failure on TBinop *)
+Fail Fixpoint texpDenote t (e:texp t):typeDenote t:=
+ match e with
+ | TNConst n => n
+ | TBinop t1 t2 _ b e1 e2 => O
+ end.
+
diff --git a/test-suite/output/Errors.out b/test-suite/output/Errors.out
index 6354ad46..06a6b2d1 100644
--- a/test-suite/output/Errors.out
+++ b/test-suite/output/Errors.out
@@ -5,3 +5,6 @@ Unable to unify "nat" with "True".
The command has indeed failed with message:
In nested Ltac calls to "f" and "apply x", last call failed.
Unable to unify "nat" with "True".
+The command has indeed failed with message:
+Ltac call to "instantiate ( (ident) := (lglob) )" failed.
+Error: Instance is not well-typed in the environment of ?x.
diff --git a/test-suite/output/Errors.v b/test-suite/output/Errors.v
index 352c8738..424d2480 100644
--- a/test-suite/output/Errors.v
+++ b/test-suite/output/Errors.v
@@ -16,3 +16,12 @@ Goal True.
Fail simpl; apply 0.
Fail simpl; f 0.
Abort.
+
+(* Test instantiate error messages *)
+
+Goal forall T1 (P1 : T1 -> Type), sigT P1 -> sigT P1.
+intros T1 P1 H1.
+eexists ?[x].
+destruct H1 as [x1 H1].
+Fail instantiate (x:=projT1 x1).
+Abort.
diff --git a/test-suite/output/Existentials.out b/test-suite/output/Existentials.out
index 52e1e0ed..9680d2bb 100644
--- a/test-suite/output/Existentials.out
+++ b/test-suite/output/Existentials.out
@@ -1,5 +1,4 @@
-Existential 1 =
-?Goal1 : [p : nat q := S p : nat n : nat m : nat |- ?y = m]
+Existential 1 = ?Goal : [p : nat q := S p : nat n : nat m : nat |- ?y = m]
Existential 2 =
?y : [p : nat q := S p : nat n : nat m : nat |- nat] (p, q cannot be used)
Existential 3 = ?Goal0 : [q : nat n : nat m : nat |- n = ?y]
diff --git a/test-suite/output/InitSyntax.out b/test-suite/output/InitSyntax.out
index bbfd3405..c17c63e7 100644
--- a/test-suite/output/InitSyntax.out
+++ b/test-suite/output/InitSyntax.out
@@ -4,7 +4,8 @@ Inductive sig2 (A : Type) (P Q : A -> Prop) : Type :=
For sig2: Argument A is implicit
For exist2: Argument A is implicit
For sig2: Argument scopes are [type_scope type_scope type_scope]
-For exist2: Argument scopes are [type_scope _ _ _ _ _]
+For exist2: Argument scopes are [type_scope function_scope function_scope _ _
+ _]
exists x : nat, x = x
: Prop
fun b : bool => if b then b else b
diff --git a/test-suite/output/Intuition.out b/test-suite/output/Intuition.out
index e99d9fde..f2bf25ca 100644
--- a/test-suite/output/Intuition.out
+++ b/test-suite/output/Intuition.out
@@ -3,4 +3,4 @@
m, n : Z
H : (m >= n)%Z
============================
- (m >= m)%Z
+ (m >= m)%Z
diff --git a/test-suite/output/Naming.out b/test-suite/output/Naming.out
index f0d2562e..c142d28e 100644
--- a/test-suite/output/Naming.out
+++ b/test-suite/output/Naming.out
@@ -2,40 +2,40 @@
x3 : nat
============================
- forall x x1 x4 x0 : nat,
- (forall x2 x5 : nat, x2 + x1 = x4 + x5) -> x + x1 = x4 + x0
+ forall x x1 x4 x0 : nat,
+ (forall x2 x5 : nat, x2 + x1 = x4 + x5) -> x + x1 = x4 + x0
1 subgoal
x3, x, x1, x4, x0 : nat
H : forall x x3 : nat, x + x1 = x4 + x3
============================
- x + x1 = x4 + x0
+ x + x1 = x4 + x0
1 subgoal
x3 : nat
============================
- forall x x1 x4 x0 : nat,
- (forall x2 x5 : nat, x2 + x1 = x4 + x5 -> foo (S x2 + x1)) ->
- x + x1 = x4 + x0 -> foo (S x)
+ forall x x1 x4 x0 : nat,
+ (forall x2 x5 : nat, x2 + x1 = x4 + x5 -> foo (S x2 + x1)) ->
+ x + x1 = x4 + x0 -> foo (S x)
1 subgoal
x3 : nat
============================
- forall x x1 x4 x0 : nat,
- (forall x2 x5 : nat,
- x2 + x1 = x4 + x5 ->
- forall x6 x7 x8 S0 : nat, x6 + S0 = x7 + x8 + (S x2 + x1)) ->
- x + x1 = x4 + x0 ->
- forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
+ forall x x1 x4 x0 : nat,
+ (forall x2 x5 : nat,
+ x2 + x1 = x4 + x5 ->
+ forall x6 x7 x8 S0 : nat, x6 + S0 = x7 + x8 + (S x2 + x1)) ->
+ x + x1 = x4 + x0 ->
+ forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
1 subgoal
x3, x, x1, x4, x0 : nat
============================
- (forall x2 x5 : nat,
- x2 + x1 = x4 + x5 ->
- forall x6 x7 x8 S0 : nat, x6 + S0 = x7 + x8 + (S x2 + x1)) ->
- x + x1 = x4 + x0 ->
- forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
+ (forall x2 x5 : nat,
+ x2 + x1 = x4 + x5 ->
+ forall x6 x7 x8 S0 : nat, x6 + S0 = x7 + x8 + (S x2 + x1)) ->
+ x + x1 = x4 + x0 ->
+ forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
1 subgoal
x3, x, x1, x4, x0 : nat
@@ -44,7 +44,7 @@
forall x0 x4 x5 S0 : nat, x0 + S0 = x4 + x5 + (S x + x1)
H0 : x + x1 = x4 + x0
============================
- forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
+ forall x5 x6 x7 S : nat, x5 + S = x6 + x7 + Datatypes.S x
1 subgoal
x3, x, x1, x4, x0 : nat
@@ -54,10 +54,10 @@
H0 : x + x1 = x4 + x0
x5, x6, x7, S : nat
============================
- x5 + S = x6 + x7 + Datatypes.S x
+ x5 + S = x6 + x7 + Datatypes.S x
1 subgoal
x3, a : nat
H : a = 0 -> forall a : nat, a = 0
============================
- a = 0
+ a = 0
diff --git a/test-suite/output/Notations.out b/test-suite/output/Notations.out
index b1558dab..26eaca82 100644
--- a/test-suite/output/Notations.out
+++ b/test-suite/output/Notations.out
@@ -111,14 +111,14 @@ fun x : option Z => match x with
| NONE2 => 0
end
: option Z -> Z
-fun x : list ?T1 => match x with
- | NIL => NONE2
- | (_ :') t => SOME2 t
- end
- : list ?T1 -> option (list ?T1)
+fun x : list ?T => match x with
+ | NIL => NONE2
+ | (_ :') t => SOME2 t
+ end
+ : list ?T -> option (list ?T)
where
-?T1 : [x : list ?T1 x1 : list ?T1 x0 := x1 : list ?T1 |- Type] (x, x1,
- x0 cannot be used)
+?T : [x : list ?T x1 : list ?T x0 := x1 : list ?T |- Type] (x, x1,
+ x0 cannot be used)
s
: s
10
diff --git a/test-suite/output/Notations.v b/test-suite/output/Notations.v
index adba688e..2ccca829 100644
--- a/test-suite/output/Notations.v
+++ b/test-suite/output/Notations.v
@@ -133,8 +133,7 @@ Fail Notation "( x , y , .. , z )" := (pair x (pair y z)).
Fail Notation "( x , y , .. , z )" := (pair x .. (pair y w) ..).
(* Right-unbound variable *)
-(* Now allowed with an only parsing restriction *)
-Notation "( x , y , .. , z )" := (pair y .. (pair z 0) ..).
+Notation "( x , y , .. , z )" := (pair y .. (pair z 0) ..) (only parsing).
(* Not the right kind of recursive pattern *)
Fail Notation "( x , y , .. , z )" := (ex (fun z => .. (ex (fun y => x)) ..)).
diff --git a/test-suite/output/Notations2.out b/test-suite/output/Notations2.out
index 58ec1de5..ad60aecc 100644
--- a/test-suite/output/Notations2.out
+++ b/test-suite/output/Notations2.out
@@ -12,7 +12,7 @@ let '(a, _, _) := (2, 3, 4) in a
: nat
exists myx y : bool, myx = y
: Prop
-fun (P : nat -> nat -> Prop) (x : nat) => exists x0, P x x0
+fun (P : nat -> nat -> Prop) (x : nat) => exists y, P x y
: (nat -> nat -> Prop) -> nat -> Prop
∃ n p : nat, n + p = 0
: Prop
@@ -50,3 +50,37 @@ end
: nat -> nat
# _ : nat => 2
: nat -> nat
+# x : nat => # H : x <= 0 => exist (le x) 0 H
+ : ∀ x : nat, x <= 0 -> {x0 : nat | x <= x0}
+exist (Q x) y conj
+ : {x0 : A | Q x x0}
+% i
+ : nat -> nat
+% j
+ : nat -> nat
+{1, 2}
+ : nat -> Prop
+a#
+ : Set
+a#
+ : Set
+a≡
+ : Set
+a≡
+ : Set
+.≡
+ : Set
+.≡
+ : Set
+.a#
+ : Set
+.a#
+ : Set
+.a≡
+ : Set
+.a≡
+ : Set
+.α
+ : Set
+.α
+ : Set
diff --git a/test-suite/output/Notations2.v b/test-suite/output/Notations2.v
index e53c94ef..ceb29d1b 100644
--- a/test-suite/output/Notations2.v
+++ b/test-suite/output/Notations2.v
@@ -68,6 +68,7 @@ Check let' f x y (a:=0) z (b:bool) := x+y+z+1 in f 0 1 2.
(* In practice, only the printing rule is used here *)
(* Note: does not work for pattern *)
+Module A.
Notation "f ( x )" := (f x) (at level 10, format "f ( x )").
Check fun f x => f x + S x.
@@ -77,6 +78,7 @@ Notation plus2 n := (S (S n)).
(* plus2 was not correctly printed in the two following tests in 8.3pl1 *)
Print plus2.
Check fun n => match n with list1 => 0 | _ => 2 end.
+End A.
(* This one is not fully satisfactory because binders in the same type
are re-factorized and parentheses are needed even for atomic binder
@@ -98,3 +100,48 @@ Notation "# x : T => t" := (fun x : T => t)
Check # x : nat => x.
Check # _ : nat => 2.
+
+(* Check bug 4677 *)
+Check fun x (H:le x 0) => exist (le x) 0 H.
+
+Parameters (A : Set) (x y : A) (Q : A -> A -> Prop) (conj : Q x y).
+Check (exist (Q x) y conj).
+
+(* Check bug #4854 *)
+Notation "% i" := (fun i : nat => i) (at level 0, i ident).
+Check %i.
+Check %j.
+
+(* Check bug raised on coq-club on Sep 12, 2016 *)
+
+Notation "{ x , y , .. , v }" := (fun a => (or .. (or (a = x) (a = y)) .. (a = v))).
+Check ({1, 2}).
+
+(**********************************************************************)
+(* Check notations of the form ".a", ".a≡", "a≡" *)
+(* Only "a#", "a≡" and ".≡" were working properly for parsing. The *)
+(* other ones were working only for printing. *)
+
+Notation "a#" := nat.
+Check nat.
+Check a#.
+
+Notation "a≡" := nat.
+Check nat.
+Check a≡.
+
+Notation ".≡" := nat.
+Check nat.
+Check .≡.
+
+Notation ".a#" := nat.
+Check nat.
+Check .a#.
+
+Notation ".a≡" := nat.
+Check nat.
+Check .a≡.
+
+Notation ".α" := nat.
+Check nat.
+Check .α.
diff --git a/test-suite/output/Notations3.out b/test-suite/output/Notations3.out
new file mode 100644
index 00000000..360f3796
--- /dev/null
+++ b/test-suite/output/Notations3.out
@@ -0,0 +1,100 @@
+[<0, 2 >]
+ : nat * nat * (nat * nat)
+[<0, 2 >]
+ : nat * nat * (nat * nat)
+(0, 2, (2, 2))
+ : nat * nat * (nat * nat)
+pair (pair O (S (S O))) (pair (S (S O)) O)
+ : prod (prod nat nat) (prod nat nat)
+<< 0, 2, 4 >>
+ : nat * nat * nat * (nat * (nat * nat))
+<< 0, 2, 4 >>
+ : nat * nat * nat * (nat * (nat * nat))
+(0, 2, 4, (2, (2, 0)))
+ : nat * nat * nat * (nat * (nat * nat))
+(0, 2, 4, (0, (2, 4)))
+ : nat * nat * nat * (nat * (nat * nat))
+pair (pair (pair O (S (S O))) (S (S (S (S O)))))
+ (pair (S (S (S (S O)))) (pair (S (S O)) O))
+ : prod (prod (prod nat nat) nat) (prod nat (prod nat nat))
+ETA x y : nat, Nat.add
+ : nat -> nat -> nat
+ETA x y : nat, Nat.add
+ : nat -> nat -> nat
+ETA x y : nat, Nat.add
+ : nat -> nat -> nat
+fun x y : nat => Nat.add x y
+ : forall (_ : nat) (_ : nat), nat
+ETA x y : nat, le_S
+ : forall x y : nat, x <= y -> x <= S y
+fun f : forall x : nat * (bool * unit), ?T => CURRY (x : nat) (y : bool), f
+ : (forall x : nat * (bool * unit), ?T) ->
+ forall (x : nat) (y : bool), ?T@{x:=(x, (y, tt))}
+where
+?T : [x : nat * (bool * unit) |- Type]
+fun f : forall x : bool * (nat * unit), ?T =>
+CURRYINV (x : nat) (y : bool), f
+ : (forall x : bool * (nat * unit), ?T) ->
+ forall (x : nat) (y : bool), ?T@{x:=(y, (x, tt))}
+where
+?T : [x : bool * (nat * unit) |- Type]
+fun f : forall x : unit * nat * bool, ?T => CURRYLEFT (x : nat) (y : bool), f
+ : (forall x : unit * nat * bool, ?T) ->
+ forall (x : nat) (y : bool), ?T@{x:=(tt, x, y)}
+where
+?T : [x : unit * nat * bool |- Type]
+fun f : forall x : unit * bool * nat, ?T =>
+CURRYINVLEFT (x : nat) (y : bool), f
+ : (forall x : unit * bool * nat, ?T) ->
+ forall (x : nat) (y : bool), ?T@{x:=(tt, y, x)}
+where
+?T : [x : unit * bool * nat |- Type]
+forall n : nat, {#n | 1 > n}
+ : Prop
+forall x : nat, {|x | x > 0|}
+ : Prop
+exists2 x : nat, x = 1 & x = 2
+ : Prop
+fun n : nat =>
+foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + z = 0) z y x)
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun a b c : nat => (fun _ _ _ : nat => a + b + c = 0) c b a)
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun n0 y z : nat => (fun _ _ _ : nat => n0 + y + z = 0) z y n0)
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun x n0 z : nat => (fun _ _ _ : nat => x + n0 + z = 0) z n0 x)
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun x y n0 : nat => (fun _ _ _ : nat => x + y + n0 = 0) n0 y x)
+ : nat -> Prop
+fun n : nat => {|n, y | fun _ _ _ : nat => n + y = 0 |}_2
+ : nat -> Prop
+fun n : nat => {|n, y | fun _ _ _ : nat => n + y = 0 |}_2
+ : nat -> Prop
+fun n : nat => {|n, n0 | fun _ _ _ : nat => n + n0 = 0 |}_2
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + n = 0) z y x)
+ : nat -> Prop
+fun n : nat =>
+foo2 n (fun x y z : nat => (fun _ _ _ : nat => x + y + n = 0) z y x)
+ : nat -> Prop
+fun n : nat => {|n, fun _ : nat => 0 = 0 |}_3
+ : nat -> Prop
+fun n : nat => {|n, fun _ : nat => n = 0 |}_3
+ : nat -> Prop
+fun n : nat => foo3 n (fun x _ : nat => ETA z : nat, (fun _ : nat => x = 0))
+ : nat -> Prop
+fun n : nat => {|n, fun _ : nat => 0 = 0 |}_4
+ : nat -> Prop
+fun n : nat => {|n, fun _ : nat => n = 0 |}_4
+ : nat -> Prop
+fun n : nat => foo4 n (fun _ _ : nat => ETA z : nat, (fun _ : nat => z = 0))
+ : nat -> Prop
+fun n : nat => foo4 n (fun _ y : nat => ETA z : nat, (fun _ : nat => y = 0))
+ : nat -> Prop
+tele (t : Type) '(y, z) (x : t0) := tt
+ : forall t : Type, nat * nat -> t -> fpack
diff --git a/test-suite/output/Notations3.v b/test-suite/output/Notations3.v
new file mode 100644
index 00000000..4b8bfe31
--- /dev/null
+++ b/test-suite/output/Notations3.v
@@ -0,0 +1,141 @@
+(**********************************************************************)
+(* Check printing of notations with several instances of a recursive pattern *)
+(* Was wrong but I could not trigger a problem due to the collision between *)
+(* different instances of ".." *)
+
+Notation "[< x , y , .. , z >]" := (pair (.. (pair x y) ..) z,pair y ( .. (pair z x) ..)).
+Check [<0,2>].
+Check ((0,2),(2,0)).
+Check ((0,2),(2,2)).
+Unset Printing Notations.
+Check [<0,2>].
+Set Printing Notations.
+
+Notation "<< x , y , .. , z >>" := ((.. (x,y) .., z),(z, .. (y,x) ..)).
+Check <<0,2,4>>.
+Check (((0,2),4),(4,(2,0))).
+Check (((0,2),4),(2,(2,0))).
+Check (((0,2),4),(0,(2,4))).
+Unset Printing Notations.
+Check <<0,2,4>>.
+Set Printing Notations.
+
+(**********************************************************************)
+(* Check notations with recursive notations both in binders and terms *)
+
+Notation "'ETA' x .. y , f" :=
+ (fun x => .. (fun y => (.. (f x) ..) y ) ..)
+ (at level 200, x binder, y binder).
+Check ETA (x:nat) (y:nat), Nat.add.
+Check ETA (x y:nat), Nat.add.
+Check ETA x y, Nat.add.
+Unset Printing Notations.
+Check ETA (x:nat) (y:nat), Nat.add.
+Set Printing Notations.
+Check ETA x y, le_S.
+
+Notation "'CURRY' x .. y , f" := (fun x => .. (fun y => f (x, .. (y,tt) ..)) ..)
+ (at level 200, x binder, y binder).
+Check fun f => CURRY (x:nat) (y:bool), f.
+
+Notation "'CURRYINV' x .. y , f" := (fun x => .. (fun y => f (y, .. (x,tt) ..)) ..)
+ (at level 200, x binder, y binder).
+Check fun f => CURRYINV (x:nat) (y:bool), f.
+
+Notation "'CURRYLEFT' x .. y , f" := (fun x => .. (fun y => f (.. (tt,x) .., y)) ..)
+ (at level 200, x binder, y binder).
+Check fun f => CURRYLEFT (x:nat) (y:bool), f.
+
+Notation "'CURRYINVLEFT' x .. y , f" := (fun x => .. (fun y => f (.. (tt,y) .., x)) ..)
+ (at level 200, x binder, y binder).
+Check fun f => CURRYINVLEFT (x:nat) (y:bool), f.
+
+(**********************************************************************)
+(* Notations with variables bound both as a term and as a binder *)
+(* This is #4592 *)
+
+Notation "{# x | P }" := (ex2 (fun y => x = y) (fun x => P)).
+Check forall n:nat, {# n | 1 > n}.
+
+Parameter foo : forall {T}(x : T)(P : T -> Prop), Prop.
+Notation "{| x | P |}" := (foo x (fun x => P)).
+Check forall x:nat, {| x | x > 0 |}.
+
+Check ex2 (fun x => x=1) (fun x0 => x0=2).
+
+(* Other tests about alpha-conversions: the following notation
+ contains all three kinds of bindings:
+
+ - x is bound in the lhs as a term and a binder: its name is forced
+ by its position as a term; it can bind variables in P
+ - y is bound in the lhs as a binder only: its name is given by its
+ name as a binder in the term to display; it can bind variables in P
+ - z is a binder local to the rhs; it cannot bind a variable in P
+*)
+
+Parameter foo2 : forall {T}(x : T)(P : T -> T -> T -> Prop), Prop.
+Notation "{| x , y | P |}_2" := (foo2 x (fun x y z => P z y x)).
+
+(* Not printable: z (resp c, n) occurs in P *)
+Check fun n => foo2 n (fun x y z => (fun _ _ _ => x+y+z=0) z y x).
+Check fun n => foo2 n (fun a b c => (fun _ _ _ => a+b+c=0) c b a).
+Check fun n => foo2 n (fun n y z => (fun _ _ _ => n+y+z=0) z y n).
+Check fun n => foo2 n (fun x n z => (fun _ _ _ => x+n+z=0) z n x).
+Check fun n => foo2 n (fun x y n => (fun _ _ _ => x+y+n=0) n y x).
+
+(* Printable *)
+Check fun n => foo2 n (fun x y z => (fun _ _ _ => x+y=0) z y x).
+Check fun n => foo2 n (fun n y z => (fun _ _ _ => n+y=0) z y n).
+Check fun n => foo2 n (fun x n z => (fun _ _ _ => x+n=0) z n x).
+
+(* Not printable: renaming x into n would bind the 2nd occurrence of n *)
+Check fun n => foo2 n (fun x y z => (fun _ _ _ => x+y+n=0) z y x).
+Check fun n => foo2 n (fun x y z => (fun _ _ _ => x+y+n=0) z y x).
+
+(* Other tests *)
+Parameter foo3 : forall {T}(x : T)(P : T -> T -> T -> Prop), Prop.
+Notation "{| x , P |}_3" := (foo3 x (fun x x x => P x)).
+
+(* Printable *)
+Check fun n : nat => foo3 n (fun x y z => (fun _ => 0=0) z).
+Check fun n => foo3 n (fun x y z => (fun _ => z=0) z).
+
+(* Not printable: renaming z in n would hide the renaming of x into n *)
+Check fun n => foo3 n (fun x y z => (fun _ => x=0) z).
+
+(* Other tests *)
+Parameter foo4 : forall {T}(x : T)(P : T -> T -> T -> Prop), Prop.
+Notation "{| x , P |}_4" := (foo4 x (fun x _ z => P z)).
+
+(* Printable *)
+Check fun n : nat => foo4 n (fun x y z => (fun _ => 0=0) z).
+Check fun n => foo4 n (fun x y z => (fun _ => x=0) z).
+
+(* Not printable: y, z not allowed to occur in P *)
+Check fun n => foo4 n (fun x y z => (fun _ => z=0) z).
+Check fun n => foo4 n (fun x y z => (fun _ => y=0) z).
+
+(**********************************************************************)
+(* Test printing of #4932 *)
+
+Inductive ftele : Type :=
+| fb {T:Type} : T -> ftele
+| fr {T} : (T -> ftele) -> ftele.
+
+Fixpoint args ftele : Type :=
+ match ftele with
+ | fb _ => unit
+ | fr f => sigT (fun t => args (f t))
+ end.
+
+Definition fpack := sigT args.
+Definition pack fp fa : fpack := existT _ fp fa.
+
+Notation "'tele' x .. z := b" :=
+ (fun x => .. (fun z =>
+ pack (fr (fun x => .. ( fr (fun z => fb b) ) .. ) )
+ (existT _ x .. (existT _ z tt) .. )
+ ) ..)
+ (at level 85, x binder, z binder).
+
+Check tele (t:Type) '((y,z):nat*nat) (x:t) := tt.
diff --git a/test-suite/output/PatternsInBinders.out b/test-suite/output/PatternsInBinders.out
new file mode 100644
index 00000000..c012a86b
--- /dev/null
+++ b/test-suite/output/PatternsInBinders.out
@@ -0,0 +1,39 @@
+swap = fun '(x, y) => (y, x)
+ : A * B -> B * A
+fun '(x, y) => (y, x)
+ : A * B -> B * A
+forall '(x, y), swap (x, y) = (y, x)
+ : Prop
+proj_informative = fun '(exist _ x _) => x : A
+ : {x : A | P x} -> A
+foo = fun '(Bar n b tt p) => if b then n + p else n - p
+ : Foo -> nat
+baz =
+fun '(Bar n1 _ tt p1) '(Bar _ _ tt _) => n1 + p1
+ : Foo -> Foo -> nat
+swap =
+fun (A B : Type) '(x, y) => (y, x)
+ : forall A B : Type, A * B -> B * A
+
+Arguments A, B are implicit and maximally inserted
+Argument scopes are [type_scope type_scope _]
+fun (A B : Type) '(x, y) => swap (x, y) = (y, x)
+ : forall A B : Type, A * B -> Prop
+forall (A B : Type) '(x, y), swap (x, y) = (y, x)
+ : Prop
+exists '(x, y), swap (x, y) = (y, x)
+ : Prop
+exists '(x, y) '(z, w), swap (x, y) = (z, w)
+ : Prop
+λ '(x, y), (y, x)
+ : A * B → B * A
+∀ '(x, y), swap (x, y) = (y, x)
+ : Prop
+both_z =
+fun pat : nat * nat =>
+let '(n, p) as pat0 := pat return (F pat0) in (Z n, Z p) : F (n, p)
+ : forall pat : nat * nat, F pat
+fun '(x, y) '(z, t) => swap (x, y) = (z, t)
+ : A * B -> B * A -> Prop
+forall '(x, y) '(z, t), swap (x, y) = (z, t)
+ : Prop
diff --git a/test-suite/output/PatternsInBinders.v b/test-suite/output/PatternsInBinders.v
new file mode 100644
index 00000000..6fa357a9
--- /dev/null
+++ b/test-suite/output/PatternsInBinders.v
@@ -0,0 +1,66 @@
+Require Coq.Unicode.Utf8.
+
+(** The purpose of this file is to test printing of the destructive
+ patterns used in binders ([fun] and [forall]). *)
+
+Parameters (A B : Type) (P:A->Prop).
+
+Definition swap '((x,y) : A*B) := (y,x).
+Print swap.
+
+Check fun '((x,y) : A*B) => (y,x).
+
+Check forall '(x,y), swap (x,y) = (y,x).
+
+Definition proj_informative '(exist _ x _ : { x:A | P x }) : A := x.
+Print proj_informative.
+
+Inductive Foo := Bar : nat -> bool -> unit -> nat -> Foo.
+Definition foo '(Bar n b tt p) :=
+ if b then n+p else n-p.
+Print foo.
+
+Definition baz '(Bar n1 b1 tt p1) '(Bar n2 b2 tt p2) := n1+p1.
+Print baz.
+
+Module WithParameters.
+
+Definition swap {A B} '((x,y) : A*B) := (y,x).
+Print swap.
+
+Check fun (A B:Type) '((x,y) : A*B) => swap (x,y) = (y,x).
+Check forall (A B:Type) '((x,y) : A*B), swap (x,y) = (y,x).
+
+Check exists '((x,y):A*A), swap (x,y) = (y,x).
+Check exists '((x,y):A*A) '(z,w), swap (x,y) = (z,w).
+
+End WithParameters.
+
+(** Some test involving unicode notations. *)
+Module WithUnicode.
+
+ Import Coq.Unicode.Utf8.
+
+ Check λ '((x,y) : A*B), (y,x).
+ Check ∀ '(x,y), swap (x,y) = (y,x).
+
+End WithUnicode.
+
+(** * Suboptimal printing *)
+
+Module Suboptimal.
+
+(** This test shows an example which exposes the [let] introduced by
+ the pattern notation in binders. *)
+
+Inductive Fin (n:nat) := Z : Fin n.
+Definition F '(n,p) : Type := (Fin n * Fin p)%type.
+Definition both_z '(n,p) : F (n,p) := (Z _,Z _).
+Print both_z.
+
+(** Test factorization of binders *)
+
+Check fun '((x,y) : A*B) '(z,t) => swap (x,y) = (z,t).
+Check forall '(x,y) '((z,t) : B*A), swap (x,y) = (z,t).
+
+End Suboptimal.
diff --git a/test-suite/output/PrintInfos.out b/test-suite/output/PrintInfos.out
index ba076f05..1307a8f2 100644
--- a/test-suite/output/PrintInfos.out
+++ b/test-suite/output/PrintInfos.out
@@ -2,7 +2,7 @@ existT : forall (A : Type) (P : A -> Type) (x : A), P x -> {x : A & P x}
existT is template universe polymorphic
Argument A is implicit
-Argument scopes are [type_scope _ _ _]
+Argument scopes are [type_scope function_scope _ _]
Expands to: Constructor Coq.Init.Specif.existT
Inductive sigT (A : Type) (P : A -> Type) : Type :=
existT : forall x : A, P x -> {x : A & P x}
@@ -10,7 +10,7 @@ Inductive sigT (A : Type) (P : A -> Type) : Type :=
For sigT: Argument A is implicit
For existT: Argument A is implicit
For sigT: Argument scopes are [type_scope type_scope]
-For existT: Argument scopes are [type_scope _ _ _]
+For existT: Argument scopes are [type_scope function_scope _ _]
existT : forall (A : Type) (P : A -> Type) (x : A), P x -> {x : A & P x}
Argument A is implicit
@@ -66,14 +66,6 @@ For le_S: Argument n is implicit and maximally inserted
For le: Argument scopes are [nat_scope nat_scope]
For le_n: Argument scope is [nat_scope]
For le_S: Argument scopes are [nat_scope nat_scope _]
-Inductive le (n : nat) : nat -> Prop :=
- le_n : n <= n | le_S : forall m : nat, n <= m -> n <= S m
-
-For le_S: Argument m is implicit
-For le_S: Argument n is implicit and maximally inserted
-For le: Argument scopes are [nat_scope nat_scope]
-For le_n: Argument scope is [nat_scope]
-For le_S: Argument scopes are [nat_scope nat_scope _]
comparison : Set
Expands to: Inductive Coq.Init.Datatypes.comparison
@@ -92,19 +84,6 @@ Expanded type for implicit arguments
bar : forall x : nat, x = 0
Argument x is implicit and maximally inserted
-bar : foo
-
-Expanded type for implicit arguments
-bar : forall x : nat, x = 0
-
-Argument x is implicit and maximally inserted
-Expands to: Constant Top.bar
-*** [ bar : foo ]
-
-Expanded type for implicit arguments
-bar : forall x : nat, x = 0
-
-Argument x is implicit and maximally inserted
Module Coq.Init.Peano
Notation existS2 := existT2
Expands to: Notation Coq.Init.Specif.existS2
@@ -117,15 +96,6 @@ For eq_refl, when applied to 1 argument:
Argument A is implicit and maximally inserted
For eq: Argument scopes are [type_scope _ _]
For eq_refl: Argument scopes are [type_scope _]
-Inductive eq (A : Type) (x : A) : A -> Prop := eq_refl : x = x
-
-For eq: Argument A is implicit and maximally inserted
-For eq_refl, when applied to no arguments:
- Arguments A, x are implicit and maximally inserted
-For eq_refl, when applied to 1 argument:
- Argument A is implicit and maximally inserted
-For eq: Argument scopes are [type_scope _ _]
-For eq_refl: Argument scopes are [type_scope _]
n:nat
Hypothesis of the goal context.
diff --git a/test-suite/output/PrintInfos.v b/test-suite/output/PrintInfos.v
index 3c623346..08918981 100644
--- a/test-suite/output/PrintInfos.v
+++ b/test-suite/output/PrintInfos.v
@@ -12,10 +12,7 @@ Print Implicit Nat.add.
About plus_n_O.
-Implicit Arguments le_S [[n] m].
-Print le_S.
-
-Arguments le_S {n} [m] _. (* Test new syntax *)
+Arguments le_S {n} [m] _.
Print le_S.
About comparison.
@@ -23,21 +20,15 @@ Print comparison.
Definition foo := forall x, x = 0.
Parameter bar : foo.
-Implicit Arguments bar [x].
-About bar.
-Print bar.
-Arguments bar [x]. (* Test new syntax *)
+Arguments bar [x].
About bar.
Print bar.
About Peano. (* Module *)
About existS2. (* Notation *)
-Implicit Arguments eq_refl [[A] [x]] [[A]].
-Print eq_refl.
-
-Arguments eq_refl {A} {x}, {A} x. (* Test new syntax *)
+Arguments eq_refl {A} {x}, {A} x.
Print eq_refl.
diff --git a/test-suite/output/PrintModule.out b/test-suite/output/PrintModule.out
index db464fd0..751d5fcc 100644
--- a/test-suite/output/PrintModule.out
+++ b/test-suite/output/PrintModule.out
@@ -2,3 +2,4 @@ Module N : S with Definition T := nat := M
Module N : S with Module T := K := M
+Module Type Func = Funsig (T0:Test) Sig Parameter x : T0.t. End
diff --git a/test-suite/output/PrintModule.v b/test-suite/output/PrintModule.v
index 999d9a98..5f30f7cd 100644
--- a/test-suite/output/PrintModule.v
+++ b/test-suite/output/PrintModule.v
@@ -32,3 +32,19 @@ Module N : S with Module T := K := M.
Print Module N.
End BAR.
+
+Module QUX.
+
+Module Type Test.
+ Parameter t : Type.
+End Test.
+
+Module Type Func (T:Test).
+ Parameter x : T.t.
+End Func.
+
+Module Shortest_path (T : Test).
+Print Func.
+End Shortest_path.
+
+End QUX.
diff --git a/test-suite/output/Quote.out b/test-suite/output/Quote.out
index ca7fc362..998eb37c 100644
--- a/test-suite/output/Quote.out
+++ b/test-suite/output/Quote.out
@@ -8,17 +8,17 @@
H : interp_f (Node_vm A (Empty_vm Prop) (Empty_vm Prop)) (f_atom End_idx) \/
B
============================
- interp_f
- (Node_vm B (Node_vm A (Empty_vm Prop) (Empty_vm Prop)) (Empty_vm Prop))
- (f_and (f_atom (Left_idx End_idx))
- (f_and (f_or (f_atom End_idx) (f_atom (Left_idx End_idx)))
- (f_or (f_atom (Left_idx End_idx)) (f_not (f_atom End_idx)))))
+ interp_f
+ (Node_vm B (Node_vm A (Empty_vm Prop) (Empty_vm Prop)) (Empty_vm Prop))
+ (f_and (f_atom (Left_idx End_idx))
+ (f_and (f_or (f_atom End_idx) (f_atom (Left_idx End_idx)))
+ (f_or (f_atom (Left_idx End_idx)) (f_not (f_atom End_idx)))))
1 subgoal
H : interp_f (Node_vm A (Empty_vm Prop) (Empty_vm Prop)) (f_atom End_idx) \/
B
============================
- interp_f (Node_vm B (Empty_vm Prop) (Empty_vm Prop))
- (f_and (f_const A)
- (f_and (f_or (f_atom End_idx) (f_const A))
- (f_or (f_const A) (f_not (f_atom End_idx)))))
+ interp_f (Node_vm B (Empty_vm Prop) (Empty_vm Prop))
+ (f_and (f_const A)
+ (f_and (f_or (f_atom End_idx) (f_const A))
+ (f_or (f_const A) (f_not (f_atom End_idx)))))
diff --git a/test-suite/output/SearchPattern.out b/test-suite/output/SearchPattern.out
index 1eb7eca8..f3c12eff 100644
--- a/test-suite/output/SearchPattern.out
+++ b/test-suite/output/SearchPattern.out
@@ -40,7 +40,6 @@ Nat.land: nat -> nat -> nat
Nat.lor: nat -> nat -> nat
Nat.ldiff: nat -> nat -> nat
Nat.lxor: nat -> nat -> nat
-
S: nat -> nat
Nat.succ: nat -> nat
Nat.pred: nat -> nat
@@ -74,7 +73,6 @@ le_n: forall n : nat, n <= n
pair: forall A B : Type, A -> B -> A * B
conj: forall A B : Prop, A -> B -> A /\ B
Nat.divmod: nat -> nat -> nat -> nat -> nat * nat
-
h: n <> newdef n
h: n <> newdef n
h: P n
diff --git a/test-suite/output/Tactics.out b/test-suite/output/Tactics.out
index 9949658c..239edd1d 100644
--- a/test-suite/output/Tactics.out
+++ b/test-suite/output/Tactics.out
@@ -1,4 +1,4 @@
Ltac f H := split; [ a H | e H ]
Ltac g := match goal with
- | |- context [if ?X then _ else _] => case X
+ | |- context [ if ?X then _ else _ ] => case X
end
diff --git a/test-suite/output/inference.out b/test-suite/output/inference.out
index f2d14477..576fbd7c 100644
--- a/test-suite/output/inference.out
+++ b/test-suite/output/inference.out
@@ -6,13 +6,13 @@ fun e : option L => match e with
: option L -> option L
fun (m n p : nat) (H : S m <= S n + p) => le_S_n m (n + p) H
: forall m n p : nat, S m <= S n + p -> m <= n + p
-fun n : nat => let x := A n in ?y ?y0 : T n
+fun n : nat => let x := A n : T n in ?y ?y0 : T n
: forall n : nat, T n
where
-?y : [n : nat x := A n : T n |- ?T0 -> T n]
-?y0 : [n : nat x := A n : T n |- ?T0]
+?y : [n : nat x := A n : T n |- ?T -> T n]
+?y0 : [n : nat x := A n : T n |- ?T]
fun n : nat => ?y ?y0 : T n
: forall n : nat, T n
where
-?y : [n : nat |- ?T0 -> T n]
-?y0 : [n : nat |- ?T0]
+?y : [n : nat |- ?T -> T n]
+?y0 : [n : nat |- ?T]
diff --git a/test-suite/output/inference.v b/test-suite/output/inference.v
index cd9a4a12..1825db16 100644
--- a/test-suite/output/inference.v
+++ b/test-suite/output/inference.v
@@ -14,6 +14,7 @@ Definition P (e:option L) :=
Print P.
(* Check that plus is folded even if reduction is involved *)
+Set Refolding Reduction.
Check (fun m n p (H : S m <= (S n) + p) => le_S_n _ _ H).
diff --git a/test-suite/output/ltac.out b/test-suite/output/ltac.out
index d003c70d..1ff09e3a 100644
--- a/test-suite/output/ltac.out
+++ b/test-suite/output/ltac.out
@@ -1,2 +1,34 @@
The command has indeed failed with message:
-Error: Ltac variable y depends on pattern variable name z which is not bound in current context.
+Error:
+Ltac variable y depends on pattern variable name z which is not bound in current context.
+Ltac f x y z :=
+ symmetry in x, y; auto with z; auto; intros **; clearbody x; generalize
+ dependent z
+The command has indeed failed with message:
+In nested Ltac calls to "g1" and "refine (uconstr)", last call failed.
+The term "I" has type "True" while it is expected to have type "False".
+The command has indeed failed with message:
+In nested Ltac calls to "f1 (constr)" and "refine (uconstr)", last call
+failed.
+The term "I" has type "True" while it is expected to have type "False".
+The command has indeed failed with message:
+In nested Ltac calls to "g2 (constr)", "g1" and "refine (uconstr)", last call
+failed.
+The term "I" has type "True" while it is expected to have type "False".
+The command has indeed failed with message:
+In nested Ltac calls to "f2", "f1 (constr)" and "refine (uconstr)", last call
+failed.
+The term "I" has type "True" while it is expected to have type "False".
+The command has indeed failed with message:
+In nested Ltac calls to "h" and "injection (destruction_arg)", last call
+failed.
+Error: No primitive equality found.
+The command has indeed failed with message:
+In nested Ltac calls to "h" and "injection (destruction_arg)", last call
+failed.
+Error: No primitive equality found.
+Hx
+nat
+nat
+0
+0
diff --git a/test-suite/output/ltac.v b/test-suite/output/ltac.v
index 7e2610c7..76c37625 100644
--- a/test-suite/output/ltac.v
+++ b/test-suite/output/ltac.v
@@ -15,3 +15,45 @@ lazymatch goal with
| H1 : HT |- _ => idtac
end.
Abort.
+
+Ltac f x y z :=
+ symmetry in x, y;
+ auto with z;
+ auto;
+ intros;
+ clearbody x;
+ generalize dependent z.
+
+Print Ltac f.
+
+(* Error messages *)
+
+Ltac g1 x := refine x.
+Tactic Notation "g2" constr(x) := g1 x.
+Tactic Notation "f1" constr(x) := refine x.
+Ltac f2 x := f1 x.
+Goal False.
+Fail g1 I.
+Fail f1 I.
+Fail g2 I.
+Fail f2 I.
+
+Ltac h x := injection x.
+Goal True -> False.
+Fail h I.
+intro H.
+Fail h H.
+
+(* Check printing of the "var" argument "Hx" *)
+Ltac m H := idtac H; exact H.
+Goal True.
+let a:=constr:(let Hx := 0 in ltac:(m Hx)) in idtac.
+
+(* Check consistency of interpretation scopes (#4398) *)
+
+Goal nat*(0*0=0) -> nat*(0*0=0). intro.
+match goal with H: ?x*?y |- _ => idtac x end.
+match goal with |- ?x*?y => idtac x end.
+match goal with H: context [?x*?y] |- _ => idtac x end.
+match goal with |- context [?x*?y] => idtac x end.
+Abort.
diff --git a/test-suite/output/onlyprinting.out b/test-suite/output/onlyprinting.out
new file mode 100644
index 00000000..e0a30fcf
--- /dev/null
+++ b/test-suite/output/onlyprinting.out
@@ -0,0 +1,2 @@
+0:-) 0
+ : nat
diff --git a/test-suite/output/onlyprinting.v b/test-suite/output/onlyprinting.v
new file mode 100644
index 00000000..1973385a
--- /dev/null
+++ b/test-suite/output/onlyprinting.v
@@ -0,0 +1,5 @@
+Reserved Notation "x :-) y" (at level 50, only printing).
+
+Notation "x :-) y" := (plus x y).
+
+Check 0 + 0.
diff --git a/test-suite/output/qualification.out b/test-suite/output/qualification.out
new file mode 100644
index 00000000..9300c3f5
--- /dev/null
+++ b/test-suite/output/qualification.out
@@ -0,0 +1,3 @@
+File "stdin", line 19, characters 0-7:
+Error: Signature components for label test do not match: expected type
+"Top.M2.t = Top.M2.M.t" but found type "Top.M2.t = Top.M2.t".
diff --git a/test-suite/output/qualification.v b/test-suite/output/qualification.v
new file mode 100644
index 00000000..d39097e2
--- /dev/null
+++ b/test-suite/output/qualification.v
@@ -0,0 +1,19 @@
+Module Type T1.
+ Parameter t : Type.
+End T1.
+
+Module Type T2.
+ Declare Module M : T1.
+ Parameter t : Type.
+ Parameter test : t = M.t.
+End T2.
+
+Module M1 <: T1.
+ Definition t : Type := bool.
+End M1.
+
+Module M2 <: T2.
+ Module M := M1.
+ Definition t : Type := nat.
+ Lemma test : t = t. Proof. reflexivity. Qed.
+End M2.
diff --git a/test-suite/output/set.out b/test-suite/output/set.out
index 4dfd2bc2..4b72d73e 100644
--- a/test-suite/output/set.out
+++ b/test-suite/output/set.out
@@ -3,16 +3,16 @@
y1 := 0 : nat
x := 0 + 0 : nat
============================
- x = x
+ x = x
1 subgoal
y1, y2 := 0 : nat
x := y2 + 0 : nat
============================
- x = x
+ x = x
1 subgoal
y1, y2, y3 := 0 : nat
x := y2 + y3 : nat
============================
- x = x
+ x = x
diff --git a/test-suite/output/simpl.out b/test-suite/output/simpl.out
index 73888da9..526e468f 100644
--- a/test-suite/output/simpl.out
+++ b/test-suite/output/simpl.out
@@ -2,14 +2,14 @@
x : nat
============================
- x = S x
+ x = S x
1 subgoal
x : nat
============================
- 0 + x = S x
+ 0 + x = S x
1 subgoal
x : nat
============================
- x = 1 + x
+ x = 1 + x
diff --git a/test-suite/output/subst.out b/test-suite/output/subst.out
new file mode 100644
index 00000000..209b2bc2
--- /dev/null
+++ b/test-suite/output/subst.out
@@ -0,0 +1,97 @@
+1 subgoal
+
+ y, z : nat
+ Hy : y = 0
+ Hz : z = 0
+ H1 : 0 = 1
+ HA : True
+ H2 : 0 = 2
+ H3 : y = 3
+ HB : True
+ H4 : z = 4
+ ============================
+ True
+1 subgoal
+
+ x, z : nat
+ Hx : x = 0
+ Hz : z = 0
+ H1 : x = 1
+ HA : True
+ H2 : x = 2
+ H3 : 0 = 3
+ HB : True
+ H4 : z = 4
+ ============================
+ True
+1 subgoal
+
+ x, y : nat
+ Hx : x = 0
+ Hy : y = 0
+ H1 : x = 1
+ HA : True
+ H2 : x = 2
+ H3 : y = 3
+ HB : True
+ H4 : 0 = 4
+ ============================
+ True
+1 subgoal
+
+ H1 : 0 = 1
+ HA : True
+ H2 : 0 = 2
+ H3 : 0 = 3
+ HB : True
+ H4 : 0 = 4
+ ============================
+ True
+1 subgoal
+
+ y, z : nat
+ Hy : y = 0
+ Hz : z = 0
+ HA : True
+ H3 : y = 3
+ HB : True
+ H4 : z = 4
+ H1 : 0 = 1
+ H2 : 0 = 2
+ ============================
+ True
+1 subgoal
+
+ x, z : nat
+ Hx : x = 0
+ Hz : z = 0
+ H1 : x = 1
+ HA : True
+ H2 : x = 2
+ HB : True
+ H4 : z = 4
+ H3 : 0 = 3
+ ============================
+ True
+1 subgoal
+
+ x, y : nat
+ Hx : x = 0
+ Hy : y = 0
+ H1 : x = 1
+ HA : True
+ H2 : x = 2
+ H3 : y = 3
+ HB : True
+ H4 : 0 = 4
+ ============================
+ True
+1 subgoal
+
+ HA, HB : True
+ H4 : 0 = 4
+ H3 : 0 = 3
+ H1 : 0 = 1
+ H2 : 0 = 2
+ ============================
+ True
diff --git a/test-suite/output/subst.v b/test-suite/output/subst.v
new file mode 100644
index 00000000..e48aa6bb
--- /dev/null
+++ b/test-suite/output/subst.v
@@ -0,0 +1,48 @@
+(* Ensure order of hypotheses is respected after "subst" *)
+
+Set Regular Subst Tactic.
+Goal forall x y z, x = 0 -> y = 0 -> z = 0 -> x = 1 -> True -> x = 2 -> y = 3 -> True -> z = 4 -> True.
+intros * Hx Hy Hz H1 HA H2 H3 HB H4.
+(* From now on, the order after subst is consistently H1, HA, H2, H3, HB, H4 *)
+subst x.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was HA, H3, HB, H4, H1, H2 *)
+Show.
+Undo.
+subst y.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was H1, HA, H2, HB, H4, H3 *)
+Show.
+Undo.
+subst z.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was H1, HA, H2, H3, HB, H4 *)
+Show.
+Undo.
+subst.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was HA, HB, H4, H3, H1, H2 *)
+(* In 8.5pl0 and 8.5pl1 with regular subst tactic mode, the order was HA, HB, H1, H2, H3, H4 *)
+Show.
+trivial.
+Qed.
+
+Unset Regular Subst Tactic.
+Goal forall x y z, x = 0 -> y = 0 -> z = 0 -> x = 1 -> True -> x = 2 -> y = 3 -> True -> z = 4 -> True.
+intros * Hx Hy Hz H1 HA H2 H3 HB H4.
+subst x.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was HA, H3, HB, H4, H1, H2 *)
+Show.
+Undo.
+subst y.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was H1, HA, H2, HB, H4, H3 *)
+Show.
+Undo.
+subst z.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was H1, HA, H2, H3, HB, H4 *)
+Show.
+Undo.
+subst.
+(* In 8.4 or 8.5 without regular subst tactic mode, the order was HA, HB, H4, H3, H1, H2 *)
+(* In 8.5pl0 and 8.5pl1 with regular subst tactic mode, the order was HA, HB, H1, H2, H3, H4 *)
+Show.
+trivial.
+Qed.
+
+
diff --git a/test-suite/output/unifconstraints.out b/test-suite/output/unifconstraints.out
new file mode 100644
index 00000000..ae846036
--- /dev/null
+++ b/test-suite/output/unifconstraints.out
@@ -0,0 +1,65 @@
+3 focused subgoals
+(shelved: 1)
+
+ ============================
+ ?Goal 0
+
+subgoal 2 is:
+ forall n : nat, ?Goal n -> ?Goal (S n)
+subgoal 3 is:
+ nat
+unification constraint:
+ ?Goal ?Goal2 <=
+ True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier
+3 focused subgoals
+(shelved: 1)
+
+ n, m : nat
+ ============================
+ ?Goal@{n:=n; m:=m} 0
+
+subgoal 2 is:
+ forall n0 : nat, ?Goal@{n:=n; m:=m} n0 -> ?Goal@{n:=n; m:=m} (S n0)
+subgoal 3 is:
+ nat
+unification constraint:
+ ?Goal@{n:=n; m:=m} ?Goal2@{n:=n; m:=m} <=
+ True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier
+3 focused subgoals
+(shelved: 1)
+
+ m : nat
+ ============================
+ ?Goal1@{m:=m} 0
+
+subgoal 2 is:
+ forall n0 : nat, ?Goal1@{m:=m} n0 -> ?Goal1@{m:=m} (S n0)
+subgoal 3 is:
+ nat
+unification constraint:
+
+ n, m : nat |- ?Goal1@{m:=m} ?Goal0@{n:=n; m:=m} <=
+ True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier
+3 focused subgoals
+(shelved: 1)
+
+ m : nat
+ ============================
+ ?Goal0@{m:=m} 0
+
+subgoal 2 is:
+ forall n0 : nat, ?Goal0@{m:=m} n0 -> ?Goal0@{m:=m} (S n0)
+subgoal 3 is:
+ nat
+unification constraint:
+
+ n, m : nat |- ?Goal0@{m:=m} ?Goal2@{n:=n} <=
+ True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier
diff --git a/test-suite/output/unifconstraints.v b/test-suite/output/unifconstraints.v
new file mode 100644
index 00000000..b9413a4a
--- /dev/null
+++ b/test-suite/output/unifconstraints.v
@@ -0,0 +1,22 @@
+(* Set Printing Existential Instances. *)
+Unset Solve Unification Constraints.
+Axiom veeryyyyyyyyyyyyloooooooooooooonggidentifier : nat.
+Goal True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier.
+ refine (nat_rect _ _ _ _).
+ Show.
+Admitted.
+
+Set Printing Existential Instances.
+Goal forall n m : nat, True /\ True /\ True \/
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier =
+ veeryyyyyyyyyyyyloooooooooooooonggidentifier.
+ intros.
+ refine (nat_rect _ _ _ _).
+ Show.
+ clear n.
+ Show.
+ 3:clear m.
+ Show.
+Admitted.
diff --git a/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v b/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
index 0d75d52a..06357cfc 100644
--- a/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
+++ b/test-suite/stm/Nijmegen_QArithSternBrocot_Zaux.v
@@ -1902,14 +1902,14 @@ Qed.
Lemma Zsgn_15 : forall x y : Z, Zsgn (x * y) = (Zsgn x * Zsgn y)%Z.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; constructor.
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; constructor.
Qed.
Lemma Zsgn_16 :
forall x y : Z,
Zsgn (x * y) = 1%Z -> {(0 < x)%Z /\ (0 < y)%Z} + {(x < 0)%Z /\ (y < 0)%Z}.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intro H;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intro H;
try discriminate H; [ left | right ]; repeat split.
Qed.
@@ -1917,13 +1917,13 @@ Lemma Zsgn_17 :
forall x y : Z,
Zsgn (x * y) = (-1)%Z -> {(0 < x)%Z /\ (y < 0)%Z} + {(x < 0)%Z /\ (0 < y)%Z}.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intro H;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intro H;
try discriminate H; [ left | right ]; repeat split.
Qed.
Lemma Zsgn_18 : forall x y : Z, Zsgn (x * y) = 0%Z -> {x = 0%Z} + {y = 0%Z}.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intro H;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intro H;
try discriminate H; [ left | right | right ]; constructor.
Qed.
@@ -1932,40 +1932,40 @@ Qed.
Lemma Zsgn_19 : forall x y : Z, (0 < Zsgn x + Zsgn y)%Z -> (0 < x + y)%Z.
Proof.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intro H;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intro H;
discriminate H || (constructor || apply Zsgn_12; assumption).
Qed.
Lemma Zsgn_20 : forall x y : Z, (Zsgn x + Zsgn y < 0)%Z -> (x + y < 0)%Z.
Proof.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intro H;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intro H;
discriminate H || (constructor || apply Zsgn_11; assumption).
Qed.
Lemma Zsgn_21 : forall x y : Z, (0 < Zsgn x + Zsgn y)%Z -> (0 <= x)%Z.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intros H H0;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intros H H0;
discriminate H || discriminate H0.
Qed.
Lemma Zsgn_22 : forall x y : Z, (Zsgn x + Zsgn y < 0)%Z -> (x <= 0)%Z.
Proof.
Proof.
- intros [y| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *; intros H H0;
+ intros [|p1|p1]; [intros y|intros [|p2|p2] ..]; simpl in |- *; intros H H0;
discriminate H || discriminate H0.
Qed.
Lemma Zsgn_23 : forall x y : Z, (0 < Zsgn x + Zsgn y)%Z -> (0 <= y)%Z.
Proof.
- intros [[| p2| p2]| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *;
+ intros [|p1|p1] [|p2|p2]; simpl in |- *;
intros H H0; discriminate H || discriminate H0.
Qed.
Lemma Zsgn_24 : forall x y : Z, (Zsgn x + Zsgn y < 0)%Z -> (y <= 0)%Z.
Proof.
- intros [[| p2| p2]| p1 [| p2| p2]| p1 [| p2| p2]]; simpl in |- *;
+ intros [|p1|p1] [|p2|p2]; simpl in |- *;
intros H H0; discriminate H || discriminate H0.
Qed.
diff --git a/test-suite/success/Case13.v b/test-suite/success/Case13.v
index f14725a8..8f95484c 100644
--- a/test-suite/success/Case13.v
+++ b/test-suite/success/Case13.v
@@ -55,6 +55,14 @@ Check (fun x : I' 0 => match x with
| _ => 0
end).
+(* This one could eventually be solved, the "Fail" is just to ensure *)
+(* that it does not fail with an anomaly, as it did at some time *)
+Fail Check (fun x : I' 0 => match x return _ x with
+ | C2' _ _ => 0
+ | niln => 0
+ | _ => 0
+ end).
+
(* Check insertion of coercions around matched subterm *)
Parameter A:Set.
diff --git a/test-suite/success/CaseInClause.v b/test-suite/success/CaseInClause.v
index 3679eead..6424fe92 100644
--- a/test-suite/success/CaseInClause.v
+++ b/test-suite/success/CaseInClause.v
@@ -20,3 +20,10 @@ Theorem foo : forall (n m : nat) (pf : n = m),
match pf in _ = N with
| eq_refl => unit
end.
+
+(* Check redundant clause is removed *)
+Inductive I : nat * nat -> Type := C : I (0,0).
+Check fun x : I (1,1) => match x in I (y,z) return y = z with C => eq_refl end.
+
+(* An example of non-local inference of the type of an impossible case *)
+Check (fun y n (x:Vector.t nat (S n)) => match x with a::_ => a | _ => y end) 2.
diff --git a/test-suite/success/Compat84.v b/test-suite/success/Compat84.v
new file mode 100644
index 00000000..db6348fa
--- /dev/null
+++ b/test-suite/success/Compat84.v
@@ -0,0 +1,19 @@
+(* -*- coq-prog-args: ("-emacs" "-compat" "8.4") -*- *)
+
+Goal True.
+ solve [ constructor 1 ]. Undo.
+ solve [ econstructor 1 ]. Undo.
+ solve [ constructor ]. Undo.
+ solve [ econstructor ]. Undo.
+ solve [ constructor (fail) ]. Undo.
+ solve [ econstructor (fail) ]. Undo.
+ split.
+Qed.
+
+Goal False \/ True.
+ solve [ constructor (constructor) ]. Undo.
+ solve [ econstructor (econstructor) ]. Undo.
+ solve [ constructor 2; constructor ]. Undo.
+ solve [ econstructor 2; econstructor ]. Undo.
+ right; esplit.
+Qed.
diff --git a/test-suite/success/Hints.v b/test-suite/success/Hints.v
index f934a5c7..1abe1477 100644
--- a/test-suite/success/Hints.v
+++ b/test-suite/success/Hints.v
@@ -1,4 +1,12 @@
(* Checks syntax of Hints commands *)
+(* Old-style syntax *)
+Hint Resolve eq_refl eq_sym.
+Hint Resolve eq_refl eq_sym: foo.
+Hint Immediate eq_refl eq_sym.
+Hint Immediate eq_refl eq_sym: foo.
+Hint Unfold fst eq_sym.
+Hint Unfold fst eq_sym: foo.
+
(* Checks that qualified names are accepted *)
(* New-style syntax *)
@@ -8,13 +16,76 @@ Hint Unfold eq_sym: core.
Hint Constructors eq: foo bar.
Hint Extern 3 (_ = _) => apply eq_refl: foo bar.
-(* Old-style syntax *)
-Hint Resolve eq_refl eq_sym.
-Hint Resolve eq_refl eq_sym: foo.
-Hint Immediate eq_refl eq_sym.
-Hint Immediate eq_refl eq_sym: foo.
-Hint Unfold fst eq_sym.
-Hint Unfold fst eq_sym: foo.
+(* Extended new syntax with patterns *)
+Hint Resolve eq_refl | 4 (_ = _) : baz.
+Hint Resolve eq_sym eq_trans : baz.
+Hint Extern 3 (_ = _) => apply eq_sym : baz.
+
+Parameter pred : nat -> Prop.
+Parameter pred0 : pred 0.
+Parameter f : nat -> nat.
+Parameter predf : forall n, pred n -> pred (f n).
+
+(* No conversion on let-bound variables and constants in pred (the default) *)
+Hint Resolve pred0 | 1 (pred _) : pred.
+Hint Resolve predf | 0 : pred.
+
+(* Allow full conversion on let-bound variables and constants *)
+Create HintDb predconv discriminated.
+Hint Resolve pred0 | 1 (pred _) : predconv.
+Hint Resolve predf | 0 : predconv.
+
+Goal exists n, pred n.
+ eexists.
+ Fail Timeout 1 typeclasses eauto with pred.
+ Set Typeclasses Filtered Unification.
+ Set Typeclasses Debug Verbosity 2.
+ (* predf is not tried as it doesn't match the goal *)
+ typeclasses eauto with pred.
+Qed.
+
+Parameter predconv : forall n, pred n -> pred (0 + S n).
+
+(* The inferred pattern contains 0 + ?n, syntactic match will fail to see convertible
+ terms *)
+Hint Resolve pred0 : pred2.
+Hint Resolve predconv : pred2.
+
+(** In this database we allow predconv to apply to pred (S _) goals, more generally
+ than the inferred pattern (pred (0 + S _)). *)
+Create HintDb pred2conv discriminated.
+Hint Resolve pred0 : pred2conv.
+Hint Resolve predconv | 1 (pred (S _)) : pred2conv.
+
+Goal pred 3.
+ Fail typeclasses eauto with pred2.
+ typeclasses eauto with pred2conv.
+Abort.
+
+Set Typeclasses Filtered Unification.
+Set Typeclasses Debug Verbosity 2.
+Hint Resolve predconv | 1 (pred _) : pred.
+Hint Resolve predconv | 1 (pred (S _)) : predconv.
+Test Typeclasses Limit Intros.
+Goal pred 3.
+ (* predf is not tried as it doesn't match the goal *)
+ (* predconv is tried but fails as the transparent state doesn't allow
+ unfolding + *)
+ Fail typeclasses eauto with pred.
+ (* Here predconv succeeds as it matches (pred (S _)) and then
+ full unification is allowed *)
+ typeclasses eauto with predconv.
+Qed.
+
+(** The other way around: goal contains redexes instead of instances *)
+Goal exists n, pred (0 + n).
+ eexists.
+ (* predf is applied indefinitely *)
+ Fail Timeout 1 typeclasses eauto with pred.
+ (* pred0 (pred _) matches the goal *)
+ typeclasses eauto with predconv.
+Qed.
+
(* Checks that local names are accepted *)
Section A.
@@ -100,9 +171,9 @@ Instance foo f :
Proof.
Fail Timeout 1 apply _. (* 3.7s *)
-Hint Cut [!*; (a_is_b | b_is_c | c_is_d | d_is_e) ;
- (a_compose | b_compose | c_compose | d_compose | e_compose)] : typeclass_instances.
+Hint Cut [_* (a_is_b | b_is_c | c_is_d | d_is_e)
+ (a_compose | b_compose | c_compose | d_compose | e_compose)] : typeclass_instances.
Timeout 1 Fail apply _. (* 0.06s *)
Abort.
-End HintCut. \ No newline at end of file
+End HintCut.
diff --git a/test-suite/success/Inductive.v b/test-suite/success/Inductive.v
index 9661b3bf..f746def5 100644
--- a/test-suite/success/Inductive.v
+++ b/test-suite/success/Inductive.v
@@ -162,3 +162,24 @@ Inductive L (A:Type) (T:=A) : Type := C : L nat -> L A.
hit the Inductiveops.get_arity bug mentioned above (see #3491) *)
Inductive IND6 (A:Type) (T:=A) := CONS6 : IND6 T -> IND6 A.
+
+
+Module TemplateProp.
+
+ (** Check lowering of a template universe polymorphic inductive to Prop *)
+
+ Inductive Foo (A : Type) : Type := foo : A -> Foo A.
+
+ Check Foo True : Prop.
+
+End TemplateProp.
+
+Module PolyNoLowerProp.
+
+ (** Check lowering of a general universe polymorphic inductive to Prop is _failing_ *)
+
+ Polymorphic Inductive Foo (A : Type) : Type := foo : A -> Foo A.
+
+ Fail Check Foo True : Prop.
+
+End PolyNoLowerProp.
diff --git a/test-suite/success/Injection.v b/test-suite/success/Injection.v
index 25e464d6..da218384 100644
--- a/test-suite/success/Injection.v
+++ b/test-suite/success/Injection.v
@@ -4,6 +4,7 @@ Require Eqdep_dec.
(* Check that Injection tries Intro until *)
+Unset Structural Injection.
Lemma l1 : forall x : nat, S x = S (S x) -> False.
injection 1.
apply n_Sn.
@@ -37,6 +38,7 @@ intros.
injection H.
exact (fun H => H).
Qed.
+Set Structural Injection.
(* Test injection as *)
@@ -65,7 +67,13 @@ Qed.
Goal (forall x y : nat, x = y -> S x = S y) -> True.
intros.
einjection (H O).
-instantiate (1:=O).
+2:instantiate (1:=O).
+Abort.
+
+Goal (forall x y : nat, x = y -> S x = S y) -> True.
+intros.
+einjection (H O ?[y]) as H0.
+instantiate (y:=O).
Abort.
(* Test the injection intropattern *)
@@ -79,12 +87,21 @@ Qed.
(* Basic case, using sigT *)
Scheme Equality for nat.
+Unset Structural Injection.
Goal forall n:nat, forall P:nat -> Type, forall H1 H2:P n,
existT P n H1 = existT P n H2 -> H1 = H2.
intros.
injection H.
intro H0. exact H0.
Abort.
+Set Structural Injection.
+
+Goal forall n:nat, forall P:nat -> Type, forall H1 H2:P n,
+ existT P n H1 = existT P n H2 -> H1 = H2.
+intros.
+injection H as H0.
+exact H0.
+Abort.
(* Test injection using K, knowing that an equality is decidable *)
(* Basic case, using sigT, with "as" clause *)
@@ -118,7 +135,22 @@ intros * [= H].
exact H.
Abort.
-(* Injection does not projects at positions in Prop... allow it?
+(* Test the Keep Proof Equalities option. *)
+Set Keep Proof Equalities.
+Unset Structural Injection.
+
+Inductive pbool : Prop := Pbool1 | Pbool2.
+
+Inductive pbool_shell : Set := Pbsc : pbool -> pbool_shell.
+
+Goal Pbsc Pbool1 = Pbsc Pbool2 -> True.
+injection 1.
+match goal with
+ |- Pbool1 = Pbool2 -> True => idtac | |- True => fail
+end.
+Abort.
+
+(* Injection does not project at positions in Prop... allow it?
Inductive t (A:Prop) : Set := c : A -> t A.
Goal forall p q : True\/True, c _ p = c _ q -> False.
diff --git a/test-suite/success/MatchFail.v b/test-suite/success/MatchFail.v
index 7069bba4..8462d362 100644
--- a/test-suite/success/MatchFail.v
+++ b/test-suite/success/MatchFail.v
@@ -9,14 +9,14 @@ Require Export ZArithRing.
Ltac compute_POS :=
match goal with
| |- context [(Zpos (xI ?X1))] =>
- let v := constr:X1 in
- match constr:v with
+ let v := constr:(X1) in
+ match constr:(v) with
| 1%positive => fail 1
| _ => rewrite (BinInt.Pos2Z.inj_xI v)
end
| |- context [(Zpos (xO ?X1))] =>
- let v := constr:X1 in
- match constr:v with
+ let v := constr:(X1) in
+ match constr:(v) with
| 1%positive => fail 1
| _ => rewrite (BinInt.Pos2Z.inj_xO v)
end
diff --git a/test-suite/success/Notations.v b/test-suite/success/Notations.v
index b72a0674..07bbb60c 100644
--- a/test-suite/success/Notations.v
+++ b/test-suite/success/Notations.v
@@ -58,7 +58,7 @@ Check (fun x:nat*nat => match x with R x y => (x,y) end).
(* Check multi-tokens recursive notations *)
-Local Notation "[ a # ; .. # ; b ]" := (a + .. (b + 0) ..).
+Local Notation "[ a # ; .. # ; b ]" := (a + .. (b + 0) ..).
Check [ 0 ].
Check [ 0 # ; 1 ].
@@ -107,3 +107,24 @@ Notation traverse_var f l := (traverse (fun l => f l) l).
Notation "'intros' x" := (S x) (at level 0).
Goal True -> True. intros H. exact H. Qed.
+
+(* Check absence of collision on ".." in nested notations with ".." *)
+Notation "[ a , .. , b ]" := (a, (.. (b,tt) ..)).
+
+(* Check that vector notations do not break Ltac [] (bugs #4785, #4733) *)
+Require Import Coq.Vectors.VectorDef.
+Import VectorNotations.
+Goal True. idtac; []. (* important for test: no space here *) constructor. Qed.
+
+(* Check parsing of { and } is not affected by notations #3479 *)
+Notation " |- {{ a }} b" := (a=b) (no associativity, at level 10).
+Goal True.
+{{ exact I. }}
+Qed.
+Check |- {{ 0 }} 0.
+
+(* Check parsing of { and } is not affected by notations #3479 *)
+Notation " |- {{ a }} b" := (a=b) (no associativity, at level 10).
+Goal True.
+{{ exact I. }}
+Qed.
diff --git a/test-suite/success/Notations2.v b/test-suite/success/Notations2.v
new file mode 100644
index 00000000..9505a56e
--- /dev/null
+++ b/test-suite/success/Notations2.v
@@ -0,0 +1,92 @@
+(* This file is giving some examples about how implicit arguments and
+ scopes are treated when using abbreviations or notations, in terms
+ or patterns, or when using @ and parentheses in terms and patterns.
+
+The convention is:
+
+Constant foo with implicit arguments and scopes used in a term or a pattern:
+
+ foo do not deactivate further arguments and scopes
+ @foo deactivates further arguments and scopes
+ (foo x) deactivates further arguments and scopes
+ (@foo x) deactivates further arguments and scopes
+
+Notations binding to foo:
+
+# := foo do not deactivate further arguments and scopes
+# := @foo deactivates further arguments and scopes
+# x := foo x deactivates further arguments and scopes
+# x := @foo x deactivates further arguments and scopes
+
+Abbreviations binding to foo:
+
+f := foo do not deactivate further arguments and scopes
+f := @foo deactivates further arguments and scopes
+f x := foo x do not deactivate further arguments and scopes
+f x := @foo x do not deactivate further arguments and scopes
+*)
+
+(* One checks that abbreviations and notations in patterns now behave like in terms *)
+
+Inductive prod' A : Type -> Type :=
+| pair' (a:A) B (b:B) (c:bool) : prod' A B.
+Arguments pair' [A] a%bool_scope [B] b%bool_scope c%bool_scope.
+Notation "0" := true : bool_scope.
+
+(* 1. Abbreviations do not stop implicit arguments to be inserted and scopes to be used *)
+Notation c1 x := (pair' x).
+Check pair' 0 0 0 : prod' bool bool.
+Check (pair' 0) _ 0%bool 0%bool : prod' bool bool. (* parentheses are blocking implicit and scopes *)
+Check c1 0 0 0 : prod' bool bool.
+Check fun x : prod' bool bool => match x with c1 0 y 0 => 2 | _ => 1 end.
+
+(* 2. Abbreviations do not stop implicit arguments to be inserted and scopes to be used *)
+Notation c2 x := (@pair' _ x).
+Check (@pair' _ 0) _ 0%bool 0%bool : prod' bool bool. (* parentheses are blocking implicit and scopes *)
+Check c2 0 0 0 : prod' bool bool.
+Check fun A (x : prod' bool A) => match x with c2 0 y 0 => 2 | _ => 1 end.
+Check fun A (x : prod' bool A) => match x with (@pair' _ 0) _ y 0%bool => 2 | _ => 1 end.
+
+(* 3. Abbreviations do not stop implicit arguments to be inserted and scopes to be used *)
+Notation c3 x := ((@pair') _ x).
+Check (@pair') _ 0%bool _ 0%bool 0%bool : prod' bool bool. (* @ is blocking implicit and scopes *)
+Check ((@pair') _ 0%bool) _ 0%bool 0%bool : prod' bool bool. (* parentheses and @ are blocking implicit and scopes *)
+Check c3 0 0 0 : prod' nat bool. (* First scope is blocked but not the last two scopes *)
+Check fun A (x :prod' nat A) => match x with c3 0 y 0 => 2 | _ => 1 end.
+
+(* 4. Abbreviations do not stop implicit arguments to be inserted and scopes to be used *)
+(* unless an atomic @ is given *)
+Notation c4 := (@pair').
+Check (@pair') _ 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check c4 _ 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with c4 _ 0%bool _ y 0%bool => 2 | _ => 1 end.
+Check fun A (x :prod' bool A) => match x with (@pair') _ 0%bool _ y 0%bool => 2 | _ => 1 end.
+
+(* 5. Notations stop further implicit arguments to be inserted and scopes to be used *)
+Notation "# x" := (pair' x) (at level 0, x at level 1).
+Check pair' 0 0 0 : prod' bool bool.
+Check # 0 _ 0%bool 0%bool : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with # 0 _ y 0%bool => 2 | _ => 1 end.
+
+(* 6. Notations stop further implicit arguments to be inserted and scopes to be used *)
+Notation "## x" := ((@pair') _ x) (at level 0, x at level 1).
+Check (@pair') _ 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check ((@pair') _ 0%bool) _ 0%bool 0%bool : prod' bool bool.
+Check ## 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with ## 0%bool _ y 0%bool => 2 | _ => 1 end.
+
+(* 7. Notations stop further implicit arguments to be inserted and scopes to be used *)
+Notation "###" := (@pair') (at level 0).
+Check (@pair') _ 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check ### _ 0%bool _ 0%bool 0%bool : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with ### _ 0%bool _ y 0%bool => 2 | _ => 1 end.
+
+(* 8. Notations w/o @ preserves implicit arguments and scopes *)
+Notation "####" := pair' (at level 0).
+Check #### 0 0 0 : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with #### 0 y 0 => 2 | _ => 1 end.
+
+(* 9. Notations w/o @ but arguments do not preserve further implicit arguments and scopes *)
+Notation "##### x" := (pair' x) (at level 0, x at level 1).
+Check ##### 0 _ 0%bool 0%bool : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with ##### 0 _ y 0%bool => 2 | _ => 1 end.
diff --git a/test-suite/success/PatternsInBinders.v b/test-suite/success/PatternsInBinders.v
new file mode 100644
index 00000000..77710791
--- /dev/null
+++ b/test-suite/success/PatternsInBinders.v
@@ -0,0 +1,67 @@
+(** The purpose of this file is to test functional properties of the
+ destructive patterns used in binders ([fun] and [forall]). *)
+
+
+Definition swap {A B} '((x,y) : A*B) := (y,x).
+
+(** Tests the use of patterns in [fun] and [Definition] *)
+Section TestFun.
+
+ Variables A B : Type.
+
+ Goal forall (x:A) (y:B), swap (x,y) = (y,x).
+ Proof. reflexivity. Qed.
+
+ Goal forall u:A*B, swap (swap u) = u.
+ Proof. destruct u. reflexivity. Qed.
+
+ Goal @swap A B = fun '(x,y) => (y,x).
+ Proof. reflexivity. Qed.
+
+End TestFun.
+
+
+(** Tests the use of patterns in [forall] *)
+Section TestForall.
+
+ Variables A B : Type.
+
+ Goal forall '((x,y) : A*B), swap (x,y) = (y,x).
+ Proof. intros [x y]. reflexivity. Qed.
+
+ Goal forall x0:A, exists '((x,y) : A*A), swap (x,y) = (x,y).
+ Proof.
+ intros x0.
+ exists (x0,x0).
+ reflexivity.
+ Qed.
+
+End TestForall.
+
+
+
+(** Tests the use of patterns in dependent definitions. *)
+
+Section TestDependent.
+
+ Inductive Fin (n:nat) := Z : Fin n.
+
+ Definition F '(n,p) : Type := (Fin n * Fin p)%type.
+
+ Definition both_z '(n,p) : F (n,p) := (Z _,Z _).
+
+End TestDependent.
+
+
+(** Tests with a few other types just to make sure parsing is
+ robust. *)
+Section TestExtra.
+
+ Definition proj_informative {A P} '(exist _ x _ : { x:A | P x }) : A := x.
+
+ Inductive Foo := Bar : nat -> bool -> unit -> nat -> Foo.
+
+ Definition foo '(Bar n b tt p) :=
+ if b then n+p else n-p.
+
+End TestExtra.
diff --git a/test-suite/success/RecTutorial.v b/test-suite/success/RecTutorial.v
index 11fbf24d..d8f80424 100644
--- a/test-suite/success/RecTutorial.v
+++ b/test-suite/success/RecTutorial.v
@@ -831,7 +831,7 @@ Proof.
intro n.
apply nat_ind with (P:= fun n => n <> S n).
discriminate.
- red; intros n0 Hn0 eqn0Sn0;injection eqn0Sn0;trivial.
+ red; intros n0 Hn0 eqn0Sn0;injection eqn0Sn0;auto.
Qed.
Definition eq_nat_dec : forall n p:nat , {n=p}+{n <> p}.
@@ -1075,8 +1075,8 @@ Proof.
apply vector_double_rect.
simpl.
destruct i; discriminate 1.
- destruct i; simpl;auto.
- injection 1; injection 2;intros; subst a; subst b; auto.
+ destruct i; simpl;auto.
+ injection 1 as ->; injection 1 as ->; auto.
Qed.
Set Implicit Arguments.
diff --git a/test-suite/success/TacticNotation2.v b/test-suite/success/TacticNotation2.v
new file mode 100644
index 00000000..cb341b8e
--- /dev/null
+++ b/test-suite/success/TacticNotation2.v
@@ -0,0 +1,12 @@
+Tactic Notation "complete" tactic(tac) := tac; fail.
+
+Ltac f0 := complete (intuition idtac).
+(** FIXME: This is badly printed because of bug #3079.
+ At least we check that it does not fail anomalously. *)
+Print Ltac f0.
+
+Ltac f1 := complete f1.
+Print Ltac f1.
+
+Ltac f2 := complete intuition.
+Print Ltac f2.
diff --git a/test-suite/success/TestRefine.v b/test-suite/success/TestRefine.v
index c8a8b862..023cb5f5 100644
--- a/test-suite/success/TestRefine.v
+++ b/test-suite/success/TestRefine.v
@@ -53,7 +53,7 @@ Abort.
Lemma essai2 : forall x : nat, x = x.
-Fail refine (fix f (x : nat) : x = x := _).
+refine (fix f (x : nat) : x = x := _).
Restart.
diff --git a/test-suite/success/Typeclasses.v b/test-suite/success/Typeclasses.v
index 30a2a742..6b1f0315 100644
--- a/test-suite/success/Typeclasses.v
+++ b/test-suite/success/Typeclasses.v
@@ -1,3 +1,117 @@
+Module onlyclasses.
+
+(* In 8.6 we still allow non-class subgoals *)
+ Variable Foo : Type.
+ Variable foo : Foo.
+ Hint Extern 0 Foo => exact foo : typeclass_instances.
+ Goal Foo * Foo.
+ split. shelve.
+ Set Typeclasses Debug.
+ typeclasses eauto.
+ Unshelve. typeclasses eauto.
+ Qed.
+
+ Module RJung.
+ Class Foo (x : nat).
+
+ Instance foo x : x = 2 -> Foo x.
+ Hint Extern 0 (_ = _) => reflexivity : typeclass_instances.
+ Typeclasses eauto := debug.
+ Check (_ : Foo 2).
+
+
+ Fail Definition foo := (_ : 0 = 0).
+
+ End RJung.
+End onlyclasses.
+
+Module shelve_non_class_subgoals.
+ Variable Foo : Type.
+ Variable foo : Foo.
+ Hint Extern 0 Foo => exact foo : typeclass_instances.
+ Class Bar := {}.
+ Instance bar1 (f:Foo) : Bar := {}.
+
+ Typeclasses eauto := debug.
+ Set Typeclasses Debug Verbosity 2.
+ Goal Bar.
+ (* Solution has shelved subgoals (of non typeclass type) *)
+ typeclasses eauto.
+ Abort.
+End shelve_non_class_subgoals.
+
+Module RefineVsNoTceauto.
+
+ Class Foo (A : Type) := foo : A.
+ Instance: Foo nat := { foo := 0 }.
+ Instance: Foo nat := { foo := 42 }.
+ Hint Extern 0 (_ = _) => refine eq_refl : typeclass_instances.
+ Goal exists (f : Foo nat), @foo _ f = 0.
+ Proof.
+ unshelve (notypeclasses refine (ex_intro _ _ _)).
+ Set Typeclasses Debug. Set Printing All.
+ all:once (typeclasses eauto).
+ Fail idtac. (* Check no subgoals are left *)
+ Undo 3.
+ (** In this case, the (_ = _) subgoal is not considered
+ by typeclass resolution *)
+ refine (ex_intro _ _ _). Fail reflexivity.
+ Abort.
+
+End RefineVsNoTceauto.
+
+Module Leivantex2PR339.
+ (** Was a bug preventing to find hints associated with no pattern *)
+ Class Bar := {}.
+ Instance bar1 (t:Type) : Bar.
+ Hint Extern 0 => exact True : typeclass_instances.
+ Typeclasses eauto := debug.
+ Goal Bar.
+ Set Typeclasses Debug Verbosity 2.
+ typeclasses eauto. (* Relies on resolution of a non-class subgoal *)
+ Undo 1.
+ typeclasses eauto with typeclass_instances.
+ Qed.
+End Leivantex2PR339.
+
+Module bt.
+Require Import Equivalence.
+
+Record Equ (A : Type) (R : A -> A -> Prop).
+Definition equiv {A} R (e : Equ A R) := R.
+Record Refl (A : Type) (R : A -> A -> Prop).
+Axiom equ_refl : forall A R (e : Equ A R), Refl _ (@equiv A R e).
+Hint Extern 0 (Refl _ _) => unshelve class_apply @equ_refl; [shelve|] : foo.
+
+Variable R : nat -> nat -> Prop.
+Lemma bas : Equ nat R.
+Admitted.
+Hint Resolve bas : foo.
+Hint Extern 1 => match goal with |- (_ -> _ -> Prop) => shelve end : foo.
+
+Goal exists R, @Refl nat R.
+ eexists.
+ Set Typeclasses Debug.
+ (* Fail solve [unshelve eauto with foo]. *)
+ Set Typeclasses Debug Verbosity 1.
+ Test Typeclasses Depth.
+ solve [typeclasses eauto with foo].
+Qed.
+
+Set Typeclasses Compatibility "8.5".
+Parameter f : nat -> Prop.
+Parameter g : nat -> nat -> Prop.
+Parameter h : nat -> nat -> nat -> Prop.
+Axiom a : forall x y, g x y -> f x -> f y.
+Axiom b : forall x (y : Empty_set), g (fst (x,y)) x.
+Axiom c : forall x y z, h x y z -> f x -> f y.
+Hint Resolve a b c : mybase.
+Goal forall x y z, h x y z -> f x -> f y.
+ intros.
+ Fail Timeout 1 typeclasses eauto with mybase. (* Loops now *)
+ Unshelve.
+Abort.
+End bt.
Generalizable All Variables.
Module mon.
@@ -23,8 +137,15 @@ Notation "'return' t" := (unit t).
Class A `(e: T) := { a := True }.
Class B `(e_: T) := { e := e_; sg_ass :> A e }.
-Goal forall `{B T}, a.
- intros. exact I.
+(* Set Typeclasses Debug. *)
+(* Set Typeclasses Debug Verbosity 2. *)
+
+Goal forall `{B T}, Prop.
+ intros. apply a.
+Defined.
+
+Goal forall `{B T}, Prop.
+ intros. refine (@a _ _ _).
Defined.
Class B' `(e_: T) := { e' := e_; sg_ass' :> A e_ }.
@@ -57,4 +178,65 @@ Section sec.
let's try to get rid of the intermediate constant foo.
Surely we can just expand it inline, right? Wrong!: *)
Check U (fun x => e x) _.
-End sec. \ No newline at end of file
+End sec.
+
+Module UniqueSolutions.
+ Set Typeclasses Unique Solutions.
+ Class Eq (A : Type) : Set.
+ Instance eqa : Eq nat := {}.
+ Instance eqb : Eq nat := {}.
+
+ Goal Eq nat.
+ try apply _.
+ Fail exactly_once typeclasses eauto.
+ Abort.
+End UniqueSolutions.
+
+
+Module UniqueInstances.
+ (** Optimize proof search on this class by never backtracking on (closed) goals
+ for it. *)
+ Set Typeclasses Unique Instances.
+ Class Eq (A : Type) : Set.
+ Instance eqa : Eq nat := _. constructor. Qed.
+ Instance eqb : Eq nat := {}.
+ Class Foo (A : Type) (e : Eq A) : Set.
+ Instance fooa : Foo _ eqa := {}.
+
+ Tactic Notation "refineu" open_constr(c) := unshelve refine c.
+
+ Set Typeclasses Debug.
+ Goal { e : Eq nat & Foo nat e }.
+ unshelve refineu (existT _ _ _).
+ all:simpl.
+ (** Does not backtrack on the (wrong) solution eqb *)
+ Fail all:typeclasses eauto.
+ Abort.
+End UniqueInstances.
+
+Module IterativeDeepening.
+
+ Class A.
+ Class B.
+ Class C.
+
+ Instance: B -> A | 0.
+ Instance: C -> A | 0.
+ Instance: C -> B -> A | 0.
+ Instance: A -> A | 0.
+
+ Goal C -> A.
+ intros.
+ Set Typeclasses Debug.
+ Fail Timeout 1 typeclasses eauto.
+ Set Typeclasses Iterative Deepening.
+ Fail typeclasses eauto 1.
+ typeclasses eauto 2.
+ Undo.
+ Unset Typeclasses Iterative Deepening.
+ Fail Timeout 1 typeclasses eauto.
+ Set Typeclasses Iterative Deepening.
+ typeclasses eauto.
+ Qed.
+
+End IterativeDeepening.
diff --git a/test-suite/success/apply.v b/test-suite/success/apply.v
index 55b666b7..02e043bc 100644
--- a/test-suite/success/apply.v
+++ b/test-suite/success/apply.v
@@ -543,7 +543,7 @@ Qed.
Lemma bar (X: nat -> nat -> Prop) (foo:forall x, X x x) (a: unit) (H: tt = a):
exists x, exists y, X x y.
Proof.
-intros; eexists; eexists; case H.
+intros; eexists; eexists ?[y]; case H.
apply (foo ?y).
Grab Existential Variables.
exact 0.
diff --git a/test-suite/success/auto.v b/test-suite/success/auto.v
index aaa7b3a5..5477c833 100644
--- a/test-suite/success/auto.v
+++ b/test-suite/success/auto.v
@@ -45,3 +45,92 @@ Proof.
eexists. Fail progress debug eauto with test2.
progress eauto with test.
Qed.
+
+(** Patterns of Extern have a "matching" semantics.
+ It is not so for apply/exact hints *)
+
+Class B (A : Type).
+Class I.
+Instance i : I.
+
+Definition flip {A B C : Type} (f : A -> B -> C) := fun y x => f x y.
+Class D (f : nat -> nat -> nat).
+Definition ftest (x y : nat) := x + y.
+Definition flipD (f : nat -> nat -> nat) : D f -> D (flip f).
+ Admitted.
+Module Instnopat.
+ Local Instance: B nat.
+ (* pattern_of_constr -> B nat *)
+ (* exact hint *)
+ Check (_ : B nat).
+ (* map_eauto -> B_instance0 *)
+ (* NO Constr_matching.matches !!! *)
+ Check (_ : B _).
+
+ Goal exists T, B T.
+ eexists.
+ eauto with typeclass_instances.
+ Qed.
+
+ Local Instance: D ftest.
+ Local Hint Resolve flipD | 0 : typeclass_instances.
+ (* pattern: D (flip _) *)
+ Fail Timeout 1 Check (_ : D _). (* loops applying flipD *)
+
+End Instnopat.
+
+Module InstnopatApply.
+ Local Instance: I -> B nat.
+ (* pattern_of_constr -> B nat *)
+ (* apply hint *)
+ Check (_ : B nat).
+ (* map_eauto -> B_instance0 *)
+ (* NO Constr_matching.matches !!! *)
+ Check (_ : B _).
+
+ Goal exists T, B T.
+ eexists.
+ eauto with typeclass_instances.
+ Qed.
+End InstnopatApply.
+
+Module InstPat.
+ Hint Extern 3 (B nat) => split : typeclass_instances.
+ (* map_eauto -> Extern hint *)
+ (* Constr_matching.matches -> true *)
+ Check (_ : B nat).
+ (* map_eauto -> Extern hint *)
+ (* Constr_matching.matches -> false:
+ Because an inductive in the pattern does not match an evar in the goal *)
+ Check (_ : B _).
+
+ Goal exists T, B T.
+ eexists.
+ (* map_existential -> Extern hint *)
+ (* Constr_matching.matches -> false *)
+ Fail progress eauto with typeclass_instances.
+ (* map_eauto -> Extern hint *)
+ (* Constr_matching.matches -> false *)
+ Fail typeclasses eauto.
+ Abort.
+
+ Hint Extern 0 (D (flip _)) => apply flipD : typeclass_instances.
+ Module withftest.
+ Local Instance: D ftest.
+
+ Check (_ : D _).
+ (* D_instance_0 : D ftest *)
+ Check (_ : D (flip _)).
+ (* ... : D (flip ftest) *)
+ End withftest.
+ Module withoutftest.
+ Hint Extern 0 (D ftest) => split : typeclass_instances.
+ Check (_ : D _).
+ (* ? : D ?, _not_ looping *)
+ Check (_ : D (flip _)).
+ (* ? : D (flip ?), _not_ looping *)
+
+ Check (_ : D (flip ftest)).
+ (* flipD ftest {| |} : D (flip ftest) *)
+ End withoutftest.
+End InstPat.
diff --git a/test-suite/success/bigQ.v b/test-suite/success/bigQ.v
new file mode 100644
index 00000000..7fd0cf66
--- /dev/null
+++ b/test-suite/success/bigQ.v
@@ -0,0 +1,66 @@
+Require Import BigQ.
+Import List.
+
+Definition pi_4_approx_low' :=
+(5066193963420194617885108698600649932059391557720145469382602092416947640628637390992675949693715109726079394291478795603894419483819297806310615866892414925850691415582239745615128821983865262221858109336884967754871321668348027076234335167119885298878199925731495390387858629042311908406056230882123787019283378509712244687397013657159455607193734144010901984756727174636853404278421831024545476850410085042498464474261035780891759930905778986584183710930670670301831474144997069400304290351567959717683444430666444319233768399342338059169002790777424962570605618705584660815518973602995097110557181643034682308210782171804373210646804613922337450953858508244032293753591878060539465788294318856859293281629951093130167801471787011911886414492513677892193100809508943832528344473873460853362957387889412799458784754514139679847887887544849825173792522272708046699681079289358082661375778523609867456540595586031625044964543428047238934233579184772793670436643502740076366994465457847106782560289782615794595755672643440040123002018908935362541166831619056664637901929131328502017686713274283777724453661234225382109584471950444925886358166551424008707439387934109226545596919797083495958300914344992836193126080289565652575543234385558967555959267746932292860747199382633363026440008828134867747920263181610216905129926037611247017868033961426567047355301676870662406173724238530061264149506666345040372864118731705584795947926329181826992456072045382170981478151356381437136818835196834068650217794381425547036331194595892801393225038235274901050364737353586927051766717037643833477566087835266968086513005761986678747515870298138062157791066648217784877968385924845017637219384732843791052551854695220023477365706464590594542001161575677402761543188277502092362285265847964496740584911576627239093631932307473445797386335961743298553548881544486940399236133577915988716682746485564575640818803540680574730591500432326858763829791848612343662539095316357052823005419355719381626599487868023399182174939253393897549026675976384326749445831606130546375395770778462506203752920470130305293966478109733954117063941901686840180727195741528561335809865193566993349413786715403053579411364371500063193205131503024022217701373077790337150298315820556080596579100618643147698304927957576213733526923182742441048553793831725592624850721293495085399785588171300815789795594858916409701139277050529011775828846362873246196866089783324522718656445008090114701320562608474099248873638488023114015981013142490827777895317580810590743940417298263300561876701828404744082864248409230009391001735746615476377303707782123483770118391136826609366946585715225248587168403619476143657107412319421501162805102723455593551478028055839072686207007765300258935153546418515706362733656094770289090398825190320430416955807878686642673124733998295439657633866090085982598765253268688814792672416195730086607425842181518560588819896560847103627615434844684536463752986969865794019299978956052589825441828842338163389851892617560591840546654410705167593310272272965900821031821380595084783691324416454359888103920904935692840264474003367023256964191100139001239923263691779167792867186165635514824889759796850863175082506408142175595463676408992027105356481220754473245821534527625758942093801142305560662681150069082553674495761075895588095760081401141419460482860852822686860785424514171214889677926763812031823537071721974799922995763666175738785000806081164280471363125324839717808977470218218571800106898347366938927189989988149888641129263448064762730769285877330997355234347773807099829665997515649429224335217107760728789764718885665291038706425454675746218345291274054088843647602239258308472486102933167465443294268551209015027897159307743987020521392788721231001835675584104894174434637260464035122611721657641428625505184886116917149318963070896162119215386541876236027342810162765609201440423207771441367926085768438143507025739041041240810056881304230519058117534418374553879198061289605354335880794397478047346975609179199801003098836622253165101961484972165230151495472006888128587168049198312469715081555662345452800468933420359802645393289853553618279788400476187713990872203669487294118461245455333004125835663010526985716431187034663870796866708678078952110615910196519835267441831874676895301527286826106517027821074816850326548617513767142627360001181210946100011774672126943957522004190414960909074050454565964857276407084991922274068961845339154089866785707764290964299529444616711194034827611771558783466230353209661849406004241580029437779784290315347968833708422223285859451369907260780956405036020581705441364379616715041818815829810906212826084485200785283123265202151252852134381195424724503189247411069117189489985791487434549080447866370484866697404176437230771558469231403088139693477706784802801265075586678597768511791952562627345622499328
+ # 100788726492580594349650258277496659410917619472657560321971265983799894639441017438166498752997098978003489632843381325240982516059309714013145358125224597827602157516585886911710102182473475545864474089191789296685473601331678556438310133356793199956062857423397512495293688453655805536015029176541424005214818033707522950635262669828538132795615008381824067071229426026518897202246241637377064076189277685257166926338187911595052586669184297526234794666364657344206795357967279911782849686515024121916258300642000317525374433525235296287037535618423661645124459323811792936193272341688261801253469089129439519903538495370298752436267926761998785090092411372633429302950606054074205533246665546979112178855223925266166034953000200646676762301817000435641690517142795144469005596172113586738287118865058604922865654348297975054956781513943444060257230946224520058527667925776273088622386666860662470481606622952298649177217986593047495967209669116410592230626047083795555559776477430548946990993890380787911273437967786556742804566652408275798339221179283430482118140020742719695900657696142739101628984271513292954605191778803974738871043737934546460016184719168074062912083778327025499841998124431899131874519812228674255796948879306477894924710085384116453080236862135706628989104070747737689294987000148388110561753028594988959655591699155508380909698460304884908709246116411180876105681720036833487450945730831039969246996849503525429840196651386469599438064049723005123629385485140945945416764414133189625489032807860400751723995946290581976152580477047961138617997133510128194027510895265424780627975864980749945631413855375897945293107842908479797077570371447220506451229526132919408351287454305932886749170523056147842439813407002950370505941417426433452282518739345666494683448699945734453214481915512562995906034771246088038719298959180199052759295868161570318718927430655393250250811804905393113074074574608255523847592006804881016594060188745212933427473833239777228852952217878690668413947367586040297784502192683200664398064682201012931468052982448022330449955215606614483165425935154496289535573901139223034819824408001205784146243892228030383941863746839845526558421740316887532141893650230936137269356278754487130882868595412163277284772124736531380334814212708066069618080153747333573454834500999083737284449542481264971030785043701582134343596645346132964567391370300568578875509971483039720438955919863275044932311289587494336123538202079503922025306586828117649623642521324286648529829664567232756108169459356549144779085080036654897525078792273443307070502103724611233768453196294899770515940520895908289018412144327894912660060761908970811602375085884115384049610753387776858733798341463052471017393165656926510611173543365663267563198760597092606598728110197523695339144204179424646442294307593146446562536865057987897899655645968129515654148044008249646703504419478535298270862753806142083172190778193001810574370442181909146645889199829207284871551220439225371051511970054965951914399901815408791418836185742573331879114400013259342896515702942707292473805188905427717363630137869116872433627556880809120353079342030725196065815470427569172350436988386579444534375353968759750750178342190349607711313840613843718547859929387259163285524671855725511880656411741012446023392964655239624520090988149679656514996202498334816938716757663800773997302639681907686195671083505910700098597156238624351157219093280177066146218516478636356056420098245995113668018177690728654922707281126889313941750547830163078886329630807850633273613622550216189245162735650139455042125252043274668279981753287687674520319519360593091620297805736177366738063651905396783336064579717230286821545930579779462534206093794040878198825916141099864730374109311705285661056855668930671948265232862757146615431791375559792290479316263924560826544387396762768331402198937951439504767950821089741987629257538953417586416459087855138539304027013800937360598578194413362672871055543854633921502486683911956250444582746421552178164852341035733290405311280719066037175324627429434912416361334254696649419037348733709488576582107382055914938194078813926926742828297826939120316120573453588052056773875836843924877773978390546387248009519202370375478981843515393806263037580338009594022254079586380520797699651840576286033587273591899639699077044271208886940540056794360292760863657703246410020854088849880453524038877935317875884698324859548991680533307680053872403383516589028793015681082435908524045497475001609824047204954932626536311826911363867426654549346914317405110707189532251727848751560224936842128628673253616256326013555922159336370177663785738170802777550686079119049748734352584409583136667752555307842739679930698964098088960000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)%bigQ
+.
+
+Definition pi_4_approx_high' :=
+(5066193963420194617885108698600649932059391557720145469382602092416947640628637390992675949693715109726079394291478795603894419483819297806310615866892414925850691415582239745615128821983865262221858109336884967754871321668348027076234335167119885298878199925731495390387858629042311908406056230882123787019283378509712244687397013657159455607193734144010901984756727174636853404278421831024545476850410085042498464474261035780891759930905778986584183710930670670301831474144997069400304290351567959717683444430666444319233768399342338059169002790777424962570605618705584660815518973602995097110557181643034682308210788409308322071457087096445676662503017187903223859814905546579050729173916234740628466315449085686468204847296426235788544874405450791749423436215032927889914519102361378633666267941326393265376660400091389373564825046526561381561278586121772300141564909333667988204680492088607706214346458601842899721615765319505314310192693665547163360402786722105590252780194994950097926184146718893770363322073641336811404180286358079915338791029818581497746089864894356686643882883410392601500048021013346713450539807687779704798018559373507951388092945938366448668853081682176581336156031434604604833692503597621519809826880683536141897075567053733515342478008373282599947520770191238802249392773327261328133194484586433840861730959791563023761306622956165536481335792721379318928171897265310054788931201902441066997927781894934061720760080768154565282051604447333036111267534150649674590201404453202347064545359869105856798745664471694795576801148562495225166002814304124970965817043547048503388910163287916513427409193998045119986267987892522931703487420953769290650229176116308194977201080691718825944370436642709192983358059711255925052564016519597530235976618244111239816418652282585432539731271068892992142956810775762851238126881225206289553948196520384709574383566733478326330112084307565420647201107231840508040019131253750047046446929758911912155202166566751947087545292626353331520202690130850009389387290465497377022080531269511355734944672010542204118978272180881335465227900174033380001851066811103401787656367819132934758616060307366679580043123632565656840669377840733018248707250548277181001911990237151790533341326223932843775840498222236867608395855700891719880219904948672458645420169533565809609056209006342663841718949396996175294237942265325043426430990062217643279654512512640557763489491751115437780462208361129433667449740743123546232162409802316714286708788831227582498585478334315076725145986771341647015244092760289407649044493584479944044779273447198382196766547779885914425854375158084417582279211000449529495605127376707776277159376010648950025135061284601443461110447113346277147728593420397807946636800365109579479211273476195727270004743568492888900356505584731622538401071221591141889158461271000051210318027818802379539544396973228585821742794928813630781709195703717312953337431290682263448669168179857644544116657440168099166467471736180072984407514757289757495435699300593165669101965987430482600019222913485092771346963058673132443387835726110205958057187517487684058179749952286341120230051432903482992282688283815697442898155194928723360957436110770317998431272108100149791425689283090777721270428030993332057319821685391144252815655146410678839177846108260765981523812232294638190350688210999605869296307711846463311346627138400477211801219366400312514793356564308532012682051019030257269068628100171220662165246389309014292764479226570049772046255291379151017129899157296574099437276707879597755725339406865738613810979022640265737120949077721294633786520294559343155148383011293584240192753971366644780434237846862975993387453786681995831719537733846579480995517357440575781962659282856696638992709756358478461648462532279323701121386551383509193782388241965285971965887701816406255233933761008649762854363984142178331798953040874526844255758512982810004271235810681505829473926495256537353108899526434200682024946218302499640511518360332022463196599199779172637638655415918976955930735312156870786600023896830267884391447789311101069654521354446521135407720085038662159974712373018912537116964809382149581004863115431780452188813210275393919111435118030412595133958954313836191108258769640843644195537185904547405641078708492098917460393911427237155683288565433183738513871595286090814836422982384810033331519971102974091067660369548406192526284519976668985518575216481570167748402860759832933071281814538397923687510782620605409323050353840034866296214149657376249634795555007199540807313397329050410326609108411299737760271566308288500400587417017113933243099961248847368789383209110747378488312550109911605079801570534271874115018095746872468910162721975463388518648962869080447866370484866697404176437230771558469231403088139693477706784802801265075586678597768511791952562627345622499328
+ # 100788726492580594349650258277496659410917619472657560321971265983799894639441017438166498752997098978003489632843381325240982516059309714013145358125224597827602157516585886911710102182473475545864474089191789296685473601331678556438310133356793199956062857423397512495293688453655805536015029176541424005214818033707522950635262669828538132795615008381824067071229426026518897202246241637377064076189277685257166926338187911595052586669184297526234794666364657344206795357967279911782849686515024121916258300642000317525374433525235296287037535618423661645124459323811792936193272341688261801253469089129439519903538495370298752436267926761998785090092411372633429302950606054074205533246665546979112178855223925266166034953000200646676762301817000435641690517142795144469005596172113586738287118865058604922865654348297975054956781513943444060257230946224520058527667925776273088622386666860662470481606622952298649177217986593047495967209669116410592230626047083795555559776477430548946990993890380787911273437967786556742804566652408275798339221179283430482118140020742719695900657696142739101628984271513292954605191778803974738871043737934546460016184719168074062912083778327025499841998124431899131874519812228674255796948879306477894924710085384116453080236862135706628989104070747737689294987000148388110561753028594988959655591699155508380909698460304884908709246116411180876105681720036833487450945730831039969246996849503525429840196651386469599438064049723005123629385485140945945416764414133189625489032807860400751723995946290581976152580477047961138617997133510128194027510895265424780627975864980749945631413855375897945293107842908479797077570371447220506451229526132919408351287454305932886749170523056147842439813407002950370505941417426433452282518739345666494683448699945734453214481915512562995906034771246088038719298959180199052759295868161570318718927430655393250250811804905393113074074574608255523847592006804881016594060188745212933427473833239777228852952217878690668413947367586040297784502192683200664398064682201012931468052982448022330449955215606614483165425935154496289535573901139223034819824408001205784146243892228030383941863746839845526558421740316887532141893650230936137269356278754487130882868595412163277284772124736531380334814212708066069618080153747333573454834500999083737284449542481264971030785043701582134343596645346132964567391370300568578875509971483039720438955919863275044932311289587494336123538202079503922025306586828117649623642521324286648529829664567232756108169459356549144779085080036654897525078792273443307070502103724611233768453196294899770515940520895908289018412144327894912660060761908970811602375085884115384049610753387776858733798341463052471017393165656926510611173543365663267563198760597092606598728110197523695339144204179424646442294307593146446562536865057987897899655645968129515654148044008249646703504419478535298270862753806142083172190778193001810574370442181909146645889199829207284871551220439225371051511970054965951914399901815408791418836185742573331879114400013259342896515702942707292473805188905427717363630137869116872433627556880809120353079342030725196065815470427569172350436988386579444534375353968759750750178342190349607711313840613843718547859929387259163285524671855725511880656411741012446023392964655239624520090988149679656514996202498334816938716757663800773997302639681907686195671083505910700098597156238624351157219093280177066146218516478636356056420098245995113668018177690728654922707281126889313941750547830163078886329630807850633273613622550216189245162735650139455042125252043274668279981753287687674520319519360593091620297805736177366738063651905396783336064579717230286821545930579779462534206093794040878198825916141099864730374109311705285661056855668930671948265232862757146615431791375559792290479316263924560826544387396762768331402198937951439504767950821089741987629257538953417586416459087855138539304027013800937360598578194413362672871055543854633921502486683911956250444582746421552178164852341035733290405311280719066037175324627429434912416361334254696649419037348733709488576582107382055914938194078813926926742828297826939120316120573453588052056773875836843924877773978390546387248009519202370375478981843515393806263037580338009594022254079586380520797699651840576286033587273591899639699077044271208886940540056794360292760863657703246410020854088849880453524038877935317875884698324859548991680533307680053872403383516589028793015681082435908524045497475001609824047204954932626536311826911363867426654549346914317405110707189532251727848751560224936842128628673253616256326013555922159336370177663785738170802777550686079119049748734352584409583136667752555307842739679930698964098088960000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)%bigQ
+.
+
+Fixpoint numden_Rcontfrac_tailrecB (accu: list bigZ) (n1 d1: bigZ) (n2 d2: bigZ) (fuel: nat) {struct fuel}:
+ (list bigZ * bigQ * bigQ) :=
+ let default := (rev_append accu nil, BigQ.div (BigQ.Qz n1) (BigQ.Qz d1), BigQ.div (BigQ.Qz n2) (BigQ.Qz d2)) in
+ match fuel with
+ | O => default
+ | S fuel' =>
+ let '(q1, r1) := BigZ.div_eucl n1 d1 in
+ let '(q2, r2) := BigZ.div_eucl n2 d2 in
+ match BigZ.eqb q1 q2 with
+ | false => default
+ | true =>
+ let r1_is_zero := BigZ.eqb r1 0 in
+ let r2_is_zero := BigZ.eqb r2 0 in
+ match Bool.eqb r1_is_zero r2_is_zero with
+ | false => default
+ | true =>
+ match r1_is_zero with
+ | true =>
+ match BigZ.eqb q1 1 with
+ | true => (rev_append accu nil, 1%bigQ, 1%bigQ)
+ | false => (rev_append ((q1 - 1)%bigZ :: accu) nil, 1%bigQ, 1%bigQ)
+ end
+ | false => numden_Rcontfrac_tailrecB (q1 :: accu) d1 r1 d2 r2 fuel'
+ end
+ end
+ end
+ end.
+
+Definition Bnum b :=
+ match b with
+ | BigQ.Qz t => t
+ | BigQ.Qq n d =>
+ if (d =? BigN.zero)%bigN then 0%bigZ else n
+ end.
+
+Definition Bden b :=
+ match b with
+ | BigQ.Qz _ => 1%bigN
+ | BigQ.Qq _ d => if (d =? BigN.zero)%bigN then 1%bigN else d
+ end.
+
+Definition rat_Rcontfrac_tailrecB q1 q2 :=
+ numden_Rcontfrac_tailrecB nil (Bnum q1) (BigZ.Pos (Bden q1)) (Bnum q2) (BigZ.Pos (Bden q2)).
+
+Definition pi_4_contfrac :=
+ rat_Rcontfrac_tailrecB pi_4_approx_low' pi_4_approx_high' 3000.
+
+(* The following used to fail because of a non canonical representation of 0 in
+the bytecode interpreter. Bug reported privately by Tahina Ramananandro. *)
+Goal pi_4_contfrac = pi_4_contfrac.
+vm_compute.
+reflexivity.
+Qed.
diff --git a/test-suite/success/bteauto.v b/test-suite/success/bteauto.v
new file mode 100644
index 00000000..3178c6fc
--- /dev/null
+++ b/test-suite/success/bteauto.v
@@ -0,0 +1,170 @@
+Require Import Program.Tactics.
+Module Backtracking.
+ Class A := { foo : nat }.
+
+ Instance A_1 : A | 2 := { foo := 42 }.
+ Instance A_0 : A | 1 := { foo := 0 }.
+ Lemma aeq (a : A) : foo = foo.
+ reflexivity.
+ Qed.
+
+ Arguments foo A : clear implicits.
+ Example find42 : exists n, n = 42.
+ Proof.
+ eexists.
+ eapply eq_trans.
+ evar (a : A). subst a.
+ refine (@aeq ?a).
+ Unshelve. all:cycle 1.
+ typeclasses eauto.
+ Fail reflexivity.
+ Undo 2.
+ (* Without multiple successes it fails *)
+ Set Typeclasses Debug Verbosity 2.
+ Fail all:((once (typeclasses eauto with typeclass_instances))
+ + apply eq_refl).
+ (* Does backtrack if other goals fail *)
+ all:[> typeclasses eauto + reflexivity .. ].
+ Undo 1.
+ all:(typeclasses eauto + reflexivity). (* Note "+" is a focussing combinator *)
+ Show Proof.
+ Qed.
+
+ Print find42.
+
+ Hint Extern 0 (_ = _) => reflexivity : equality.
+
+ Goal exists n, n = 42.
+ eexists.
+ eapply eq_trans.
+ evar (a : A). subst a.
+ refine (@aeq ?a).
+ Unshelve. all:cycle 1.
+ typeclasses eauto.
+ Fail reflexivity.
+ Undo 2.
+
+ (* Does backtrack between individual goals *)
+ Set Typeclasses Debug.
+ all:(typeclasses eauto with typeclass_instances equality).
+ Qed.
+
+ Unset Typeclasses Debug.
+
+ Module Leivant.
+ Axiom A : Type.
+ Existing Class A.
+ Axioms a b c d e: A.
+
+ Ltac get_value H := eval cbv delta [H] in H.
+
+ Goal True.
+ Fail refine (let H := _ : A in _); let v := get_value H in idtac v; fail.
+ Admitted.
+
+ Goal exists x:A, x=a.
+ unshelve evar (t : A). all:cycle 1.
+ refine (@ex_intro _ _ t _).
+ all:cycle 1.
+ all:(typeclasses eauto + reflexivity).
+ Qed.
+ End Leivant.
+End Backtracking.
+
+
+Hint Resolve 100 eq_sym eq_trans : core.
+Hint Cut [(_)* eq_sym eq_sym] : core.
+Hint Cut [_* eq_trans eq_trans] : core.
+Hint Cut [_* eq_trans eq_sym eq_trans] : core.
+
+
+Goal forall x y z : nat, x = y -> z = y -> x = z.
+Proof.
+ intros.
+ typeclasses eauto with core.
+Qed.
+
+Module Hierarchies.
+ Class A := mkA { data : nat }.
+ Class B := mkB { aofb :> A }.
+
+ Existing Instance mkB.
+
+ Definition makeB (a : A) : B := _.
+ Definition makeA (a : B) : A := _.
+
+ Fail Timeout 1 Definition makeA' : A := _.
+
+ Hint Cut [_* mkB aofb] : typeclass_instances.
+ Fail Definition makeA' : A := _.
+ Fail Definition makeB' : B := _.
+End Hierarchies.
+
+(** Hint modes *)
+
+Class Equality (A : Type) := { eqp : A -> A -> Prop }.
+
+Check (eqp 0%nat 0).
+
+Instance nat_equality : Equality nat := { eqp := eq }.
+
+Instance default_equality A : Equality A | 1000 :=
+ { eqp := eq }.
+
+Check (eqp 0%nat 0).
+
+(* Defaulting *)
+Check (fun x y => eqp x y).
+(* No more defaulting, reduce "trigger-happiness" *)
+Definition ambiguous x y := eqp x y.
+
+Hint Mode Equality ! : typeclass_instances.
+Fail Definition ambiguous' x y := eqp x y.
+Definition nonambiguous (x y : nat) := eqp x y.
+
+(** Typical looping instances with defaulting: *)
+Definition flip {A B C} (f : A -> B -> C) := fun x y => f y x.
+
+Class SomeProp {A : Type} (f : A -> A -> A) :=
+ { prf : forall x y, f x y = f x y }.
+
+Instance propflip (A : Type) (f : A -> A -> A) :
+ SomeProp f -> SomeProp (flip f).
+Proof.
+ intros []. constructor. reflexivity.
+Qed.
+
+Fail Timeout 1 Check prf.
+
+Hint Mode SomeProp + + : typeclass_instances.
+Check prf.
+Check (fun H : SomeProp plus => _ : SomeProp (flip plus)).
+
+(** Iterative deepening / breadth-first search *)
+
+Module IterativeDeepening.
+
+ Class A.
+ Class B.
+ Class C.
+
+ Instance: B -> A | 0.
+ Instance: C -> A | 0.
+ Instance: C -> B -> A | 0.
+ Instance: A -> A | 0.
+
+ Goal C -> A.
+ intros.
+ Fail Timeout 1 typeclasses eauto.
+ Set Typeclasses Iterative Deepening.
+ Fail typeclasses eauto 1.
+ typeclasses eauto 2.
+ Undo.
+ Unset Typeclasses Iterative Deepening.
+ Fail Timeout 1 typeclasses eauto.
+ Set Typeclasses Iterative Deepening.
+ Typeclasses eauto := debug 3.
+ typeclasses eauto.
+ Qed.
+
+End IterativeDeepening.
diff --git a/test-suite/success/cc.v b/test-suite/success/cc.v
index a70d9196..bbfe5ec4 100644
--- a/test-suite/success/cc.v
+++ b/test-suite/success/cc.v
@@ -129,5 +129,25 @@ Qed.
End bug_2447.
+(* congruence was supposed to do discriminate but it was bugged for
+ types with indices *)
+Inductive I : nat -> Type := C : I 0 | D : I 0.
+Goal ~C=D.
+congruence.
+Qed.
+
+(* Example by Jonathan Leivant, congruence up to universes *)
+Section JLeivant.
+ Variables S1 S2 : Set.
+
+ Definition T1 : Type := S1.
+ Definition T2 : Type := S2.
+ Goal T1 = T1.
+ congruence.
+ Undo.
+ unfold T1.
+ congruence.
+ Qed.
+End JLeivant.
diff --git a/test-suite/success/clear.v b/test-suite/success/clear.v
index 976bec73..e25510cf 100644
--- a/test-suite/success/clear.v
+++ b/test-suite/success/clear.v
@@ -13,3 +13,21 @@ Goal forall y z, (forall x:nat, x=y -> True) -> y=z -> True.
reflexivity.
Qed.
+Class A.
+
+Section Foo.
+
+ Variable a : A.
+
+ Goal A.
+ solve [typeclasses eauto].
+ Undo 1.
+ clear a.
+ try typeclasses eauto.
+ assert(a:=Build_A).
+ solve [ typeclasses eauto ].
+ Undo 2.
+ assert(b:=Build_A).
+ solve [ typeclasses eauto ].
+ Qed.
+End Foo. \ No newline at end of file
diff --git a/test-suite/success/coindprim.v b/test-suite/success/coindprim.v
index 4e0b7bf5..5b9265b6 100644
--- a/test-suite/success/coindprim.v
+++ b/test-suite/success/coindprim.v
@@ -1,36 +1,75 @@
+Require Import Program.
+
Set Primitive Projections.
-CoInductive stream A := { hd : A; tl : stream A }.
+CoInductive Stream (A : Type) := mkStream { hd : A; tl : Stream A}.
-CoFixpoint ticks : stream unit :=
- {| hd := tt; tl := ticks |}.
+Arguments mkStream [A] hd tl.
+Arguments hd [A] s.
+Arguments tl [A] s.
-Arguments hd [ A ] s.
-Arguments tl [ A ] s.
+Definition eta {A} (s : Stream A) := {| hd := s.(hd); tl := s.(tl) |}.
-CoInductive bisim {A} : stream A -> stream A -> Prop :=
- | bisims s s' : hd s = hd s' -> bisim (tl s) (tl s') -> bisim s s'.
+CoFixpoint ones := {| hd := 1; tl := ones |}.
+CoFixpoint ticks := {| hd := tt; tl := ticks |}.
-Lemma bisim_refl {A} (s : stream A) : bisim s s.
-Proof.
- revert s.
- cofix aux. intros. constructor. reflexivity. apply aux.
-Defined.
+CoInductive stream_equiv {A} {s : Stream A} {s' : Stream A} : Prop :=
+ mkStreamEq { hdeq : s.(hd) = s'.(hd); tleq : stream_equiv _ s.(tl) s'.(tl) }.
+Arguments stream_equiv {A} s s'.
-Lemma constr : forall (A : Type) (s : stream A),
- bisim s (Build_stream _ s.(hd) s.(tl)).
-Proof.
- intros. constructor. reflexivity. simpl. apply bisim_refl.
-Defined.
+Program CoFixpoint ones_eq : stream_equiv ones ones.(tl) :=
+ {| hdeq := eq_refl; tleq := ones_eq |}.
+
+CoFixpoint stream_equiv_refl {A} (s : Stream A) : stream_equiv s s :=
+ {| hdeq := eq_refl; tleq := stream_equiv_refl (tl s) |}.
+
+CoFixpoint stream_equiv_sym {A} (s s' : Stream A) (H : stream_equiv s s') : stream_equiv s' s :=
+ {| hdeq := eq_sym H.(hdeq); tleq := stream_equiv_sym _ _ H.(tleq) |}.
+
+CoFixpoint stream_equiv_trans {A} {s s' s'' : Stream A}
+ (H : stream_equiv s s') (H' : stream_equiv s' s'') : stream_equiv s s'' :=
+ {| hdeq := eq_trans H.(hdeq) H'.(hdeq);
+ tleq := stream_equiv_trans H.(tleq) H'.(tleq) |}.
-Lemma constr' : forall (A : Type) (s : stream A),
- s = Build_stream _ s.(hd) s.(tl).
+Program Definition eta_eq {A} (s : Stream A) : stream_equiv s (eta s):=
+ {| hdeq := eq_refl; tleq := stream_equiv_refl (tl (eta s))|}.
+
+Section Parks.
+ Variable A : Type.
+
+ Variable R : Stream A -> Stream A -> Prop.
+ Hypothesis bisim1 : forall s1 s2:Stream A,
+ R s1 s2 -> hd s1 = hd s2.
+ Hypothesis bisim2 : forall s1 s2:Stream A,
+ R s1 s2 -> R (tl s1) (tl s2).
+ CoFixpoint park_ppl :
+ forall s1 s2:Stream A, R s1 s2 -> stream_equiv s1 s2 :=
+ fun s1 s2 (p : R s1 s2) =>
+ mkStreamEq _ _ _ (bisim1 s1 s2 p)
+ (park_ppl (tl s1)
+ (tl s2)
+ (bisim2 s1 s2 p)).
+End Parks.
+
+Program CoFixpoint iterate {A} (f : A -> A) (x : A) : Stream A :=
+ {| hd := x; tl := iterate f (f x) |}.
+
+Program CoFixpoint map {A B} (f : A -> B) (s : Stream A) : Stream B :=
+ {| hd := f s.(hd); tl := map f s.(tl) |}.
+
+Theorem map_iterate A (f : A -> A) (x : A) : stream_equiv (iterate f (f x))
+ (map f (iterate f x)).
Proof.
- intros.
- Fail destruct s.
-Abort.
+apply park_ppl with
+(R:= fun s1 s2 => exists x : A, s1 = iterate f (f x) /\
+ s2 = map f (iterate f x)).
+now intros s1 s2 (x0,(->,->)).
+intros s1 s2 (x0,(->,->)).
+now exists (f x0).
+now exists x.
+Qed.
-Eval compute in constr _ ticks.
+Fail Check (fun A (s : Stream A) => eq_refl : s = eta s).
Notation convertible x y := (eq_refl x : x = y).
diff --git a/test-suite/success/contradiction.v b/test-suite/success/contradiction.v
new file mode 100644
index 00000000..92a7c6cc
--- /dev/null
+++ b/test-suite/success/contradiction.v
@@ -0,0 +1,32 @@
+(* Some tests for contradiction *)
+
+Lemma L1 : forall A B : Prop, A -> ~A -> B.
+Proof.
+intros; contradiction.
+Qed.
+
+Lemma L2 : forall A B : Prop, ~A -> A -> B.
+Proof.
+intros; contradiction.
+Qed.
+
+Lemma L3 : forall A : Prop, ~True -> A.
+Proof.
+intros; contradiction.
+Qed.
+
+Lemma L4 : forall A : Prop, forall x : nat, ~x=x -> A.
+Proof.
+intros; contradiction.
+Qed.
+
+Lemma L5 : forall A : Prop, forall x y : nat, ~x=y -> x=y -> A.
+Proof.
+intros; contradiction.
+Qed.
+
+Lemma L6 : forall A : Prop, forall x y : nat, x=y -> ~x=y -> A.
+Proof.
+intros; contradiction.
+Qed.
+
diff --git a/test-suite/success/decl_mode2.v b/test-suite/success/decl_mode2.v
new file mode 100644
index 00000000..46174e48
--- /dev/null
+++ b/test-suite/success/decl_mode2.v
@@ -0,0 +1,249 @@
+Theorem this_is_trivial: True.
+proof.
+ thus thesis.
+end proof.
+Qed.
+
+Theorem T: (True /\ True) /\ True.
+ split. split.
+proof. (* first subgoal *)
+ thus thesis.
+end proof.
+trivial. (* second subgoal *)
+proof. (* third subgoal *)
+ thus thesis.
+end proof.
+Abort.
+
+Theorem this_is_not_so_trivial: False.
+proof.
+end proof. (* here a warning is issued *)
+Fail Qed. (* fails: the proof in incomplete *)
+Admitted. (* Oops! *)
+
+Theorem T: True.
+proof.
+escape.
+auto.
+return.
+Abort.
+
+Theorem T: let a:=false in let b:= true in ( if a then True else False -> if b then True else False).
+intros a b.
+proof.
+assume H:(if a then True else False).
+reconsider H as False.
+reconsider thesis as True.
+Abort.
+
+Theorem T: forall x, x=2 -> 2+x=4.
+proof.
+let x be such that H:(x=2).
+have H':(2+x=2+2) by H.
+Abort.
+
+Theorem T: forall x, x=2 -> 2+x=4.
+proof.
+let x be such that H:(x=2).
+then (2+x=2+2).
+Abort.
+
+Theorem T: forall x, x=2 -> x + x = x * x.
+proof.
+let x be such that H:(x=2).
+have (4 = 4).
+ ~= (2 * 2).
+ ~= (x * x) by H.
+ =~ (2 + 2).
+ =~ H':(x + x) by H.
+Abort.
+
+Theorem T: forall x, x + x = x * x -> x = 0 \/ x = 2.
+proof.
+let x be such that H:(x + x = x * x).
+claim H':((x - 2) * x = 0).
+thus thesis.
+end claim.
+Abort.
+
+Theorem T: forall (A B:Prop), A -> B -> A /\ B.
+intros A B HA HB.
+proof.
+hence B.
+Abort.
+
+Theorem T: forall (A B C:Prop), A -> B -> C -> A /\ B /\ C.
+intros A B C HA HB HC.
+proof.
+thus B by HB.
+Abort.
+
+Theorem T: forall (A B C:Prop), A -> B -> C -> A /\ B.
+intros A B C HA HB HC.
+proof.
+Fail hence C. (* fails *)
+Abort.
+
+Theorem T: forall (A B:Prop), B -> A \/ B.
+intros A B HB.
+proof.
+hence B.
+Abort.
+
+Theorem T: forall (A B C D:Prop), C -> D -> (A /\ B) \/ (C /\ D).
+intros A B C D HC HD.
+proof.
+thus C by HC.
+Abort.
+
+Theorem T: forall (P:nat -> Prop), P 2 -> exists x,P x.
+intros P HP.
+proof.
+take 2.
+Abort.
+
+Theorem T: forall (P:nat -> Prop), P 2 -> exists x,P x.
+intros P HP.
+proof.
+hence (P 2).
+Abort.
+
+Theorem T: forall (P:nat -> Prop) (R:nat -> nat -> Prop), P 2 -> R 0 2 -> exists x, exists y, P y /\ R x y.
+intros P R HP HR.
+proof.
+thus (P 2) by HP.
+Abort.
+
+Theorem T: forall (A B:Prop) (P:nat -> Prop), (forall x, P x -> B) -> A -> A /\ B.
+intros A B P HP HA.
+proof.
+suffices to have x such that HP':(P x) to show B by HP,HP'.
+Abort.
+
+Theorem T: forall (A:Prop) (P:nat -> Prop), P 2 -> A -> A /\ (forall x, x = 2 -> P x).
+intros A P HP HA.
+proof.
+(* BUG: the next line fails when it should succeed.
+Waiting for someone to investigate the bug.
+focus on (forall x, x = 2 -> P x).
+let x be such that (x = 2).
+hence thesis by HP.
+end focus.
+*)
+Abort.
+
+Theorem T: forall x, x = 0 -> x + x = x * x.
+proof.
+let x be such that H:(x = 0).
+define sqr x as (x * x).
+reconsider thesis as (x + x = sqr x).
+Abort.
+
+Theorem T: forall (P:nat -> Prop), forall x, P x -> P x.
+proof.
+let P:(nat -> Prop).
+let x:nat.
+assume HP:(P x).
+Abort.
+
+Theorem T: forall (P:nat -> Prop), forall x, P x -> P x.
+proof.
+let P:(nat -> Prop).
+Fail let x. (* fails because x's type is not clear *)
+let x be such that HP:(P x). (* here x's type is inferred from (P x) *)
+Abort.
+
+Theorem T: forall (P:nat -> Prop), forall x, P x -> P x -> P x.
+proof.
+let P:(nat -> Prop).
+let x:nat.
+assume (P x). (* temporary name created *)
+Abort.
+
+Theorem T: forall (P:nat -> Prop), forall x, P x -> P x.
+proof.
+let P:(nat -> Prop).
+let x be such that (P x). (* temporary name created *)
+Abort.
+
+Theorem T: forall (P:nat -> Prop) (A:Prop), (exists x, (P x /\ A)) -> A.
+proof.
+let P:(nat -> Prop),A:Prop be such that H:(exists x, P x /\ A).
+consider x such that HP:(P x) and HA:A from H.
+Abort.
+
+(* Here is an example with pairs: *)
+
+Theorem T: forall p:(nat * nat)%type, (fst p >= snd p) \/ (fst p < snd p).
+proof.
+let p:(nat * nat)%type.
+consider x:nat,y:nat from p.
+reconsider thesis as (x >= y \/ x < y).
+Abort.
+
+Theorem T: forall P:(nat -> Prop), (forall n, P n -> P (n - 1)) ->
+(exists m, P m) -> P 0.
+proof.
+let P:(nat -> Prop) be such that HP:(forall n, P n -> P (n - 1)).
+given m such that Hm:(P m).
+Abort.
+
+Theorem T: forall (A B C:Prop), (A -> C) -> (B -> C) -> (A \/ B) -> C.
+proof.
+let A:Prop,B:Prop,C:Prop be such that HAC:(A -> C) and HBC:(B -> C).
+assume HAB:(A \/ B).
+per cases on HAB.
+suppose A.
+ hence thesis by HAC.
+suppose HB:B.
+ thus thesis by HB,HBC.
+end cases.
+Abort.
+
+Section Coq.
+
+Hypothesis EM : forall P:Prop, P \/ ~ P.
+
+Theorem T: forall (A C:Prop), (A -> C) -> (~A -> C) -> C.
+proof.
+let A:Prop,C:Prop be such that HAC:(A -> C) and HNAC:(~A -> C).
+per cases of (A \/ ~A) by EM.
+suppose (~A).
+ hence thesis by HNAC.
+suppose A.
+ hence thesis by HAC.
+end cases.
+Abort.
+
+Theorem T: forall (A C:Prop), (A -> C) -> (~A -> C) -> C.
+proof.
+let A:Prop,C:Prop be such that HAC:(A -> C) and HNAC:(~A -> C).
+per cases on (EM A).
+suppose (~A).
+Abort.
+End Coq.
+
+Theorem T: forall (A B:Prop) (x:bool), (if x then A else B) -> A \/ B.
+proof.
+let A:Prop,B:Prop,x:bool.
+per cases on x.
+suppose it is true.
+ assume A.
+ hence A.
+suppose it is false.
+ assume B.
+ hence B.
+end cases.
+Abort.
+
+Theorem T: forall (n:nat), n + 0 = n.
+proof.
+let n:nat.
+per induction on n.
+suppose it is 0.
+ thus (0 + 0 = 0).
+suppose it is (S m) and H:thesis for m.
+ then (S (m + 0) = S m).
+ thus =~ (S m + 0).
+end induction.
+Abort. \ No newline at end of file
diff --git a/test-suite/success/destruct.v b/test-suite/success/destruct.v
index 9f091e39..90a60daa 100644
--- a/test-suite/success/destruct.v
+++ b/test-suite/success/destruct.v
@@ -96,21 +96,21 @@ Abort.
(* Check that subterm selection does not solve existing evars *)
Goal exists x, S x = S 0.
-eexists.
+eexists ?[x].
Show x. (* Incidentally test Show on a named goal *)
destruct (S _). (* Incompatible occurrences but takes the first one since Oct 2014 *)
change (0 = S 0).
Abort.
Goal exists x, S 0 = S x.
-eexists.
+eexists ?[x].
destruct (S _). (* Incompatible occurrences but takes the first one since Oct 2014 *)
change (0 = S ?x).
[x]: exact 0. (* Incidentally test applying a tactic to a goal on the shelve *)
Abort.
Goal exists n p:nat, (S n,S n) = (S p,S p) /\ p = n.
-do 2 eexists.
+eexists ?[n]; eexists ?[p].
destruct (_, S _). (* Was unifying at some time in trunk, now takes the first occurrence *)
change ((n, n0) = (S ?p, S ?p) /\ ?p = ?n).
Abort.
@@ -426,7 +426,7 @@ destruct b eqn:H.
(* Check natural instantiation behavior when the goal has already an evar *)
Goal exists x, S x = x.
-eexists.
+eexists ?[x].
destruct (S _).
change (0 = ?x).
Abort.
diff --git a/test-suite/success/eauto.v b/test-suite/success/eauto.v
index 773dd321..160f2d9d 100644
--- a/test-suite/success/eauto.v
+++ b/test-suite/success/eauto.v
@@ -5,6 +5,184 @@
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
+
+Class A (A : Type).
+ Instance an: A nat.
+
+Class B (A : Type) (a : A).
+Instance bn0: B nat 0.
+Instance bn1: B nat 1.
+
+Goal A nat.
+Proof.
+ typeclasses eauto.
+Qed.
+
+Goal B nat 2.
+Proof.
+ Fail typeclasses eauto.
+Abort.
+
+Goal exists T : Type, A T.
+Proof.
+ eexists. typeclasses eauto.
+Defined.
+
+Hint Extern 0 (_ /\ _) => constructor : typeclass_instances.
+
+Existing Class and.
+
+Goal exists (T : Type) (t : T), A T /\ B T t.
+Proof.
+ eexists. eexists. typeclasses eauto.
+Defined.
+
+Instance ab: A bool. (* Backtrack on A instance *)
+Goal exists (T : Type) (t : T), A T /\ B T t.
+Proof.
+ eexists. eexists. typeclasses eauto.
+Defined.
+
+Class C {T} `(a : A T) (t : T).
+Require Import Classes.Init.
+Hint Extern 0 { x : ?A & _ } =>
+ unshelve class_apply @existT : typeclass_instances.
+Existing Class sigT.
+Set Typeclasses Debug.
+Instance can: C an 0.
+(* Backtrack on instance implementation *)
+Goal exists (T : Type) (t : T), { x : A T & C x t }.
+Proof.
+ eexists. eexists. typeclasses eauto.
+Defined.
+
+Class D T `(a: A T).
+ Instance: D _ an.
+Goal exists (T : Type), { x : A T & D T x }.
+Proof.
+ eexists. typeclasses eauto.
+Defined.
+
+
+(* Example from Nicolas Magaud on coq-club - Jul 2000 *)
+
+Definition Nat : Set := nat.
+Parameter S' : Nat -> Nat.
+Parameter plus' : Nat -> Nat -> Nat.
+
+Lemma simpl_plus_l_rr1 :
+ (forall n0 : Nat,
+ (forall m p : Nat, plus' n0 m = plus' n0 p -> m = p) ->
+ forall m p : Nat, S' (plus' n0 m) = S' (plus' n0 p) -> m = p) ->
+ forall n : Nat,
+ (forall m p : Nat, plus' n m = plus' n p -> m = p) ->
+ forall m p : Nat, S' (plus' n m) = S' (plus' n p) -> m = p.
+ intros.
+ apply H0. apply f_equal_nat.
+ Time info_eauto.
+ Undo.
+ Set Typeclasses Debug.
+ Set Typeclasses Iterative Deepening.
+ Time typeclasses eauto 6 with nocore. Show Proof.
+ Undo.
+ Time eauto. (* does EApply H *)
+Qed.
+
+(* Example from Nicolas Tabareau on coq-club - Feb 2016.
+ Full backtracking on dependent subgoals.
+ *)
+Require Import Coq.Classes.Init.
+
+Module NTabareau.
+
+Set Typeclasses Dependency Order.
+Unset Typeclasses Iterative Deepening.
+Notation "x .1" := (projT1 x) (at level 3).
+Notation "x .2" := (projT2 x) (at level 3).
+
+Parameter myType: Type.
+
+Class Foo (a:myType) := {}.
+
+Class Bar (a:myType) := {}.
+
+Class Qux (a:myType) := {}.
+
+Parameter fooTobar : forall a (H : Foo a), {b: myType & Bar b}.
+
+Parameter barToqux : forall a (H : Bar a), {b: myType & Qux b}.
+
+Hint Extern 5 (Bar ?D.1) =>
+ destruct D; simpl : typeclass_instances.
+
+Hint Extern 5 (Qux ?D.1) =>
+ destruct D; simpl : typeclass_instances.
+
+Hint Extern 1 myType =>
+ unshelve refine (fooTobar _ _).1 : typeclass_instances.
+
+Hint Extern 1 myType => unshelve refine (barToqux _ _).1 : typeclass_instances.
+
+Hint Extern 0 { x : _ & _ } => simple refine (existT _ _ _) : typeclass_instances.
+
+Unset Typeclasses Debug.
+Definition trivial a (H : Foo a) : {b : myType & Qux b}.
+Proof.
+ Time typeclasses eauto 10 with typeclass_instances.
+ Undo. Set Typeclasses Iterative Deepening.
+ Time typeclasses eauto with typeclass_instances.
+Defined.
+
+End NTabareau.
+
+Module NTabareauClasses.
+
+Set Typeclasses Dependency Order.
+Unset Typeclasses Iterative Deepening.
+Notation "x .1" := (projT1 x) (at level 3).
+Notation "x .2" := (projT2 x) (at level 3).
+
+Parameter myType: Type.
+Existing Class myType.
+
+Class Foo (a:myType) := {}.
+
+Class Bar (a:myType) := {}.
+
+Class Qux (a:myType) := {}.
+
+Parameter fooTobar : forall a (H : Foo a), {b: myType & Bar b}.
+
+Parameter barToqux : forall a (H : Bar a), {b: myType & Qux b}.
+
+Hint Extern 5 (Bar ?D.1) =>
+ destruct D; simpl : typeclass_instances.
+
+Hint Extern 5 (Qux ?D.1) =>
+ destruct D; simpl : typeclass_instances.
+
+Hint Extern 1 myType =>
+ unshelve notypeclasses refine (fooTobar _ _).1 : typeclass_instances.
+
+Hint Extern 1 myType =>
+ unshelve notypeclasses refine (barToqux _ _).1 : typeclass_instances.
+
+Hint Extern 0 { x : _ & _ } =>
+ unshelve notypeclasses refine (existT _ _ _) : typeclass_instances.
+
+Unset Typeclasses Debug.
+
+Definition trivial a (H : Foo a) : {b : myType & Qux b}.
+Proof.
+ Time typeclasses eauto 10 with typeclass_instances.
+ Undo. Set Typeclasses Iterative Deepening.
+ (* Much faster in iteratove deepening mode *)
+ Time typeclasses eauto with typeclass_instances.
+Defined.
+
+End NTabareauClasses.
+
+
Require Import List.
Parameter in_list : list (nat * nat) -> nat -> Prop.
@@ -38,23 +216,6 @@ Hint Resolve lem1 lem2 lem3 lem4: essai.
Goal
forall (l : list (nat * nat)) (n p q : nat),
not_in_list ((p, q) :: l) n -> not_in_list l n.
-intros.
- eauto with essai.
-Qed.
-
-(* Example from Nicolas Magaud on coq-club - Jul 2000 *)
-
-Definition Nat : Set := nat.
-Parameter S' : Nat -> Nat.
-Parameter plus' : Nat -> Nat -> Nat.
-
-Lemma simpl_plus_l_rr1 :
- (forall n0 : Nat,
- (forall m p : Nat, plus' n0 m = plus' n0 p -> m = p) ->
- forall m p : Nat, S' (plus' n0 m) = S' (plus' n0 p) -> m = p) ->
- forall n : Nat,
- (forall m p : Nat, plus' n m = plus' n p -> m = p) ->
- forall m p : Nat, S' (plus' n m) = S' (plus' n p) -> m = p.
-intros.
- eauto. (* does EApply H *)
+ intros.
+ eauto with essai.
Qed.
diff --git a/test-suite/success/eqdecide.v b/test-suite/success/eqdecide.v
index 1f6af0dc..724e2998 100644
--- a/test-suite/success/eqdecide.v
+++ b/test-suite/success/eqdecide.v
@@ -14,6 +14,18 @@ Lemma lem1 : forall x y : T, {x = y} + {x <> y}.
decide equality.
Qed.
+Lemma lem1' : forall x y : T, x = y \/ x <> y.
+ decide equality.
+Qed.
+
+Lemma lem1'' : forall x y : T, {x <> y} + {x = y}.
+ decide equality.
+Qed.
+
+Lemma lem1''' : forall x y : T, x <> y \/ x = y.
+ decide equality.
+Qed.
+
Lemma lem2 : forall x y : T, {x = y} + {x <> y}.
intros x y.
decide equality.
diff --git a/test-suite/success/goal_selector.v b/test-suite/success/goal_selector.v
new file mode 100644
index 00000000..86814051
--- /dev/null
+++ b/test-suite/success/goal_selector.v
@@ -0,0 +1,55 @@
+Inductive two : bool -> Prop :=
+| Zero : two false
+| One : two true.
+
+Ltac dup :=
+ let H := fresh in assert (forall (P : Prop), P -> P -> P) as H by (intros; trivial);
+ apply H; clear H.
+
+Lemma transform : two false <-> two true.
+Proof. split; intros _; constructor. Qed.
+
+Goal two false /\ two true /\ two false /\ two true /\ two true /\ two true.
+Proof.
+ do 2 dup.
+ - repeat split.
+ 2, 4-99, 100-3:idtac.
+ 2-5:exact One.
+ par:exact Zero.
+ - repeat split.
+ 3-6:swap 1 4.
+ 1-5:swap 1 5.
+ 0-4:exact One.
+ all:exact Zero.
+ - repeat split.
+ 1, 3:exact Zero.
+ 1, 2, 3, 4: exact One.
+ - repeat split.
+ all:apply transform.
+ 2, 4, 6:apply transform.
+ all:apply transform.
+ 1-5:apply transform.
+ 1-6:exact One.
+Qed.
+
+Goal True -> True.
+Proof.
+ intros y; only 1-2 : repeat idtac.
+ 1-1:match goal with y : _ |- _ => let x := y in idtac x end.
+ Fail 1-1:let x := y in idtac x.
+ 1:let x := y in idtac x.
+ exact I.
+Qed.
+
+Goal True /\ (True /\ True).
+Proof.
+ dup.
+ - split; only 2: (split; exact I).
+ exact I.
+ - split; only 2: split; exact I.
+Qed.
+
+Goal True -> exists (x : Prop), x.
+Proof.
+ intro H; eexists ?[x]; only [x]: exact True. 1: assumption.
+Qed.
diff --git a/test-suite/success/induct.v b/test-suite/success/induct.v
index b8c6bf3f..1ed731f5 100644
--- a/test-suite/success/induct.v
+++ b/test-suite/success/induct.v
@@ -151,3 +151,46 @@ intros x H1 H.
induction H.
change (0 = z -> True) in IHrepr''.
Abort.
+
+(* Test double induction *)
+
+(* This was failing in 8.5 and before because of a bug in the order of
+ hypotheses *)
+
+Inductive I2 : Type :=
+ C2 : forall x:nat, x=x -> I2.
+Goal forall a b:I2, a = b.
+double induction a b.
+Abort.
+
+(* This was leaving useless hypotheses in 8.5 and before because of
+ the same bug. This is a change of compatibility. *)
+
+Inductive I3 : Prop :=
+ C3 : forall x:nat, x=x -> I3.
+Goal forall a b:I3, a = b.
+double induction a b.
+Fail clear H. (* H should have been erased *)
+Abort.
+
+(* This one had quantification in reverse order in 8.5 and before *)
+(* This is a change of compatibility. *)
+
+Goal forall m n, le m n -> le n m -> n=m.
+intros m n. double induction 1 2.
+3:destruct 1. (* Should be "S m0 <= m0" *)
+Abort.
+
+(* Idem *)
+
+Goal forall m n p q, le m n -> le p q -> n+p=m+q.
+intros *. double induction 1 2.
+3:clear H2. (* H2 should have been erased *)
+Abort.
+
+(* This is unchanged *)
+
+Goal forall m n:nat, n=m.
+double induction m n.
+Abort.
+
diff --git a/test-suite/success/intros.v b/test-suite/success/intros.v
index 11156aa0..ee69df97 100644
--- a/test-suite/success/intros.v
+++ b/test-suite/success/intros.v
@@ -84,3 +84,47 @@ Qed.
Goal forall x : nat, True.
intros y%(fun x => x).
Abort.
+
+(* Fixing a bug in the order of side conditions of a "->" step *)
+
+Goal (True -> 1=0) -> 1=1.
+intros ->.
+- reflexivity.
+- exact I.
+Qed.
+
+Goal forall x, (True -> x=0) -> 0=x.
+intros x ->.
+- reflexivity.
+- exact I.
+Qed.
+
+(* Fixing a bug when destructing a type with let-ins in the constructor *)
+
+Inductive I := C : let x:=1 in x=1 -> I.
+Goal I -> True.
+intros [x H]. (* Was failing in 8.5 *)
+Abort.
+
+(* Ensuring that the (pat1,...,patn) intropatterns has the expected size, up
+ to skipping let-ins *)
+
+Goal I -> 1=1.
+intros (H). (* This skips x *)
+exact H.
+Qed.
+
+Goal I -> 1=1.
+Fail intros (x,H,H').
+Fail intros [|].
+intros (x,H).
+exact H.
+Qed.
+
+Goal Acc le 0 -> True.
+Fail induction 1 as (n,H). (* Induction hypothesis is missing *)
+induction 1 as (n,H,IH).
+exact Logic.I.
+Qed.
+
+
diff --git a/test-suite/success/keyedrewrite.v b/test-suite/success/keyedrewrite.v
index 5b0502cf..b88c142b 100644
--- a/test-suite/success/keyedrewrite.v
+++ b/test-suite/success/keyedrewrite.v
@@ -58,4 +58,5 @@ Qed.
Lemma test b : b && true = b.
Fail rewrite andb_true_l.
- Admitted. \ No newline at end of file
+ Admitted.
+ \ No newline at end of file
diff --git a/test-suite/success/ltac.v b/test-suite/success/ltac.v
index 6c4d4ae9..ce909905 100644
--- a/test-suite/success/ltac.v
+++ b/test-suite/success/ltac.v
@@ -15,7 +15,7 @@ Ltac F x := idtac; G x
with G y := idtac; F y.
(* Check that Match Context keeps a closure *)
-Ltac U := let a := constr:I in
+Ltac U := let a := constr:(I) in
match goal with
| |- _ => apply a
end.
@@ -75,7 +75,7 @@ Qed.
(* Check context binding *)
Ltac sym t :=
- match constr:t with
+ match constr:(t) with
| context C[(?X1 = ?X2)] => context C [X1 = X2]
end.
@@ -143,7 +143,7 @@ Qed.
Ltac check_binding y := cut ((fun y => y) = S).
Goal True.
-check_binding ipattern:H.
+check_binding ipattern:(H).
Abort.
(* Check that variables explicitly parsed as ltac variables are not
@@ -151,7 +151,7 @@ Abort.
Ltac afi tac := intros; tac.
Goal 1 = 2.
-afi ltac:auto.
+afi ltac:(auto).
Abort.
(* Tactic Notation avec listes *)
@@ -174,7 +174,7 @@ Abort.
empty args *)
Goal True.
-match constr:@None with @None => exact I end.
+match constr:(@None) with @None => exact I end.
Abort.
(* Check second-order pattern unification *)
@@ -218,7 +218,7 @@ Ltac Z1 t := set (x:=t).
Ltac Z2 t := t.
Goal True -> True.
Z1 O.
-Z2 ltac:O.
+Z2 ltac:(O).
exact I.
Qed.
@@ -302,7 +302,7 @@ Abort.
(* Check instantiation of binders using ltac names *)
Goal True.
-let x := ipattern:y in assert (forall x y, x = y + 0).
+let x := ipattern:(y) in assert (forall x y, x = y + 0).
intro.
destruct y. (* Check that the name is y here *)
Abort.
diff --git a/test-suite/success/ltacprof.v b/test-suite/success/ltacprof.v
new file mode 100644
index 00000000..d5552695
--- /dev/null
+++ b/test-suite/success/ltacprof.v
@@ -0,0 +1,8 @@
+(** Some LtacProf tests *)
+
+Set Ltac Profiling.
+Ltac multi := (idtac + idtac).
+Goal True.
+ try (multi; fail). (* Used to result in: Anomaly: Uncaught exception Failure("hd"). Please report. *)
+Admitted.
+Show Ltac Profile.
diff --git a/test-suite/success/onlyprinting.v b/test-suite/success/onlyprinting.v
new file mode 100644
index 00000000..91a628d7
--- /dev/null
+++ b/test-suite/success/onlyprinting.v
@@ -0,0 +1,7 @@
+Notation "x ++ y" := (plus x y) (only printing).
+
+Fail Check 0 ++ 0.
+
+Notation "x + y" := (max x y) (only printing).
+
+Check (eq_refl : 42 + 18 = 60).
diff --git a/test-suite/success/par_abstract.v b/test-suite/success/par_abstract.v
new file mode 100644
index 00000000..7f6f9d62
--- /dev/null
+++ b/test-suite/success/par_abstract.v
@@ -0,0 +1,25 @@
+Axiom T : Type.
+
+Lemma foo : True * Type.
+Proof.
+ split.
+ par: abstract (exact I || exact T).
+Defined.
+
+(* Yes, these names are generated hence
+ the test is fragile. I want to assert
+ that abstract was correctly handled
+ by par: *)
+Check foo_subproof.
+Check foo_subproof0.
+Check (refl_equal _ :
+ foo =
+ pair foo_subproof foo_subproof0).
+
+Lemma bar : True * Type.
+Proof.
+ split.
+ par: (exact I || exact T).
+Defined.
+Check (refl_equal _ :
+ bar = pair I T).
diff --git a/test-suite/success/paralleltac.v b/test-suite/success/paralleltac.v
index 94ff96ef..d25fd32a 100644
--- a/test-suite/success/paralleltac.v
+++ b/test-suite/success/paralleltac.v
@@ -1,3 +1,17 @@
+Lemma test_nofail_like_all1 :
+ True /\ False.
+Proof.
+split.
+all: trivial.
+Admitted.
+
+Lemma test_nofail_like_all2 :
+ True /\ False.
+Proof.
+split.
+par: trivial.
+Admitted.
+
Fixpoint fib n := match n with
| O => 1
| S m => match m with
@@ -19,28 +33,28 @@ Lemma test_old x : P (S x) /\ P (S x) /\ P (S x) /\ P (S x).
Proof.
repeat split.
idtac "T1: linear".
-Time all: solve_P.
+Time all: solve [solve_P].
Qed.
Lemma test_ok x : P (S x) /\ P (S x) /\ P (S x) /\ P (S x).
Proof.
repeat split.
idtac "T2: parallel".
-Time par: solve_P.
+Time par: solve [solve_P].
Qed.
Lemma test_fail x : P (S x) /\ P x /\ P (S x) /\ P (S x).
Proof.
repeat split.
idtac "T3: linear failure".
-Fail Time all: solve_P.
-all: apply (P_triv Type).
+Fail Time all: solve solve_P.
+all: solve [apply (P_triv Type)].
Qed.
Lemma test_fail2 x : P (S x) /\ P x /\ P (S x) /\ P (S x).
Proof.
repeat split.
idtac "T4: parallel failure".
-Fail Time par: solve_P.
-all: apply (P_triv Type).
+Fail Time par: solve [solve_P].
+all: solve [apply (P_triv Type)].
Qed.
diff --git a/test-suite/success/primitiveproj.v b/test-suite/success/primitiveproj.v
index 281d707c..2fa77049 100644
--- a/test-suite/success/primitiveproj.v
+++ b/test-suite/success/primitiveproj.v
@@ -35,10 +35,6 @@ Set Implicit Arguments.
Check nat.
-(* Inductive X (U:Type) := Foo (k : nat) (x : X U). *)
-(* Parameter x : X nat. *)
-(* Check x.(k). *)
-
Inductive X (U:Type) := { k : nat; a: k = k -> X U; b : let x := a eq_refl in X U }.
Parameter x:X nat.
@@ -49,19 +45,11 @@ Inductive Y := { next : option Y }.
Check _.(next) : option Y.
Lemma eta_ind (y : Y) : y = Build_Y y.(next).
-Proof. reflexivity. Defined.
-
-Variable t : Y.
-
-Fixpoint yn (n : nat) (y : Y) : Y :=
- match n with
- | 0 => t
- | S n => {| next := Some (yn n y) |}
- end.
+Proof. Fail reflexivity. Abort.
-Lemma eta_ind' (y: Y) : Some (yn 100 y) = Some {| next := (yn 100 y).(next) |}.
-Proof. reflexivity. Defined.
+Inductive Fdef := { Fa : nat ; Fb := Fa; Fc : Fdef }.
+Fail Scheme Fdef_rec := Induction for Fdef Sort Prop.
(*
Rules for parsing and printing of primitive projections and their eta expansions.
diff --git a/test-suite/success/programequality.v b/test-suite/success/programequality.v
new file mode 100644
index 00000000..414c572f
--- /dev/null
+++ b/test-suite/success/programequality.v
@@ -0,0 +1,13 @@
+Require Import Program.
+
+Axiom t : nat -> Set.
+
+Goal forall (x y : nat) (e : x = y) (e' : x = y) (P : t y -> x = y -> Type)
+ (a : t x),
+ P (eq_rect _ _ a _ e) e'.
+Proof.
+ intros.
+ pi_eq_proofs. clear e.
+ destruct e'. simpl.
+ change (P a eq_refl).
+Abort. \ No newline at end of file
diff --git a/test-suite/success/remember.v b/test-suite/success/remember.v
index 0befe054..b26a9ff1 100644
--- a/test-suite/success/remember.v
+++ b/test-suite/success/remember.v
@@ -14,3 +14,16 @@ let name := fresh "fresh" in
remember (1 + 2) as x eqn:name.
rewrite fresh.
Abort.
+
+(* An example which was working in 8.4 but failing in 8.5 and 8.5pl1 *)
+
+Module A.
+Axiom N : nat.
+End A.
+Module B.
+Include A.
+End B.
+Goal id A.N = B.N.
+reflexivity.
+Qed.
+
diff --git a/test-suite/success/setoid_test.v b/test-suite/success/setoid_test.v
index 0465c4b3..1f24ef2a 100644
--- a/test-suite/success/setoid_test.v
+++ b/test-suite/success/setoid_test.v
@@ -166,3 +166,16 @@ Proof. intros. setoid_rewrite <- foo_prf. change (beq_nat x 0 = y). Abort.
Goal forall (x : nat) (y : bool), beq_nat (foo_neg x) 0 = foo_neg y.
Proof. intros. setoid_rewrite <- @foo_prf at 1. change (beq_nat x 0 = foo_neg y). Abort.
+(* This should not raise an anomaly as it did for some time in early 2016 *)
+
+Definition t := nat -> bool.
+Definition h (a b : t) := forall n, a n = b n.
+
+Instance subrelh : subrelation h (Morphisms.pointwise_relation nat eq).
+Proof. intros x y H; assumption. Qed.
+
+Goal forall a b, h a b -> a 0 = b 0.
+intros.
+setoid_rewrite H. (* Fallback on ordinary rewrite without anomaly *)
+reflexivity.
+Qed.
diff --git a/test-suite/success/shrink_abstract.v b/test-suite/success/shrink_abstract.v
new file mode 100644
index 00000000..3f6b9cb3
--- /dev/null
+++ b/test-suite/success/shrink_abstract.v
@@ -0,0 +1,13 @@
+Set Shrink Abstract.
+
+Definition foo : forall (n m : nat), bool.
+Proof.
+pose (p := 0).
+intros n.
+pose (q := n).
+intros m.
+pose (r := m).
+abstract (destruct m; [left|right]).
+Defined.
+
+Check (foo_subproof : nat -> bool).
diff --git a/test-suite/success/shrink_obligations.v b/test-suite/success/shrink_obligations.v
new file mode 100644
index 00000000..676b9787
--- /dev/null
+++ b/test-suite/success/shrink_obligations.v
@@ -0,0 +1,28 @@
+Require Program.
+
+Obligation Tactic := idtac.
+
+Set Shrink Obligations.
+
+Program Definition foo (m : nat) (p := S m) (n : nat) (q := S n) : unit :=
+let bar : {r | n < r} := _ in
+let qux : {r | p < r} := _ in
+let quz : m = n -> True := _ in
+tt.
+Next Obligation.
+intros m p n q.
+exists (S n); constructor.
+Qed.
+Next Obligation.
+intros m p n q.
+exists (S (S m)); constructor.
+Qed.
+Next Obligation.
+intros m p n q ? ? H.
+destruct H.
+constructor.
+Qed.
+
+Check (foo_obligation_1 : forall n, {r | n < r}).
+Check (foo_obligation_2 : forall m, {r | (S m) < r}).
+Check (foo_obligation_3 : forall m n, m = n -> True).
diff --git a/test-suite/success/simpl_tuning.v b/test-suite/success/simpl_tuning.v
index d4191b93..2728672f 100644
--- a/test-suite/success/simpl_tuning.v
+++ b/test-suite/success/simpl_tuning.v
@@ -106,7 +106,7 @@ match goal with |- (f (g x1), h x2) = (f (g x1), h x2) => idtac end.
Abort.
Definition volatile := fun x : nat => x.
-Arguments volatile /.
+Arguments volatile / _.
Lemma foo : volatile = volatile.
simpl.
diff --git a/test-suite/success/specialize.v b/test-suite/success/specialize.v
index 3faa1ca4..fba05cd9 100644
--- a/test-suite/success/specialize.v
+++ b/test-suite/success/specialize.v
@@ -64,3 +64,11 @@ assert (H:=H I).
match goal with H:_ |- _ => clear H end.
match goal with H:_ |- _ => exact H end.
Qed.
+
+(* Test specialize as *)
+
+Goal (forall x, x=0) -> 1=0.
+intros.
+specialize (H 1) as ->.
+reflexivity.
+Qed.
diff --git a/test-suite/success/ssrpattern.v b/test-suite/success/ssrpattern.v
new file mode 100644
index 00000000..96f0bbac
--- /dev/null
+++ b/test-suite/success/ssrpattern.v
@@ -0,0 +1,22 @@
+Require Import ssrmatching.
+
+(*Set Debug SsrMatching.*)
+
+Tactic Notation "at" "[" ssrpatternarg(pat) "]" tactic(t) :=
+ let name := fresh in
+ let def_name := fresh in
+ ssrpattern pat;
+ intro name;
+ pose proof (refl_equal name) as def_name;
+ unfold name at 1 in def_name;
+ t def_name;
+ [ rewrite <- def_name | idtac.. ];
+ clear name def_name.
+
+Lemma test (H : True -> True -> 3 = 7) : 28 = 3 * 4.
+Proof.
+at [ X in X * 4 ] ltac:(fun place => rewrite -> H in place).
+- reflexivity.
+- trivial.
+- trivial.
+Qed.
diff --git a/test-suite/success/subst.v b/test-suite/success/subst.v
new file mode 100644
index 00000000..25ee81b5
--- /dev/null
+++ b/test-suite/success/subst.v
@@ -0,0 +1,42 @@
+(* Test various subtleties of the "subst" tactics *)
+
+(* Should proceed from left to right (see #4222) *)
+Goal forall x y, x = y -> x = 3 -> y = 2 -> x = y.
+intros.
+subst.
+change (3 = 2) in H1.
+change (3 = 3).
+Abort.
+
+(* Should work with "x = y" and "x = t" equations (see #4214, failed in 8.4) *)
+Goal forall x y, x = y -> x = 3 -> x = y.
+intros.
+subst.
+change (3 = 3).
+Abort.
+
+(* Should substitute cycles once, until a recursive equation is obtained *)
+(* (failed in 8.4) *)
+Goal forall x y, x = S y -> y = S x -> x = y.
+intros.
+subst.
+change (y = S (S y)) in H0.
+change (S y = y).
+Abort.
+
+(* A bug revealed by OCaml 4.03 warnings *)
+(* fixes in 4e3d464 and 89ec88f for v8.5, 4e3d4646 and 89ec88f1e for v8.6 *)
+Goal forall y, let x:=0 in y=x -> y=y.
+intros * H;
+(* This worked as expected *)
+subst.
+Fail clear H.
+Abort.
+
+Goal forall y, let x:=0 in x=y -> y=y.
+intros * H;
+(* Before the fix, this unfolded x instead of
+ substituting y and erasing H *)
+subst.
+Fail clear H.
+Abort.
diff --git a/test-suite/success/univers.v b/test-suite/success/univers.v
index e00701fb..269359ae 100644
--- a/test-suite/success/univers.v
+++ b/test-suite/success/univers.v
@@ -60,3 +60,20 @@ Qed.
(* Submitted by Danko Ilik (bug report #1507); related to LetIn *)
Record U : Type := { A:=Type; a:A }.
+
+(** Check assignement of sorts to inductives and records. *)
+
+Variable sh : list nat.
+
+Definition is_box_in_shape (b :nat * nat) := True.
+Definition myType := Type.
+
+Module Ind.
+Inductive box_in : myType :=
+ myBox (coord : nat * nat) (_ : is_box_in_shape coord) : box_in.
+End Ind.
+
+Module Rec.
+Record box_in : myType :=
+ BoxIn { coord :> nat * nat; _ : is_box_in_shape coord }.
+End Rec. \ No newline at end of file
diff --git a/test-suite/success/vm_univ_poly.v b/test-suite/success/vm_univ_poly.v
index 58fa3974..62df96c0 100644
--- a/test-suite/success/vm_univ_poly.v
+++ b/test-suite/success/vm_univ_poly.v
@@ -38,8 +38,8 @@ Definition _4 : sumbool_copy x = x :=
(* Polymorphic Inductive Types *)
Polymorphic Inductive poption@{i} (T : Type@{i}) : Type@{i} :=
-| PSome : T -> poption@{i} T
-| PNone : poption@{i} T.
+| PSome : T -> poption T
+| PNone : poption T.
Polymorphic Definition poption_default@{i} {T : Type@{i}} (p : poption@{i} T) (x : T) : T :=
match p with
@@ -49,7 +49,7 @@ Polymorphic Definition poption_default@{i} {T : Type@{i}} (p : poption@{i} T) (x
Polymorphic Inductive plist@{i} (T : Type@{i}) : Type@{i} :=
| pnil
-| pcons : T -> plist@{i} T -> plist@{i} T.
+| pcons : T -> plist T -> plist T.
Arguments pnil {_}.
Arguments pcons {_} _ _.
@@ -59,7 +59,7 @@ Polymorphic Definition pmap@{i j}
fix pmap (ls : plist@{i} T) : plist@{j} U :=
match ls with
| @pnil _ => @pnil _
- | @pcons _ l ls => @pcons@{j} U (f l) (pmap@{i j} ls)
+ | @pcons _ l ls => @pcons@{j} U (f l) (pmap ls)
end.
Universe Ubool.
@@ -75,7 +75,7 @@ Eval vm_compute in pmap (fun x => x -> Type) (pcons tbool (pcons (plist tbool) p
Polymorphic Inductive Tree@{i} (T : Type@{i}) : Type@{i} :=
| Empty
-| Branch : plist@{i} (Tree@{i} T) -> Tree@{i} T.
+| Branch : plist@{i} (Tree T) -> Tree T.
Polymorphic Definition pfold@{i u}
{T : Type@{i}} {U : Type@{u}} (f : T -> U -> U) :=
@@ -111,7 +111,7 @@ Polymorphic Fixpoint repeat@{i} {T : Type@{i}} (n : nat@{i}) (v : T) : plist@{i}
Polymorphic Fixpoint big_tree@{i} (n : nat@{i}) : Tree@{i} nat@{i} :=
match n with
| O => @Empty nat@{i}
- | S n' => Branch@{i} nat@{i} (repeat@{i} n' (big_tree@{i} n'))
+ | S n' => Branch@{i} nat@{i} (repeat@{i} n' (big_tree n'))
end.
Eval compute in height (big_tree (S (S (S O)))).
diff --git a/test-suite/typeclasses/open_constr.v b/test-suite/typeclasses/open_constr.v
new file mode 100644
index 00000000..5f1785c7
--- /dev/null
+++ b/test-suite/typeclasses/open_constr.v
@@ -0,0 +1,12 @@
+Tactic Notation "opose" open_constr(foo) := pose foo.
+Class Foo := Build_Foo : Set.
+Axiom f : forall `{Foo}, Set.
+Set Printing Implicit.
+Goal forall `{Foo}, True.
+Proof.
+ intro H.
+ pose f.
+ opose f.
+ Fail let x := (eval hnf in P) in has_evar x.
+ let x := (eval hnf in P0) in has_evar x.
+
diff --git a/test-suite/vio/print.v b/test-suite/vio/print.v
new file mode 100644
index 00000000..9c36a463
--- /dev/null
+++ b/test-suite/vio/print.v
@@ -0,0 +1,10 @@
+Lemma a : True.
+Proof.
+idtac.
+exact I.
+Qed.
+
+Print a.
+
+Lemma b : False.
+Admitted.