File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ Definition ident := positive.
31
31
32
32
Definition ident_eq := peq.
33
33
34
+ Parameter string_of_ident: ident -> string.
35
+
34
36
(** The intermediate languages are weakly typed, using the following types: *)
35
37
36
38
Inductive typ : Type :=
Original file line number Diff line number Diff line change @@ -4,9 +4,6 @@ Require Import AST.
4
4
Require Import Maps.
5
5
Require Import String.
6
6
7
- Axiom ident_to_string: ident -> string.
8
- Axiom pos_to_string: positive -> string.
9
-
10
7
(** * Interface *)
11
8
12
9
(** This is the interface of the memory block namespace. There should
@@ -63,6 +60,11 @@ End BlockType.
63
60
64
61
(** * Implementation *)
65
62
63
+ (** We get some help from the Ocaml code to convert dynamic block
64
+ identifiers into strings. *)
65
+
66
+ Parameter string_of_pos: positive -> string.
67
+
66
68
(** Block names are implemented as the disjoint union of [AST.ident]
67
69
and dynamically allocated [positive]. *)
68
70
@@ -218,8 +220,8 @@ Module Block : BlockType.
218
220
219
221
Definition to_string (b: t): string :=
220
222
match b with
221
- | glob_def i => append "glob:" (ident_to_string i)
222
- | dyn b => append "dyn:" (pos_to_string b)
223
+ | glob_def i => append "glob:" (string_of_ident i)
224
+ | dyn b => append "dyn:" (string_of_pos b)
223
225
end .
224
226
225
227
Lemma ident_of_glob i:
Original file line number Diff line number Diff line change @@ -36,12 +36,6 @@ Require Parser.
36
36
Require Initializers.
37
37
Require Int31.
38
38
39
-
40
- Extract Inlined Constant BlockNames.ident_to_string =>
41
- "(fun i -> Camlcoq.coqstring_of_camlstring (Camlcoq.extern_atom i))".
42
- Extract Inlined Constant BlockNames.pos_to_string =>
43
- "(fun p -> Camlcoq.coqstring_of_camlstring (Printf.sprintf ""%ld"" (Camlcoq.P.to_int32 p)))".
44
-
45
39
(* Standard lib *)
46
40
Require Import ExtrOcamlBasic.
47
41
Require Import ExtrOcamlString.
@@ -68,6 +62,14 @@ Extraction NoInline Memory.Mem.valid_pointer.
68
62
(* Errors *)
69
63
Extraction Inline Errors.bind Errors.bind2.
70
64
65
+ (* AST *)
66
+ Extract Inlined Constant AST.string_of_ident =>
67
+ "(fun i -> Camlcoq.coqstring_of_camlstring (Camlcoq.extern_atom i))".
68
+
69
+ (* BlockNames *)
70
+ Extract Inlined Constant BlockNames.string_of_pos =>
71
+ "(fun p -> Camlcoq.coqstring_of_camlstring (Printf.sprintf ""%ld"" (Camlcoq.P.to_int32 p)))".
72
+
71
73
(* Iteration *)
72
74
73
75
Extract Constant Iteration.GenIter.iterate =>
You can’t perform that action at this time.
0 commit comments