mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-08 12:15:48 -05:00
remove dead code, some printing info
This commit is contained in:
parent
6aae70f15a
commit
11d8f8e879
3 changed files with 18 additions and 33 deletions
|
|
@ -465,7 +465,8 @@ module type SOLVER_INTERNAL = sig
|
||||||
|
|
||||||
Must be complete (i.e. must raise a conflict if the set of literals is
|
Must be complete (i.e. must raise a conflict if the set of literals is
|
||||||
not satisfiable) and can be expensive. The function
|
not satisfiable) and can be expensive. The function
|
||||||
is given the whole trail. *)
|
is given the whole trail.
|
||||||
|
*)
|
||||||
|
|
||||||
(** {3 Preprocessors}
|
(** {3 Preprocessors}
|
||||||
These preprocessors turn mixed, raw literals (possibly simplified) into
|
These preprocessors turn mixed, raw literals (possibly simplified) into
|
||||||
|
|
@ -702,6 +703,7 @@ module Monoid_of_repr(M : MONOID_ARG) : sig
|
||||||
val mem : t -> M.SI.CC.N.t -> bool
|
val mem : t -> M.SI.CC.N.t -> bool
|
||||||
val get : t -> M.SI.CC.N.t -> M.t option
|
val get : t -> M.SI.CC.N.t -> M.t option
|
||||||
val iter_all : t -> (M.SI.CC.repr * M.t) Iter.t
|
val iter_all : t -> (M.SI.CC.repr * M.t) Iter.t
|
||||||
|
val pp : t Fmt.printer
|
||||||
end = struct
|
end = struct
|
||||||
module SI = M.SI
|
module SI = M.SI
|
||||||
module T = SI.T.Term
|
module T = SI.T.Term
|
||||||
|
|
@ -799,6 +801,10 @@ end = struct
|
||||||
| None, None -> ()
|
| None, None -> ()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let pp out (self:t) : unit =
|
||||||
|
let pp_e out (t,v) = Fmt.fprintf out "(@[%a@ :has %a@])" N.pp t M.pp v in
|
||||||
|
Fmt.fprintf out "(@[%a@])" (Fmt.seq pp_e) (iter_all self)
|
||||||
|
|
||||||
let create_and_setup ?size (solver:SI.t) : t =
|
let create_and_setup ?size (solver:SI.t) : t =
|
||||||
let field_has_value =
|
let field_has_value =
|
||||||
SI.CC.allocate_bitfield ~descr:("monoid."^M.name^".has-value")
|
SI.CC.allocate_bitfield ~descr:("monoid."^M.name^".has-value")
|
||||||
|
|
|
||||||
|
|
@ -312,8 +312,10 @@ module Make(A : ARG)
|
||||||
(* transmit to theories. *)
|
(* transmit to theories. *)
|
||||||
CC.check cc acts;
|
CC.check cc acts;
|
||||||
if final then (
|
if final then (
|
||||||
|
for _i = 0 to 1 do
|
||||||
List.iter (fun f -> f self acts lits) self.on_final_check;
|
List.iter (fun f -> f self acts lits) self.on_final_check;
|
||||||
CC.check cc acts;
|
CC.check cc acts;
|
||||||
|
done; (* FIXME *)
|
||||||
(* TODO: theory combination until fixpoint *)
|
(* TODO: theory combination until fixpoint *)
|
||||||
) else (
|
) else (
|
||||||
List.iter (fun f -> f self acts lits) self.on_partial_check;
|
List.iter (fun f -> f self acts lits) self.on_partial_check;
|
||||||
|
|
@ -598,7 +600,7 @@ module Make(A : ARG)
|
||||||
Stat.incr self.count_solve;
|
Stat.incr self.count_solve;
|
||||||
match r with
|
match r with
|
||||||
| Sat_solver.Sat st ->
|
| Sat_solver.Sat st ->
|
||||||
Log.debugf 1 (fun k->k "SAT");
|
Log.debug 1 "sidekick.msat-solver: SAT";
|
||||||
let _lits f = st.iter_trail f (fun _ -> ()) in
|
let _lits f = st.iter_trail f (fun _ -> ()) in
|
||||||
(* TODO: theory combination *)
|
(* TODO: theory combination *)
|
||||||
let m = mk_model self _lits in
|
let m = mk_model self _lits in
|
||||||
|
|
|
||||||
|
|
@ -274,33 +274,6 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
N_tbl.pop_levels self.to_decide n;
|
N_tbl.pop_levels self.to_decide n;
|
||||||
()
|
()
|
||||||
|
|
||||||
(* TODO: select/is-a *)
|
|
||||||
|
|
||||||
(* TODO: remove
|
|
||||||
(* attach data to constructor terms *)
|
|
||||||
let on_new_term_look_at_shape self n (t:T.t) =
|
|
||||||
match A.view_as_data t with
|
|
||||||
| T_cstor (cstor,args) ->
|
|
||||||
Log.debugf 20
|
|
||||||
(fun k->k "(@[%s.on-new-term@ %a@ :cstor %a@ @[:args@ (@[%a@])@]@]@])"
|
|
||||||
name T.pp t A.Cstor.pp cstor (Util.pp_iarray T.pp) args);
|
|
||||||
N_tbl.add self.cstors n {n; t; cstor; args};
|
|
||||||
| T_select (cstor,i,u) ->
|
|
||||||
Log.debugf 20
|
|
||||||
(fun k->k "(@[%s.on-new-term.select[%d]@ %a@ :cstor %a@ :in %a@])"
|
|
||||||
name i T.pp t A.Cstor.pp cstor T.pp u);
|
|
||||||
(* TODO: remember that [u] must be decided *)
|
|
||||||
()
|
|
||||||
(* N_tbl.add self.cstors n {n; t; cstor; args}; *)
|
|
||||||
| T_is_a (cstor,u) ->
|
|
||||||
Log.debugf 20
|
|
||||||
(fun k->k "(@[%s.on-new-term.is-a@ %a@ :cstor %a@ :in %a@])"
|
|
||||||
name T.pp t A.Cstor.pp cstor T.pp u);
|
|
||||||
()
|
|
||||||
(* N_tbl.add self.cstors n {n; t; cstor; args}; *)
|
|
||||||
| T_other _ -> ()
|
|
||||||
*)
|
|
||||||
|
|
||||||
(* remember terms of a datatype *)
|
(* remember terms of a datatype *)
|
||||||
let on_new_term_look_at_ty (self:t) n (t:T.t) : unit =
|
let on_new_term_look_at_ty (self:t) n (t:T.t) : unit =
|
||||||
let ty = T.ty t in
|
let ty = T.ty t in
|
||||||
|
|
@ -497,7 +470,11 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
|> Iter.to_rev_list
|
|> Iter.to_rev_list
|
||||||
in
|
in
|
||||||
begin match remaining_to_decide with
|
begin match remaining_to_decide with
|
||||||
| [] -> ()
|
| [] ->
|
||||||
|
Log.debugf 10
|
||||||
|
(fun k->k "(@[%s.final-check.all-decided@ :cstors %a@ :parents %a@])"
|
||||||
|
name ST_cstors.pp self.cstors ST_parents.pp self.parents);
|
||||||
|
()
|
||||||
| l ->
|
| l ->
|
||||||
Log.debugf 10
|
Log.debugf 10
|
||||||
(fun k->k "(@[%s.final-check.must-decide@ %a@])" name (Util.pp_list N.pp) l);
|
(fun k->k "(@[%s.final-check.must-decide@ %a@])" name (Util.pp_list N.pp) l);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue