Skip to content

Commit 4ede772

Browse files
hargoniXc-cube
authored andcommitted
chore: fix compiler warnings
1 parent 78b359d commit 4ede772

38 files changed

+89
-78
lines changed

src/backends/CVC4.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ type t = {
121121
decode: decode_state;
122122
print_model: bool;
123123
options: string;
124-
mutable sexp : DSexp.t;
124+
sexp : DSexp.t;
125125
mutable closed : bool;
126126
mutable res : (T.t, Ty.t) Problem.Res.t option;
127127
}
@@ -919,7 +919,7 @@ let pipes
919919
let n = List.length options in
920920
assert (n > 0);
921921
(* each process' slice is only [1/n] of the global CVC4 slice *)
922-
CCOpt.map (fun s -> s /. float n) slice
922+
CCOption.map (fun s -> s /. float n) slice
923923
) else slice
924924
in
925925
let encode pb =

src/backends/Smbc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ let dt_of_term (t:term): (term,ty) Model.DT.t =
642642
| TI.Builtin (`Ite (_,_,_)), v :: vars_tail ->
643643
let tests, else_ = T.ite_unfold t in
644644
let tests_v, other_tests =
645-
CCList.partition_map
645+
CCList.partition_filter_map
646646
(fun (a, b) ->
647647
match get_eqn_exn v vars_tail a with
648648
| Some t ->

src/core/AnalyzeType.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module Make(T : TI.S) = struct
176176
| Stmt.Attr_infinite -> Some Card.infinite
177177
| _ -> None)
178178
attrs
179-
|> CCOpt.get_or ~default
179+
|> CCOption.get_or ~default
180180
| Env.Cstor _
181181
| Env.Fun_def (_,_,_)
182182
| Env.Fun_spec (_,_)

src/core/Env.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ let mem ~env ~id = ID.PerTbl.mem env.infos id
254254

255255
let find_ty_exn ~env id = (find_exn ~env id).ty
256256

257-
let find_ty ~env id = CCOpt.map (fun x -> x.ty) (find ~env id)
257+
let find_ty ~env id = CCOption.map (fun x -> x.ty) (find ~env id)
258258

259259
module type PRINT_TERM = sig
260260
type t

src/core/MetaVar.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let rebind ~var x =
3636
if can_bind var then invalid_arg "MetaVar.rebind" else var.deref <- Some x
3737

3838
let update ~f v =
39-
{v with deref=CCOpt.map f v.deref; }
39+
{v with deref=CCOption.map f v.deref; }
4040

4141
let pp oc v = Format.fprintf oc "?%a" ID.pp_full v.id
4242
let to_string v = "?" ^ ID.to_string v.id

src/core/Model.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module DT = struct
7676
Cases {
7777
var=Var.update_ty ~f:ty cases.var;
7878
tests;
79-
default=CCOpt.map (map ~term ~ty) cases.default;
79+
default=CCOption.map (map ~term ~ty) cases.default;
8080
}
8181

8282
let rec filter_map ~test:ft ~yield:fy dt = match dt with
@@ -97,7 +97,7 @@ module DT = struct
9797
l
9898
|> tests_
9999
and default =
100-
CCOpt.map (filter_map ~test:ft ~yield:fy) default
100+
CCOption.map (filter_map ~test:ft ~yield:fy) default
101101
in
102102
mk_cases var tests ~default
103103

@@ -245,7 +245,7 @@ module DT = struct
245245
| Tests l -> List.iter (fun (_,rhs) -> check_vars vars' rhs) l
246246
| Match (m,_) -> ID.Map.iter (fun _ (_,_,rhs) -> check_vars vars' rhs) m
247247
end;
248-
CCOpt.iter (check_vars vars') default;
248+
CCOption.iter (check_vars vars') default;
249249
in
250250
check_vars (vars t) t
251251

@@ -400,7 +400,7 @@ module DT_util = struct
400400
tys, vars, eval_subst ~subst rhs)
401401
|> DT.match_ ~missing
402402
in
403-
let default = CCOpt.map (eval_subst ~subst) default in
403+
let default = CCOption.map (eval_subst ~subst) default in
404404
DT.mk_cases var' tests ~default
405405

406406
let rec map_vars ~subst = function
@@ -422,7 +422,7 @@ module DT_util = struct
422422
tys,vars, map_vars ~subst rhs)
423423
|> DT.match_ ~missing
424424
in
425-
let default = CCOpt.map (map_vars ~subst) default in
425+
let default = CCOption.map (map_vars ~subst) default in
426426
DT.mk_cases var tests ~default
427427

428428
let rename_vars dt = eval_subst ~subst:Subst.empty dt
@@ -491,7 +491,7 @@ module DT_util = struct
491491
DT.map_tests_or_match tests
492492
~f:(fun sub -> join sub b) ~ty:CCFun.id ~term:CCFun.id
493493
and default =
494-
CCOpt.map (fun d -> join d b) default
494+
CCOption.map (fun d -> join d b) default
495495
in
496496
DT.mk_cases var tests ~default
497497

@@ -534,7 +534,7 @@ module DT_util = struct
534534
CCList.filter_map
535535
(fun (c,subst) -> match c with
536536
| DT.Yield _ -> assert false
537-
| DT.Cases {DT.default; _} -> CCOpt.map (fun x->x,subst) default)
537+
| DT.Cases {DT.default; _} -> CCOption.map (fun x->x,subst) default)
538538
l
539539
in
540540
begin match l with
@@ -672,7 +672,7 @@ module DT_util = struct
672672
in
673673
(* add the default case, if needed *)
674674
let l =
675-
let default = CCOpt.map (aux subst vars') default in
675+
let default = CCOption.map (aux subst vars') default in
676676
CCList.cons_maybe default l
677677
in
678678
assert (l<>[]);
@@ -684,7 +684,7 @@ module DT_util = struct
684684
T.eval ~subst lhs, aux subst vars rhs)
685685
l
686686
and default =
687-
CCOpt.map (aux subst vars) default
687+
CCOption.map (aux subst vars) default
688688
in
689689
DT.mk_tests v ~tests:l ~default
690690
)

src/core/Statement.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ let map_clause_bind ~bind ~term acc c =
311311
let acc, vars = Utils.fold_map bind acc c.clause_vars in
312312
{
313313
clause_vars=vars;
314-
clause_guard=CCOpt.map (term acc Polarity.Neg) c.clause_guard;
314+
clause_guard=CCOption.map (term acc Polarity.Neg) c.clause_guard;
315315
clause_concl=term acc Polarity.Pos c.clause_concl;
316316
}
317317

@@ -417,7 +417,7 @@ let fold_clause_bind ~bind ~term ~ty k b_acc acc (c:(_,_) pred_clause) =
417417
let pol = match k with `Pred -> Polarity.Pos | `Copred -> Polarity.Neg in
418418
let b_acc = List.fold_left bind b_acc c.clause_vars in
419419
let acc = term b_acc pol acc c.clause_concl in
420-
CCOpt.fold (term b_acc (Polarity.inv pol)) acc c.clause_guard
420+
CCOption.fold (term b_acc (Polarity.inv pol)) acc c.clause_guard
421421

422422
let fold_pred_bind ~bind ~term ~ty k b_acc acc (def:(_,_) pred_def) =
423423
let acc = ty b_acc acc def.pred_defined.defined_ty in

src/core/Traversal.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ module Make(T : TermInner.S)(Arg : ARG)(State : sig type t end) = struct
212212
List.iter
213213
(fun c ->
214214
yield_vars c.Stmt.clause_vars;
215-
CCOpt.iter yield_term c.Stmt.clause_guard;
215+
CCOption.iter yield_term c.Stmt.clause_guard;
216216
yield_term c.Stmt.clause_concl)
217217
p.Stmt.pred_clauses
218218
| PS_spec s ->

src/core/TypeCheck.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ module Make(T : TI.S) = struct
264264
let check_top env bound _pol () t = ignore (check ~env bound t) in
265265
let check_ty env bound () t = ignore (check ~env bound t) in
266266
(* check cardinalities *)
267-
CCOpt.iter
267+
CCOption.iter
268268
(fun cache -> TyCard.check_non_zero ~cache env st)
269269
t.cache;
270270
(* basic check *)

src/parsers/TPTP_preprocess.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ let close_forall t =
119119
| `Wildcard :: l' -> enter_bvars l' f
120120
| `Var v :: l' -> enter_bvar v (fun () -> enter_bvars l' f)
121121
and enter_ty_bvar (v, tyopt) f =
122-
CCOpt.iter compute_fvars tyopt;
122+
CCOption.iter compute_fvars tyopt;
123123
enter_bvar v f
124124
in
125125
compute_fvars t;
@@ -196,7 +196,7 @@ let rec declare_missing ~ctx ~state t =
196196
(fun () -> c, vars, declare_missing ~ctx ~state rhs))
197197
l
198198
and def =
199-
CCOpt.map (declare_missing ~ctx ~state) def
199+
CCOption.map (declare_missing ~ctx ~state) def
200200
in
201201
A.match_with ~loc ?default:def t l
202202
| A.Ite (a,b,c) ->

src/random/Term_random.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ let mk_rand() = Random.State.make_self_init ()
323323
let generate ?(rand=mk_rand()) g = g rand
324324

325325
let generate_l ?n ?(rand=mk_rand()) g =
326-
let n = CCOpt.get_lazy (fun () -> G.(1 -- 50) rand) n in
326+
let n = CCOption.get_lazy (fun () -> G.(1 -- 50) rand) n in
327327
G.list_repeat n g rand
328328

329329
let pp_rules() =

src/transformations/Cstor_as_fun.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ let cstor_as_fun (state:state) (id:ID.t) ~ty : ID.t * def option =
7676
type glob_state = {
7777
state: state;
7878
mutable env: env;
79-
mutable new_stmts : (term, ty) Stmt.t CCVector.vector;
79+
new_stmts : (term, ty) Stmt.t CCVector.vector;
8080
(* used for new declarations. [id, type, attribute list] *)
8181
}
8282

@@ -151,7 +151,7 @@ let decode_model state m : (_,_) Model.t =
151151

152152
(** {2 Pipe} *)
153153

154-
let pipe_with ?on_decoded ~decode ~print ~check =
154+
let pipe_with ?on_decoded ~decode ~print ~check () =
155155
let on_encoded =
156156
Utils.singleton_if print () ~f:(fun () ->
157157
let module PPb = Problem.P in
@@ -181,4 +181,4 @@ let pipe ~print ~check =
181181
else []
182182
in
183183
let decode state = Problem.Res.map_m ~f:(decode_model state) in
184-
pipe_with ~on_decoded ~print ~decode ~check
184+
pipe_with ~on_decoded ~print ~decode ~check ()

src/transformations/Cstor_as_fun.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ val pipe_with :
5454
decode:(state -> 'c -> 'd) ->
5555
print:bool ->
5656
check:bool ->
57+
unit ->
5758
((term, term) Problem.t,
5859
(term, term) Problem.t,
5960
'c, 'd

src/transformations/ElimCopy.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let has_small_exact_card card_concrete = match card_concrete with
9292
| Cardinality.Exact n ->
9393
(* if [n >= threshold] we approximate *)
9494
if Cardinality.Z.(compare n (of_int approx_threshold_) <= 0)
95-
then Some (Cardinality.Z.to_int n |> CCOpt.get_exn)
95+
then Some (Cardinality.Z.to_int n |> CCOption.get_exn_or "Cardinality was too large")
9696
else None
9797

9898
let attrs_of_ty state (ty:ty): Stmt.decl_attr list =

src/transformations/ElimData.ml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module type S = sig
5151
decode:(decode_state -> 'c -> 'd) ->
5252
print:bool ->
5353
check:bool ->
54+
unit ->
5455
((T.t,T.t) Problem.t,
5556
(T.t,T.t) Problem.t, 'c, 'd
5657
) Transform.t
@@ -164,7 +165,7 @@ module Make(M : sig val mode : mode end) = struct
164165
| None -> errorf "could not find encoding of `is-%a`" ID.pp id
165166

166167
let ty_id ~state (id:ID.t) : T.t option =
167-
let open CCOpt in
168+
let open CCOption in
168169
Env.find_ty ~env:state.env id
169170
<+> Env.find_ty ~env:state.new_env id
170171

@@ -887,7 +888,7 @@ module Make(M : sig val mode : mode end) = struct
887888
let cs =
888889
List.map
889890
(fun {Stmt.clause_guard=g; clause_concl=t; clause_vars} ->
890-
let g = CCOpt.map (tr_term state Pol.Neg) g in
891+
let g = CCOption.map (tr_term state Pol.Neg) g in
891892
(* only process under the predicate itself *)
892893
let t =
893894
T.map () t ~bind:(fun _ _ -> assert false)
@@ -1156,7 +1157,7 @@ module Make(M : sig val mode : mode end) = struct
11561157
| M_codata ->
11571158
F.(update_l [Codata, Absent; Data, Present; Ind_preds, Present])
11581159

1159-
let pipe_with ?on_decoded ~decode ~print ~check =
1160+
let pipe_with ?on_decoded ~decode ~print ~check () =
11601161
let on_encoded =
11611162
Utils.singleton_if check ()
11621163
~f:(fun () ->
@@ -1186,7 +1187,7 @@ module Make(M : sig val mode : mode end) = struct
11861187
else []
11871188
in
11881189
let decode state = Problem.Res.map_m ~f:(decode_model state) in
1189-
pipe_with ~on_decoded ~check ~decode ~print
1190+
pipe_with ~on_decoded ~check ~decode ~print ()
11901191
end
11911192

11921193
module Data = Make(struct let mode = M_data end)

src/transformations/ElimData.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module type S = sig
4444
decode:(decode_state -> 'c -> 'd) ->
4545
print:bool ->
4646
check:bool ->
47+
unit ->
4748
((term,term) Problem.t,
4849
(term,term) Problem.t, 'c, 'd
4950
) Transform.t

src/transformations/ElimPatternMatch.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ let elim_match ~mode ~env t =
4444
in
4545
let rec elim_match_ ~subst t = match T.repr t with
4646
| TI.Var v ->
47-
CCOpt.get_or ~default:t (Subst.find ~subst v)
47+
CCOption.get_or ~default:t (Subst.find ~subst v)
4848
| TI.Const _ -> t
4949
| TI.App (f,l) -> T.app (elim_match_ ~subst f) (elim_match_l_ ~subst l)
5050
| TI.Builtin b -> T.builtin (Builtin.map b ~f:(elim_match_ ~subst))

src/transformations/ElimRecursion.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ let decode_model ~state m =
740740

741741
(** {6 Pipe} *)
742742

743-
let pipe_with ?on_decoded ~decode ~print ~check =
743+
let pipe_with ?on_decoded ~decode ~print ~check () =
744744
let on_encoded =
745745
Utils.singleton_if print () ~f:(fun () ->
746746
let module PPb = Problem.P in
@@ -770,4 +770,4 @@ let pipe ~print ~check =
770770
else []
771771
in
772772
let decode state = Problem.Res.map_m ~f:(decode_model ~state) in
773-
pipe_with ~on_decoded ~print ~decode ~check
773+
pipe_with ~on_decoded ~print ~decode ~check ()

src/transformations/ElimRecursion.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ val pipe_with :
4040
decode:(decode_state -> 'c -> 'd) ->
4141
print:bool ->
4242
check:bool ->
43+
unit ->
4344
((term, term) Problem.t,
4445
(term, term) Problem.t,
4546
'c, 'd

src/transformations/ElimTypes.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ let decode_term ?(subst=Var.Subst.empty) state rety t ty =
448448
| Some map ->
449449
(* if [id] is a unitype domain constant, replace it *)
450450
ID.Map.get id map
451-
|> CCOpt.map_or ~default:t T.const
451+
|> CCOption.map_or ~default:t T.const
452452
end
453453
| _ ->
454454
T.map () t
@@ -541,7 +541,7 @@ let decode_model ~state m =
541541

542542
(** {2 Pipe} *)
543543

544-
let pipe_with ?on_decoded ~decode ~print ~check =
544+
let pipe_with ?on_decoded ~decode ~print ~check () =
545545
let on_encoded =
546546
Utils.singleton_if print ()
547547
~f:(fun () ->
@@ -571,5 +571,5 @@ let pipe ~print ~check =
571571
name (Problem.Res.pp T.pp' T.pp)]
572572
else []
573573
in
574-
pipe_with ~check ~print ~on_decoded
574+
pipe_with ~check ~print ~on_decoded ()
575575
~decode:(fun state -> Problem.Res.map_m ~f:(decode_model ~state))

src/transformations/ElimTypes.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ val pipe_with :
3030
decode:(state -> 'c -> 'd) ->
3131
print:bool ->
3232
check:bool ->
33+
unit ->
3334
((term,term) Problem.t,
3435
(term,term) Problem.t, 'c, 'd
3536
) Transform.t

src/transformations/Elim_HOF.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ type decode_state = {
337337
}
338338

339339
type state = {
340-
mutable env: (term, ty) Env.t;
340+
env: (term, ty) Env.t;
341341
(* environment (to get signatures, etc.) *)
342342
arities: arity_set FunMap.t;
343343
(* set of arities for partially applied symbols/variables *)
344344
mutable app_count: int;
345345
(* used for generating new names *)
346-
mutable new_stmts : (term, ty) Stmt.t CCVector.vector;
346+
new_stmts : (term, ty) Stmt.t CCVector.vector;
347347
(* used for new declarations. [id, type, attribute list] *)
348348
mutable unsat_means_unknown: bool;
349349
(* did we have to do some approximation? *)
@@ -1001,7 +1001,7 @@ let as_handle_ ~state ty : handle option =
10011001
| [], _ -> None
10021002
| args,ret -> Some (handle_arrow_l args (H_leaf ret))
10031003

1004-
let is_handle_ ~state ty : bool = CCOpt.is_some (as_handle_ ~state ty)
1004+
let is_handle_ ~state ty : bool = CCOption.is_some (as_handle_ ~state ty)
10051005

10061006
(* all domain constants whose type is a handle *)
10071007
let all_fun_consts_ ~state m : (ty * handle) ID.Map.t =
@@ -1185,7 +1185,7 @@ let decode_model ~state m =
11851185

11861186
(** {2 Pipe} *)
11871187

1188-
let pipe_with ?on_decoded ~decode ~print ~check =
1188+
let pipe_with ?on_decoded ~decode ~print ~check () =
11891189
let on_encoded =
11901190
Utils.singleton_if print () ~f:(fun () ->
11911191
let module PPb = Problem.P in
@@ -1218,4 +1218,4 @@ let pipe ~print ~check =
12181218
else []
12191219
in
12201220
let decode state = Problem.Res.map_m ~f:(decode_model ~state) in
1221-
pipe_with ~on_decoded ~print ~decode ~check
1221+
pipe_with ~on_decoded ~print ~decode ~check ()

0 commit comments

Comments
 (0)