Skip to content

Commit 51a7efe

Browse files
authored
Merge pull request #3 from codewars/coq8.11
Support Coq 8.11
2 parents 9d1f6b7 + 6a082fe commit 51a7efe

File tree

5 files changed

+39
-27
lines changed

5 files changed

+39
-27
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
*.d
66
/Makefile
77
Makefile.conf
8+
g_coq_cw.ml
89
.merlin
910
*.vo
11+
*.vok
12+
*.vos
1013
*.glob
1114
*.aux
1215
*.cmi

_CoqProject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ theories/Loader.v
55

66
src/coq_cw.ml
77
src/coq_cw.mli
8-
src/g_coq_cw.ml4
8+
src/g_coq_cw.mlg
99
src/coq_cw_plugin.mlpack

src/coq_cw.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let locate_constant r =
9292
try
9393
let gr = Smartlocate.locate_global_with_alias r in
9494
match gr with
95-
| Globnames.ConstRef cst -> cst
95+
| Names.GlobRef.ConstRef cst -> cst
9696
| _ -> CErrors.user_err (str "A constant is expected: " ++ Printer.pr_global gr)
9797
with Not_found -> CErrors.user_err (str "Not found: " ++ Libnames.pr_qualid r)
9898

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,73 @@
11
DECLARE PLUGIN "coq_cw_plugin"
22

3+
{
4+
35
open Stdarg
46

7+
}
8+
59
VERNAC COMMAND EXTEND CWAssertType CLASSIFIED AS QUERY
6-
| [ "CWAssert" string_opt(msg) ref(r) ":" constr(ty)] -> [
10+
| [ "CWAssert" string_opt(msg) ref(r) ":" constr(ty)] -> {
711
Coq_cw.test_type ?msg r ty
8-
]
12+
}
913
END
1014

1115
VERNAC COMMAND EXTEND CWAssertAssumptions CLASSIFIED AS QUERY
12-
| [ "CWAssert" string_opt(msg) ref(e) "Assumes" ref_list(axioms)] -> [
16+
| [ "CWAssert" string_opt(msg) ref(e) "Assumes" ref_list(axioms)] -> {
1317
Coq_cw.test_axioms ?msg e axioms
14-
]
18+
}
1519
END
1620

1721
VERNAC COMMAND EXTEND CWStopOnFailure CLASSIFIED AS SIDEFF
18-
| [ "CWStopOnFailure" int(flag)] -> [
22+
| [ "CWStopOnFailure" int(flag)] -> {
1923
Coq_cw.stop_on_failure flag
20-
]
24+
}
2125
END
2226

2327
VERNAC COMMAND EXTEND CWGroup CLASSIFIED AS SIDEFF
24-
| [ "CWGroup" string(msg)] -> [
28+
| [ "CWGroup" string(msg)] -> {
2529
Coq_cw.begin_group "DESCRIBE" msg
26-
]
30+
}
2731
END
2832

2933
VERNAC COMMAND EXTEND CWEndGroup CLASSIFIED AS SIDEFF
30-
| [ "CWEndGroup"] -> [
34+
| [ "CWEndGroup"] -> {
3135
Coq_cw.end_group "DESCRIBE"
32-
]
36+
}
3337
END
3438

3539
VERNAC COMMAND EXTEND CWTest CLASSIFIED AS SIDEFF
36-
| [ "CWTest" string(msg)] -> [
40+
| [ "CWTest" string(msg)] -> {
3741
Coq_cw.begin_group "IT" msg
38-
]
42+
}
3943
END
4044

4145
VERNAC COMMAND EXTEND CWEndTest CLASSIFIED AS SIDEFF
42-
| [ "CWEndTest"] -> [
46+
| [ "CWEndTest"] -> {
4347
Coq_cw.end_group "IT"
44-
]
48+
}
4549
END
4650

4751
VERNAC COMMAND EXTEND CWFileSize CLASSIFIED AS QUERY
48-
| [ "CWFile" string_opt(fname) "Size" "<" int(size)] -> [
52+
| [ "CWFile" string_opt(fname) "Size" "<" int(size)] -> {
4953
Coq_cw.test_file_size ?fname size
50-
]
54+
}
5155
END
5256

5357
VERNAC COMMAND EXTEND CWFileMatch CLASSIFIED AS QUERY
54-
| [ "CWFile" string_opt(fname) "Matches" string(regex)] -> [
58+
| [ "CWFile" string_opt(fname) "Matches" string(regex)] -> {
5559
Coq_cw.test_file_regex ?fname true regex
56-
]
60+
}
5761
END
5862

5963
VERNAC COMMAND EXTEND CWFileNegMatch CLASSIFIED AS QUERY
60-
| [ "CWFile" string_opt(fname) "Does" "Not" "Match" string(regex)] -> [
64+
| [ "CWFile" string_opt(fname) "Does" "Not" "Match" string(regex)] -> {
6165
Coq_cw.test_file_regex ?fname false regex
62-
]
66+
}
6367
END
6468

65-
VERNAC COMMAND EXTEND CWCompileAndRun CLASSIFIED AS SIDEFF
66-
| [ "CWCompileAndRun" string_list(files) "Options" string_opt(options) "Driver" string(driver) ] -> [
69+
VERNAC COMMAND EXTEND CWCompileAndRun CLASSIFIED AS QUERY
70+
| [ "CWCompileAndRun" string_list(files) "Options" string_opt(options) "Driver" string(driver) ] -> {
6771
Coq_cw.compile_and_run files ?options driver
68-
]
72+
}
6973
END

theories/Demo2.v

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,17 @@ Print Assumptions sqrt_pos.
5252
CWGroup "Real numbers".
5353

5454
Fail CWAssert sqrt_pos Assumes.
55-
CWAssert "Real Number Axioms" sqrt_pos Assumes
55+
CWAssert "Real Number Axioms (Dedekind)" sqrt_pos Assumes
56+
ClassicalDedekindReals.sig_not_dec
57+
ClassicalDedekindReals.sig_forall_dec
58+
functional_extensionality_dep.
59+
60+
(* CWAssert "Real Number Axioms" sqrt_pos Assumes
5661
R R0 R1 Rplus Rmult Ropp Rinv Rlt up
5762
Rplus_comm Rplus_assoc Rplus_opp_r Rplus_0_l
5863
Rmult_comm Rmult_assoc Rinv_l Rmult_1_l R1_neq_R0
5964
Rmult_plus_distr_l total_order_T
6065
Rlt_asym Rlt_trans Rplus_lt_compat_l Rmult_lt_compat_l
61-
archimed completeness.
66+
archimed completeness. *)
6267

6368
CWEndGroup.

0 commit comments

Comments
 (0)