Skip to content

Commit

Permalink
adapt zipperposition to deprecated functions/modules (CCArray.create,…
Browse files Browse the repository at this point in the history
… Pervasives); testTerm: add test_patterns because test_whnf2 was defined twice; fix warning 6 (missing label) and warning 39 (unused rec)
  • Loading branch information
quicquid authored and c-cube committed Oct 30, 2023
1 parent d274d65 commit c04d9df
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/prover/AC.ml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ module Make(Env : Env.S) : S with module Env = Env = struct
)

let register_ac c id ty =
add (C.proof_parent c) id ty
add ~proof:(C.proof_parent c) id ty

let scan_clause c =
let exception Fail in
Expand Down
2 changes: 1 addition & 1 deletion src/prover/clause.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module Make(Ctx : Ctx.S) : S with module Ctx = Ctx = struct
(* create the structure *)
let ord = Ctx.ord () in
let max_lits = lazy ( BV.to_list @@ Lits.maxlits sclause.lits ~ord ) in
let rec c = {
let c = {
sclause;
penalty;
selected;
Expand Down
2 changes: 1 addition & 1 deletion src/prover/clauseQueue.ml
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ module Make(C : Clause_intf.S) = struct
w_diff_l args1 args2
| T.Fun(ty1, body1), T.Fun(ty2, body2)
when Type.equal ty1 ty2 && Type.equal (T.ty body1) (T.ty body2) ->
w_diff body1 body2
w_diff ~given_term:body1 ~conj_term:body2
| _, _ ->
int_of_float (inst_penalty *. (w conj_term) +. gen_penalty *. (w given_term))
and w_diff_l xs ys =
Expand Down
2 changes: 1 addition & 1 deletion src/prover/env.ml
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ module Make(X : sig
match rules with
| [] -> None
| r :: rs ->
CCOpt.or_lazy ~else_:(fun () -> apply_rules rs c) (r c) in
CCOpt.or_lazy ~else_:(fun () -> apply_rules ~rules:rs c) (r c) in

let q = Queue.create () in
Queue.add c q;
Expand Down
2 changes: 1 addition & 1 deletion src/prover/eprover_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module Make(E : Env.S) : S with module Env = E = struct
let output_empty_conj ~out =
Format.fprintf out "thf(conj,conjecture,($false))."

let rec encode_ty_args_t ~encoded_symbols t =
let encode_ty_args_t ~encoded_symbols t =
let make_new_sym mono_head =
if not (T.is_ground mono_head) then (
let err =
Expand Down
6 changes: 3 additions & 3 deletions src/prover_calculi/Higher_order.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1719,9 +1719,9 @@ module Make(E : Env.S) : S with module Env = E = struct
when Type.is_var (T.ty t) && not is_poly_arg_cong_res ->
(* A polymorphic variable might be functional on the ground level *)
let ty_args =
OSeq.iterate [Type.var @@ HVar.fresh ~ty:Type.tType ()]
(fun types_w ->
Type.var (HVar.fresh ~ty:Type.tType ()) :: types_w) in
OSeq.iterate (fun types_w ->
Type.var (HVar.fresh ~ty:Type.tType ()) :: types_w)
[Type.var @@ HVar.fresh ~ty:Type.tType ()] in
let res =
ty_args
|> OSeq.mapi (fun arrarg_idx arrow_args ->
Expand Down
4 changes: 2 additions & 2 deletions src/prover_calculi/app_encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ let rec app_encode_term toplevel t =
(** Encode a literal *)
let app_encode_lit lit =
Util.debugf ~section 2 "# Encoding Literal %a" (fun k -> k (SLiteral.pp T.pp) lit);
SLiteral.map (app_encode_term true) lit
SLiteral.map ~f:(app_encode_term true) lit

(** Encode a clause *)
let app_encode_lits lits = List.map app_encode_lit lits
Expand Down Expand Up @@ -257,4 +257,4 @@ let options =

let () =
Options.add_opts
[ "--app-encode", Arg.Symbol (List.map fst options, fun o -> mode_ := List.assoc o options), " enable applicative encoding"]
[ "--app-encode", Arg.Symbol (List.map fst options, fun o -> mode_ := List.assoc o options), " enable applicative encoding"]
4 changes: 2 additions & 2 deletions src/prover_calculi/bool_encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ let bool_encode_lit lit =
assert(T.equal (T.ty_exn true_term) (T.ty_exn encoded_atom));
mk_equ_lit (bool_encode_term atom) true_term
| Eq _ | Neq _ ->
SLiteral.map bool_encode_term lit
SLiteral.map ~f:bool_encode_term lit

(** Encode a clause *)
let bool_encode_lits lits = List.map bool_encode_lit lits
Expand Down Expand Up @@ -413,4 +413,4 @@ let extension =

let () =
Options.add_opts
[ "--encode-booleans", Arg.Bool ((:=) enabled_), " enable encoding of booleans into a fresh type"]
[ "--encode-booleans", Arg.Bool ((:=) enabled_), " enable encoding of booleans into a fresh type"]
2 changes: 1 addition & 1 deletion src/prover_calculi/lazy_cnf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module Make(E : Env.S) : S with module Env = E = struct

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

let iter_funs () =
let rec aux i k =
Expand Down
4 changes: 2 additions & 2 deletions tests/testMultiset.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Q = QCheck

module M = Multiset.Make(struct
type t = int
let compare i j=Pervasives.compare i j
let compare i j=Stdlib.compare i j
end)

(* for testing *)
Expand Down Expand Up @@ -146,7 +146,7 @@ let max_is_max =
let gen = Q.(map M.of_list (list small_int)) in
let gen = Q.set_print pp gen in
let prop m =
let f x y = Comparison.of_total (Pervasives.compare x y) in
let f x y = Comparison.of_total (Stdlib.compare x y) in
let l = M.max f m |> M.to_list |> List.map fst in
List.for_all (fun x -> M.is_max f x m) l
in
Expand Down
3 changes: 2 additions & 1 deletion tests/testTerm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ let test_whnf2 = "whnf2", `Quick, fun () ->
Alcotest.(check t_test) "whnf2" t1 t';
()

let test_whnf2 = "patterns", `Quick, fun () ->
let test_patterns = "patterns", `Quick, fun () ->
let t1 = f (g a) (g b) in
let t2 = T.fun_ ty (f (T.bvar ~ty 0) (g (T.bvar ~ty 1))) in
let t3 = T.fun_ ty (f (fun_var (T.bvar ~ty 0) (T.bvar ~ty 1)) (g (T.bvar ~ty 1))) in
Expand Down Expand Up @@ -207,6 +207,7 @@ let suite : unit Alcotest.test_case list =
test_app_var;
test_whnf1;
test_whnf2;
test_patterns;
test_polymorphic_app;
test_eta_reduce;
test_eta_expand;
Expand Down

0 comments on commit c04d9df

Please sign in to comment.