Skip to content

Commit 58b4d4d

Browse files
committed
adapt zipperposition to deprecated functions/modules (CCArray.create, Pervasives); testTerm: add test_patterns because test_whnf2 was defined twice; fix warning 6 (missing label) and warning 39 (unused rec)
1 parent de7884e commit 58b4d4d

11 files changed

+17
-16
lines changed

src/prover/AC.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ module Make(Env : Env.S) : S with module Env = Env = struct
242242
)
243243

244244
let register_ac c id ty =
245-
add (C.proof_parent c) id ty
245+
add ~proof:(C.proof_parent c) id ty
246246

247247
let scan_clause c =
248248
let exception Fail in

src/prover/clause.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module Make(Ctx : Ctx.S) : S with module Ctx = Ctx = struct
111111
(* create the structure *)
112112
let ord = Ctx.ord () in
113113
let max_lits = lazy ( BV.to_list @@ Lits.maxlits sclause.lits ~ord ) in
114-
let rec c = {
114+
let c = {
115115
sclause;
116116
penalty;
117117
selected;

src/prover/clauseQueue.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ module Make(C : Clause_intf.S) = struct
386386
w_diff_l args1 args2
387387
| T.Fun(ty1, body1), T.Fun(ty2, body2)
388388
when Type.equal ty1 ty2 && Type.equal (T.ty body1) (T.ty body2) ->
389-
w_diff body1 body2
389+
w_diff ~given_term:body1 ~conj_term:body2
390390
| _, _ ->
391391
int_of_float (inst_penalty *. (w conj_term) +. gen_penalty *. (w given_term))
392392
and w_diff_l xs ys =

src/prover/env.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ module Make(X : sig
806806
match rules with
807807
| [] -> None
808808
| r :: rs ->
809-
CCOpt.or_lazy ~else_:(fun () -> apply_rules rs c) (r c) in
809+
CCOpt.or_lazy ~else_:(fun () -> apply_rules ~rules:rs c) (r c) in
810810

811811
let q = Queue.create () in
812812
Queue.add c q;

src/prover/eprover_interface.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module Make(E : Env.S) : S with module Env = E = struct
5757
let output_empty_conj ~out =
5858
Format.fprintf out "thf(conj,conjecture,($false))."
5959

60-
let rec encode_ty_args_t ~encoded_symbols t =
60+
let encode_ty_args_t ~encoded_symbols t =
6161
let make_new_sym mono_head =
6262
if not (T.is_ground mono_head) then (
6363
let err =

src/prover_calculi/Higher_order.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1719,9 +1719,9 @@ module Make(E : Env.S) : S with module Env = E = struct
17191719
when Type.is_var (T.ty t) && not is_poly_arg_cong_res ->
17201720
(* A polymorphic variable might be functional on the ground level *)
17211721
let ty_args =
1722-
OSeq.iterate [Type.var @@ HVar.fresh ~ty:Type.tType ()]
1723-
(fun types_w ->
1724-
Type.var (HVar.fresh ~ty:Type.tType ()) :: types_w) in
1722+
OSeq.iterate (fun types_w ->
1723+
Type.var (HVar.fresh ~ty:Type.tType ()) :: types_w)
1724+
[Type.var @@ HVar.fresh ~ty:Type.tType ()] in
17251725
let res =
17261726
ty_args
17271727
|> OSeq.mapi (fun arrarg_idx arrow_args ->

src/prover_calculi/app_encode.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ let rec app_encode_term toplevel t =
151151
(** Encode a literal *)
152152
let app_encode_lit lit =
153153
Util.debugf ~section 2 "# Encoding Literal %a" (fun k -> k (SLiteral.pp T.pp) lit);
154-
SLiteral.map (app_encode_term true) lit
154+
SLiteral.map ~f:(app_encode_term true) lit
155155

156156
(** Encode a clause *)
157157
let app_encode_lits lits = List.map app_encode_lit lits
@@ -257,4 +257,4 @@ let options =
257257

258258
let () =
259259
Options.add_opts
260-
[ "--app-encode", Arg.Symbol (List.map fst options, fun o -> mode_ := List.assoc o options), " enable applicative encoding"]
260+
[ "--app-encode", Arg.Symbol (List.map fst options, fun o -> mode_ := List.assoc o options), " enable applicative encoding"]

src/prover_calculi/bool_encode.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ let bool_encode_lit lit =
325325
assert(T.equal (T.ty_exn true_term) (T.ty_exn encoded_atom));
326326
mk_equ_lit (bool_encode_term atom) true_term
327327
| Eq _ | Neq _ ->
328-
SLiteral.map bool_encode_term lit
328+
SLiteral.map ~f:bool_encode_term lit
329329

330330
(** Encode a clause *)
331331
let bool_encode_lits lits = List.map bool_encode_lit lits
@@ -413,4 +413,4 @@ let extension =
413413

414414
let () =
415415
Options.add_opts
416-
[ "--encode-booleans", Arg.Bool ((:=) enabled_), " enable encoding of booleans into a fresh type"]
416+
[ "--encode-booleans", Arg.Bool ((:=) enabled_), " enable encoding of booleans into a fresh type"]

src/prover_calculi/lazy_cnf.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ module Make(E : Env.S) : S with module Env = E = struct
131131

132132
let arg_combinations = CCList.cartesian_product arg_ms in
133133
let arg_comb_num = List.fold_left (fun acc a -> acc * (List.length a)) 1 arg_ms in
134-
let fun_table = CCArray.create arg_comb_num (List.hd ret_m) in
134+
let fun_table = CCArray.make arg_comb_num (List.hd ret_m) in
135135

136136
let iter_funs () =
137137
let rec aux i k =

tests/testMultiset.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Q = QCheck
44

55
module M = Multiset.Make(struct
66
type t = int
7-
let compare i j=Pervasives.compare i j
7+
let compare i j=Stdlib.compare i j
88
end)
99

1010
(* for testing *)
@@ -146,7 +146,7 @@ let max_is_max =
146146
let gen = Q.(map M.of_list (list small_int)) in
147147
let gen = Q.set_print pp gen in
148148
let prop m =
149-
let f x y = Comparison.of_total (Pervasives.compare x y) in
149+
let f x y = Comparison.of_total (Stdlib.compare x y) in
150150
let l = M.max f m |> M.to_list |> List.map fst in
151151
List.for_all (fun x -> M.is_max f x m) l
152152
in

tests/testTerm.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ let test_whnf2 = "whnf2", `Quick, fun () ->
110110
Alcotest.(check t_test) "whnf2" t1 t';
111111
()
112112

113-
let test_whnf2 = "patterns", `Quick, fun () ->
113+
let test_patterns = "patterns", `Quick, fun () ->
114114
let t1 = f (g a) (g b) in
115115
let t2 = T.fun_ ty (f (T.bvar ~ty 0) (g (T.bvar ~ty 1))) in
116116
let t3 = T.fun_ ty (f (fun_var (T.bvar ~ty 0) (T.bvar ~ty 1)) (g (T.bvar ~ty 1))) in
@@ -207,6 +207,7 @@ let suite : unit Alcotest.test_case list =
207207
test_app_var;
208208
test_whnf1;
209209
test_whnf2;
210+
test_patterns;
210211
test_polymorphic_app;
211212
test_eta_reduce;
212213
test_eta_expand;

0 commit comments

Comments
 (0)