File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ - **Fixed: **
2+ extraction of primitive array literals
3+ (`#22457 <https://github.com/rocq-prover/rocq/pull/22457 >`_,
4+ fixes `#22365 <https://github.com/rocq-prover/rocq/issues/22365 >`_,
5+ by Gaëtan Gilbert).
Original file line number Diff line number Diff line change @@ -63,11 +63,6 @@ let pp_boxed_tuple f = function
6363 | [x] -> f x
6464 | l -> pp_par true (hov 0 (prlist_with_sep (fun () -> str " ," ++ spc () ) f l))
6565
66- let pp_array f = function
67- | [] -> mt ()
68- | [x] -> f x
69- | l -> pp_par true (prlist_with_sep (fun () -> str " ;" ++ spc () ) f l)
70-
7166(* * By default, in module Format, you can do horizontal placing of blocks
7267 even if they include newlines, as long as the number of chars in the
7368 blocks is less that a line length. To avoid this awkward situation,
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ val pp_apply2 : Pp.t -> bool -> Pp.t list -> Pp.t
3030
3131val pp_tuple_light : (bool -> 'a -> Pp .t ) -> 'a list -> Pp .t
3232val pp_tuple : ('a -> Pp .t ) -> 'a list -> Pp .t
33- val pp_array : ('a -> Pp .t ) -> 'a list -> Pp .t
3433val pp_boxed_tuple : ('a -> Pp .t ) -> 'a list -> Pp .t
3534
3635val pr_binding : Id .t list -> Pp .t
Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ let rec pp_expr table par env args =
326326 str " (" ++ str (Pstring. compile s) ++ str " )"
327327 | MLparray (t ,def ) ->
328328 assert (args= [] );
329- let tuple = pp_array (pp_expr table true env [] ) (Array. to_list t) in
329+ let tuple = prlist_with_sep pr_semicolon (pp_expr table true env [] ) (Array. to_list t) in
330330 let def = pp_expr table true env [] def in
331331 str " (ExtrNative.of_array [|" ++ tuple ++ str " |]" ++ spc () ++ def ++ str" )"
332332
Original file line number Diff line number Diff line change 1+ File "./output/bug_22365.v", line 5, characters 0-17:
2+ Warning: The following axiom must be realized in the extracted code:
3+ array.
4+ [extraction-axiom-to-realize,extraction,default]
5+ (** val a3lit : nat array **)
6+
7+ let a3lit =
8+ (ExtrNative.of_array [|O; (S O); (S (S O))|] (S (S (S (S O)))))
Original file line number Diff line number Diff line change 1+ From Corelib Require Import Array.PrimArray Numbers.Cyclic.Int63.PrimInt63 extraction.Extraction .
2+
3+ Definition a3lit : PrimArray.array nat := [|0; 1; 2 | 4|].
4+
5+ Extraction a3lit.
You can’t perform that action at this time.
0 commit comments