Skip to content

Commit

Permalink
do not use Pervasives anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 5, 2023
1 parent 870da3e commit 71798cc
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/core/Binder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let exists = Exists
let lambda = Lambda
let forall_ty = ForallTy

let compare (a:t) b = Pervasives.compare a b
let compare (a:t) b = CCShims_.Stdlib.compare a b
let equal (a:t) b = a=b
let hash (a:t) = Hashtbl.hash a

Expand Down
2 changes: 1 addition & 1 deletion src/core/Builtin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ module Tag = struct
| T_ac of ID.t (** AC symbols *)
| T_cannot_orphan

let compare = Pervasives.compare
let compare = CCShims_.Stdlib.compare

let pp out = function
| T_lia -> Fmt.string out "lia"
Expand Down
2 changes: 1 addition & 1 deletion src/core/Comparison.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
type t = Lt | Leq | Eq | Geq | Gt | Incomparable

type comparison = t
let equal : t -> t -> bool = Pervasives.(=)
let equal : t -> t -> bool = CCShims_.Stdlib.(=)

let to_string = function
| Lt -> "<"
Expand Down
2 changes: 1 addition & 1 deletion src/core/Dtree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let compare_char c1 c2 =
| Symbol s1, Symbol s2 -> ID.compare s1 s2
| Variable v1, Variable v2 -> compare_vars v1 v2
| Subterm t1, Subterm t2 -> T.compare t1 t2
| _ -> Pervasives.compare (char_to_int_ c1) (char_to_int_ c2)
| _ -> CCShims_.Stdlib.compare (char_to_int_ c1) (char_to_int_ c2)

let[@inline] eq_char c1 c2 = compare_char c1 c2 = 0

Expand Down
2 changes: 1 addition & 1 deletion src/core/ID.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let payload_pred ~f:p t =

let hash t = t.id
let equal i1 i2 = i1.id = i2.id
let compare i1 i2 = Pervasives.compare i1.id i2.id
let compare i1 i2 = CCShims_.Stdlib.compare i1.id i2.id

let pp out id = CCFormat.string out id.name
let to_string = CCFormat.to_string pp
Expand Down
2 changes: 1 addition & 1 deletion src/core/InnerTerm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ let[@inline] ty_exn t = match t.ty with

let[@inline] hash t = Hash.int t.id
let[@inline] equal : t -> t -> bool = fun t1 t2 -> t1 == t2
let[@inline] compare t1 t2 = Pervasives.compare t1.id t2.id
let[@inline] compare t1 t2 = CCShims_.Stdlib.compare t1.id t2.id

let rec same_l_rec l1 l2 = match l1, l2 with
| [], [] -> true
Expand Down
4 changes: 2 additions & 2 deletions src/core/Literal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let compare l1 l2 =
if c <> 0 then c else
let c = T.compare r1 r2 in
if c <> 0 then c else
Pervasives.compare sign1 sign2
CCShims_.Stdlib.compare sign1 sign2
| True, True
| False, False -> 0
| _, _ -> __to_int l1 - __to_int l2
Expand Down Expand Up @@ -718,7 +718,7 @@ module Comp = struct
| True -> 0
| Equation _ -> 30
in
C.of_total (Pervasives.compare (_to_int l1) (_to_int l2))
C.of_total (CCShims_.Stdlib.compare (_to_int l1) (_to_int l2))

(* by multiset of terms *)
let _cmp_by_term_multiset ~ord l1 l2 =
Expand Down
2 changes: 1 addition & 1 deletion src/core/Literals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ let neg lits =
module MLI = Multiset.Make(struct
type t = Lit.t * int
let compare (l1,i1)(l2,i2) =
if i1 = i2 then Lit.compare l1 l2 else Pervasives.compare i1 i2
if i1 = i2 then Lit.compare l1 l2 else CCShims_.Stdlib.compare i1 i2
end)

let _compare_lit_with_idx ~ord (lit1,i1) (lit2,i2) =
Expand Down
2 changes: 1 addition & 1 deletion src/core/Ordering.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ module LambdaKBO : ORD = struct

module WH = CCHashtbl.Make(struct
type t = W.t
let equal = Pervasives.(=)
let equal = CCShims_.Stdlib.(=)
let hash = W.hash
end)

Expand Down
2 changes: 1 addition & 1 deletion src/core/Position.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let head pos = Head pos
let arg i pos = Arg (i, pos)
let body pos = Body pos

let compare = Pervasives.compare
let compare = CCShims_.Stdlib.compare
let equal p1 p2 = compare p1 p2 = 0
let hash p = Hashtbl.hash p

Expand Down
4 changes: 2 additions & 2 deletions src/core/STerm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let to_int_ = function
| With _ -> 12

let rec compare t1 t2 = match t1.term, t2.term with
| Var s1, Var s2 -> Pervasives.compare s1 s2
| Var s1, Var s2 -> CCShims_.Stdlib.compare s1 s2
| Const s1, Const s2 -> String.compare s1 s2
| App (s1,l1), App (s2, l2) ->
let c = compare s1 s2 in
Expand Down Expand Up @@ -109,7 +109,7 @@ and compare_typed_var (v1,o1)(v2,o2) =
let cmp = compare in
CCOrd.( compare_var v1 v2 <?> (Util.ord_option cmp, o1, o2) )

and compare_var : var CCOrd.t = Pervasives.compare
and compare_var : var CCOrd.t = CCShims_.Stdlib.compare

let equal t1 t2 = compare t1 t2 = 0

Expand Down
2 changes: 1 addition & 1 deletion src/core/Scoped.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let map f (v,i) : _ t = (f v, i)
let[@inline] equal eq (v1:_ t) (v2:_ t) : bool = scope v1 = scope v2 && eq (get v1) (get v2)
let compare c v1 v2 =
if scope v1 = scope v2 then c (get v1) (get v2)
else Pervasives.compare (scope v1) (scope v2)
else CCShims_.Stdlib.compare (scope v1) (scope v2)

let hash f (v,sc) = Hash.combine2 (Hash.int sc) (f v)

Expand Down
2 changes: 1 addition & 1 deletion src/core/Statement.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module OptionSet = Set.Make(
struct
let compare x y = Pervasives.compare x y
let compare x y = CCShims_.Stdlib.compare x y
type t = int option
end)

Expand Down
2 changes: 1 addition & 1 deletion src/parsers/trace_tstp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let hash p = match p with
| InferForm (_, lazy s)
| InferClause (_, lazy s) -> Hashtbl.hash s.id

let compare p1 p2 = Pervasives.compare p1 p2 (* FIXME *)
let compare p1 p2 = CCShims_.Stdlib.compare p1 p2 (* FIXME *)

(** {2 Constructors and utils} *)

Expand Down
2 changes: 1 addition & 1 deletion src/prover/SClause.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let make ~trail lits =
{ lits; trail; id; flags=0; }

let[@inline] equal c1 c2 = c1.id = c2.id
let[@inline] compare c1 c2 = Pervasives.compare c1.id c2.id
let[@inline] compare c1 c2 = CCShims_.Stdlib.compare c1.id c2.id
let[@inline] id c = c.id
let[@inline] hash c = Hash.int c.id
let[@inline] lits c = c.lits
Expand Down
2 changes: 1 addition & 1 deletion src/prover/stream.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module Make(A:ARG) = struct
()

let equal s1 s2 = s1.id = s2.id
let compare s1 s2 = Pervasives.compare s1.id s2.id
let compare s1 s2 = CCShims_.Stdlib.compare s1.id s2.id
let id s = s.id
let hash s = Hashtbl.hash s.id

Expand Down
2 changes: 1 addition & 1 deletion src/tools/cnf_of.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let options =
; "--time-limit", Arg.Int Util.set_time_limit, " hard time limit (in s)"
; "--print-input", Arg.Set print_in, " print input problem"
] @ Options.make ()
|> List.sort Pervasives.compare
|> List.sort CCShims_.Stdlib.compare
|> Arg.align

let print_res (decls: _ CCVector.ro_vector) : unit =
Expand Down
2 changes: 1 addition & 1 deletion src/tools/problem_features.ml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ let cnf_features = ref true
let options =
[ "--cnf-features", Arg.Bool ((:=) cnf_features), " clausify the problem and include CNF features"] @
Options.make ()
|> List.sort Pervasives.compare
|> List.sort CCShims_.Stdlib.compare
|> Arg.align

(* process the given file, converting it to CNF *)
Expand Down

0 comments on commit 71798cc

Please sign in to comment.