mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-09 20:55:39 -05:00
fix: avoid preprocessing loops
This commit is contained in:
parent
0841bddbaf
commit
6d72203437
1 changed files with 5 additions and 1 deletions
|
|
@ -288,6 +288,7 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
to_decide: unit N_tbl.t; (* set of terms to decide. *)
|
to_decide: unit N_tbl.t; (* set of terms to decide. *)
|
||||||
to_decide_for_complete_model: unit N_tbl.t; (* infinite types but we need a cstor in model*)
|
to_decide_for_complete_model: unit N_tbl.t; (* infinite types but we need a cstor in model*)
|
||||||
case_split_done: unit T.Tbl.t; (* set of terms for which case split is done *)
|
case_split_done: unit T.Tbl.t; (* set of terms for which case split is done *)
|
||||||
|
single_cstor_preproc_done: unit T.Tbl.t; (* preprocessed terms *)
|
||||||
stat_acycl_conflict: int Stat.counter;
|
stat_acycl_conflict: int Stat.counter;
|
||||||
(* TODO: bitfield for types with less than 62 cstors, to quickly detect conflict? *)
|
(* TODO: bitfield for types with less than 62 cstors, to quickly detect conflict? *)
|
||||||
}
|
}
|
||||||
|
|
@ -310,7 +311,7 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
| T_cstor _, _ -> None
|
| T_cstor _, _ -> None
|
||||||
| _, Ty_data {cstors; _} ->
|
| _, Ty_data {cstors; _} ->
|
||||||
begin match Iter.take 2 cstors |> Iter.to_rev_list with
|
begin match Iter.take 2 cstors |> Iter.to_rev_list with
|
||||||
| [cstor] ->
|
| [cstor] when not (T.Tbl.mem self.single_cstor_preproc_done t) ->
|
||||||
(* single cstor: turn [t] into [cstor (sel-c-0 t, …, sel-c n t)] *)
|
(* single cstor: turn [t] into [cstor (sel-c-0 t, …, sel-c n t)] *)
|
||||||
Log.debugf 50
|
Log.debugf 50
|
||||||
(fun k->k
|
(fun k->k
|
||||||
|
|
@ -342,6 +343,8 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
in
|
in
|
||||||
|
|
||||||
Log.debugf 20 (fun k->k "(@[%s.preproc-into@ %a@ :into %a@])" name T.pp t T.pp u);
|
Log.debugf 20 (fun k->k "(@[%s.preproc-into@ %a@ :into %a@])" name T.pp t T.pp u);
|
||||||
|
|
||||||
|
T.Tbl.add self.single_cstor_preproc_done t (); (* avoid loops *)
|
||||||
Some (u, Iter.return proof)
|
Some (u, Iter.return proof)
|
||||||
|
|
||||||
| _ -> None
|
| _ -> None
|
||||||
|
|
@ -688,6 +691,7 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
parents=ST_parents.create_and_setup ~size:32 solver;
|
parents=ST_parents.create_and_setup ~size:32 solver;
|
||||||
to_decide=N_tbl.create ~size:16 ();
|
to_decide=N_tbl.create ~size:16 ();
|
||||||
to_decide_for_complete_model=N_tbl.create ~size:16 ();
|
to_decide_for_complete_model=N_tbl.create ~size:16 ();
|
||||||
|
single_cstor_preproc_done=T.Tbl.create 8;
|
||||||
case_split_done=T.Tbl.create 16;
|
case_split_done=T.Tbl.create 16;
|
||||||
cards=Card.create();
|
cards=Card.create();
|
||||||
stat_acycl_conflict=Stat.mk_int (SI.stats solver) "data.acycl.conflict";
|
stat_acycl_conflict=Stat.mk_int (SI.stats solver) "data.acycl.conflict";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue