forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the example referenced in issue ocaml#3437.
- Loading branch information
Showing
10 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
test/blackbox-tests/test-cases/coq-extraction/Bug_Coq.opam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
synopsis: "Coq files" | ||
depends: [ | ||
"dune" {>= "2.5"} | ||
] | ||
build: [ | ||
["dune" "subst"] {pinned} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
] |
20 changes: 20 additions & 0 deletions
20
test/blackbox-tests/test-cases/coq-extraction/Bug_OCaml.opam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
synopsis: "OCaml files" | ||
depends: [ | ||
"dune" {>= "2.5"} | ||
] | ||
build: [ | ||
["dune" "subst"] {pinned} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
-arg -w -arg -notation-overridden | ||
-arg -w -arg -abstract-large-number | ||
|
||
-R _build/default/theories Bug_Coq |
14 changes: 14 additions & 0 deletions
14
test/blackbox-tests/test-cases/coq-extraction/dune-project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(lang dune 2.5) | ||
(using coq 0.2) | ||
(name Bug_Coq) | ||
|
||
(generate_opam_files true) | ||
|
||
(package | ||
(name Bug_Coq) | ||
(synopsis "Coq files")) | ||
|
||
(package | ||
(name Bug_OCaml) | ||
(synopsis "OCaml files")) | ||
|
5 changes: 5 additions & 0 deletions
5
test/blackbox-tests/test-cases/coq-extraction/src/Bug_OCaml.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
let _ = | ||
ignore Extract.v ; | ||
print_endline "OK" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(executable | ||
(name Bug_OCaml) | ||
(modes (best exe))) | ||
|
||
; (install | ||
; (package Bug_OCaml) | ||
; (section bin) | ||
; (files (bug.exe as bug))) | ||
|
||
(coq.extraction | ||
(theories Bug_Coq) | ||
(prelude extraction) | ||
(extracted_modules Extract)) | ||
|
8 changes: 8 additions & 0 deletions
8
test/blackbox-tests/test-cases/coq-extraction/src/extraction.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
Require Import Extraction. | ||
From Bug_Coq Require Import value common. | ||
|
||
Extraction Language OCaml. | ||
|
||
Extraction "Extract" v. | ||
|
15 changes: 15 additions & 0 deletions
15
test/blackbox-tests/test-cases/coq-extraction/theories/common.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
Require Import Ascii. | ||
|
||
Axiom axiom : Prop. | ||
Axiom axiom_valid : axiom. | ||
|
||
Lemma test : forall a b, eqb a b = eqb b a. | ||
Proof. | ||
intros. destruct (eqb a b) eqn: E. | ||
- rewrite eqb_eq in E. symmetry. now rewrite eqb_eq. | ||
- rewrite eqb_neq in E. symmetry. rewrite eqb_neq. now auto. | ||
Qed. | ||
|
||
Definition v2 := 18. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(coq.theory | ||
(name Bug_Coq) | ||
(package Bug_Coq)) | ||
|
15 changes: 15 additions & 0 deletions
15
test/blackbox-tests/test-cases/coq-extraction/theories/value.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
Set Implicit Arguments. | ||
Require Export common. | ||
|
||
Definition k (A B : Type) (_ : A) (b : B) := b. | ||
|
||
Definition v3 := k axiom_valid v2. | ||
|
||
Definition v : nat. | ||
Proof. | ||
eapply k. | ||
- exact test. | ||
- exact v3. | ||
Defined. | ||
|