Skip to content

Commit f3c754c

Browse files
committed
Stdcompat and other fixes
1 parent e25f82b commit f3c754c

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

src/lib/reasoners/intervals.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(**************************************************************************)
22
(* *)
33
(* Alt-Ergo: The SMT Solver For Software Verification *)
4-
(* Copyright (C) 2024 --- OCamlPro SAS *)
4+
(* Copyright (C) 2013-2023 --- OCamlPro SAS *)
55
(* *)
66
(* This file is distributed under the terms of OCamlPro *)
77
(* Non-Commercial Purpose License, version 1. *)
@@ -19,6 +19,9 @@
1919
(* *)
2020
(* CNRS - INRIA - Universite Paris Sud *)
2121
(* *)
22+
(* Until 2013, some parts of this code were released under *)
23+
(* the Apache Software License version 2.0. *)
24+
(* *)
2225
(* --------------------------------------------------------------- *)
2326
(* *)
2427
(* More details can be found in the directory licenses/ *)
@@ -1030,5 +1033,5 @@ module DebugExplanations : Explanations with type t = string list = struct
10301033
List.rev_append l1 l2 |> List.sort_uniq String.compare
10311034

10321035
let compare l1 l2 =
1033-
List.compare String.compare l1 l2
1036+
Stdcompat.List.compare String.compare l1 l2
10341037
end

src/lib/reasoners/intervals.mli

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(**************************************************************************)
22
(* *)
33
(* Alt-Ergo: The SMT Solver For Software Verification *)
4-
(* Copyright (C) 2024 --- OCamlPro SAS *)
4+
(* Copyright (C) 2013-2023 --- OCamlPro SAS *)
55
(* *)
66
(* This file is distributed under the terms of OCamlPro *)
77
(* Non-Commercial Purpose License, version 1. *)
@@ -19,6 +19,9 @@
1919
(* *)
2020
(* CNRS - INRIA - Universite Paris Sud *)
2121
(* *)
22+
(* Until 2013, some parts of this code were released under *)
23+
(* the Apache Software License version 2.0. *)
24+
(* *)
2225
(* --------------------------------------------------------------- *)
2326
(* *)
2427
(* More details can be found in the directory licenses/ *)
@@ -93,14 +96,14 @@ module Legacy : sig
9396

9497
val affine_scale : const:Numbers.Q.t -> coef:Numbers.Q.t -> t -> t
9598
(** Perform an affine transformation on the given bounds.
96-
Suposing input bounds (b1, b2), this will return
99+
Supposing input bounds (b1, b2), this will return
97100
(const + coef * b1, const + coef * b2).
98101
This function is useful to avoid the incorrect roundings that
99102
can take place when scaling down an integer range. *)
100103

101-
val pretty_print : Format.formatter -> t -> unit
104+
val pretty_print : t Fmt.t
102105

103-
val print : Format.formatter -> t -> unit
106+
val print : t Fmt.t
104107

105108
val finite_size : t -> Numbers.Q.t option
106109

@@ -134,7 +137,7 @@ module Legacy : sig
134137
val equal : t -> t -> bool
135138

136139
val pick : is_max:bool -> t -> Numbers.Q.t
137-
(** [pick ~is_max t] returns an elements of the set of intervals [t]. If
140+
(** [pick ~is_max t] returns an element of the union of intervals [t]. If
138141
[is_max] is [true], we pick the largest element of [t], if it exists.
139142
We look for the smallest element if [is_max] is [false]. *)
140143

src/lib/reasoners/intervals_core.ml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(**************************************************************************)
22
(* *)
33
(* Alt-Ergo: The SMT Solver For Software Verification *)
4-
(* Copyright (C) 2024 --- OCamlPro SAS *)
4+
(* Copyright (C) 2013-2023 --- OCamlPro SAS *)
55
(* *)
66
(* This file is distributed under the terms of OCamlPro *)
77
(* Non-Commercial Purpose License, version 1. *)
@@ -19,6 +19,9 @@
1919
(* *)
2020
(* CNRS - INRIA - Universite Paris Sud *)
2121
(* *)
22+
(* Until 2013, some parts of this code were released under *)
23+
(* the Apache Software License version 2.0. *)
24+
(* *)
2225
(* --------------------------------------------------------------- *)
2326
(* *)
2427
(* More details can be found in the directory licenses/ *)
@@ -30,16 +33,16 @@ open Intervals_intf
3033
(** Pretty-printer for a bound when used as a lower bound. *)
3134
let pp_lower_bound pp_a ppf lb =
3235
match lb with
33-
| Unbounded -> Format.fprintf ppf "]-oo"
34-
| Open x -> Format.fprintf ppf "]%a" pp_a x
35-
| Closed x -> Format.fprintf ppf "[%a" pp_a x
36+
| Unbounded -> Fmt.pf ppf "]-oo"
37+
| Open x -> Fmt.pf ppf "]%a" pp_a x
38+
| Closed x -> Fmt.pf ppf "[%a" pp_a x
3639

3740
(** Pretty-printer for a bound when used as an upper bound. *)
3841
let pp_upper_bound pp_a ppf ub =
3942
match ub with
40-
| Unbounded -> Format.fprintf ppf "+oo["
41-
| Open x -> Format.fprintf ppf "%a[" pp_a x
42-
| Closed x -> Format.fprintf ppf "%a]" pp_a x
43+
| Unbounded -> Fmt.pf ppf "+oo["
44+
| Open x -> Fmt.pf ppf "%a[" pp_a x
45+
| Closed x -> Fmt.pf ppf "%a]" pp_a x
4346

4447
module EqLtLeNotations(OT : OrderedType) = struct
4548
(** This module contains convenient redefinitions of [=], [<], [<=], [min] and
@@ -64,7 +67,7 @@ module Interval(OT : OrderedType) = struct
6467
type t = OT.t interval
6568

6669
let pp ppf i =
67-
Format.fprintf ppf "@[%a;@ %a@]"
70+
Fmt.pf ppf "@[%a;@ %a@]"
6871
(pp_lower_bound OT.pp_finite) (OT.view i.lb)
6972
(pp_upper_bound OT.pp_finite) (OT.view i.ub)
7073

src/lib/reasoners/intervals_core.mli

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(**************************************************************************)
22
(* *)
33
(* Alt-Ergo: The SMT Solver For Software Verification *)
4-
(* Copyright (C) 2024 --- OCamlPro SAS *)
4+
(* Copyright (C) 2013-2023 --- OCamlPro SAS *)
55
(* *)
66
(* This file is distributed under the terms of OCamlPro *)
77
(* Non-Commercial Purpose License, version 1. *)
@@ -19,6 +19,9 @@
1919
(* *)
2020
(* CNRS - INRIA - Universite Paris Sud *)
2121
(* *)
22+
(* Until 2013, some parts of this code were released under *)
23+
(* the Apache Software License version 2.0. *)
24+
(* *)
2225
(* --------------------------------------------------------------- *)
2326
(* *)
2427
(* More details can be found in the directory licenses/ *)

src/lib/reasoners/intervals_intf.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(**************************************************************************)
22
(* *)
33
(* Alt-Ergo: The SMT Solver For Software Verification *)
4-
(* Copyright (C) 2024 --- OCamlPro SAS *)
4+
(* Copyright (C) 2013-2023 --- OCamlPro SAS *)
55
(* *)
66
(* This file is distributed under the terms of OCamlPro *)
77
(* Non-Commercial Purpose License, version 1. *)
@@ -19,6 +19,9 @@
1919
(* *)
2020
(* CNRS - INRIA - Universite Paris Sud *)
2121
(* *)
22+
(* Until 2013, some parts of this code were released under *)
23+
(* the Apache Software License version 2.0. *)
24+
(* *)
2225
(* --------------------------------------------------------------- *)
2326
(* *)
2427
(* More details can be found in the directory licenses/ *)

0 commit comments

Comments
 (0)