Skip to content

Commit

Permalink
Minor patch for 4.08 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Gbury committed Oct 16, 2023
1 parent 65af097 commit baaf1f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/standard/misc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ let rec print_list ~print_sep ~sep ~print fmt = function
print h print_sep sep
(print_list ~print_sep ~sep ~print) r

let list_concat_map f l =
let rec aux f acc = function
| [] -> List.rev acc
| x :: l ->
let xs = f x in
aux f (List.rev_append xs acc) l
in aux f [] l


(* Iteration *)
(* ************************************************************************* *)
Expand Down
2 changes: 2 additions & 0 deletions src/standard/misc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ val print_list :
val foldn : int -> ('a -> 'a) -> 'a -> 'a
(** Applies the given function [n] times. *)

val list_concat_map : ('a -> 'b list) -> 'a list -> 'b list
(** Same as {List.concat_map} (which is not available on ocaml.4.08). *)

(** {2 Lexbuf helpers} *)

Expand Down
2 changes: 1 addition & 1 deletion src/standard/statement.ml
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ let cnf ?loc ?annot id role t =
match t with
| { Term.term = Term.App
({ Term.term = Term.Builtin Term.Or; _ }, l); _ } ->
List.concat_map split_or l
Misc.list_concat_map split_or l
| _ -> [t]
in
tptp ?loc ?annot "cnf" id role (`Clause (split_or t))
Expand Down

0 comments on commit baaf1f9

Please sign in to comment.