diff --git a/src/cdsat/core.ml b/src/cdsat/core.ml index 598777a2..cf7daada 100644 --- a/src/cdsat/core.ml +++ b/src/cdsat/core.ml @@ -187,8 +187,21 @@ let pop_levels (self : t) n : unit = let[@inline] get_term_to_var self = self.term_to_var -let[@inline] term_to_var self t : TVar.t = - Term_to_var.convert self.term_to_var t +let term_to_var self t : TVar.t = + (* TODO: simplify [t] *) + let v = Term_to_var.convert self.term_to_var t in + + (* add new variables to vars_to_decide *) + while + match TVar.pop_new_var self.vst with + | None -> false + | Some v -> + Vars_to_decide.add self.vars_to_decide v; + true + do + () + done; + v let add_term_to_var_hook self h = Term_to_var.add_hook self.term_to_var h diff --git a/src/cdsat/solver.ml b/src/cdsat/solver.ml index 8824beff..a9ea5b2b 100644 --- a/src/cdsat/solver.ml +++ b/src/cdsat/solver.ml @@ -41,13 +41,6 @@ let[@inline] vst self = self.vst let add_ty (_self : t) ~ty:_ : unit = () -(* TODO: - when asserting [t], we convert it into [v]. - At that point we need to add [v] and its sub-variables (recursively) - to the [Core.t], so it can itself add them to [Vars_to_decide.t]. - - Sub-variables of asserted terms are what needs to be decided. *) - let assert_term_ (self : t) (t : Term.t) pr : unit = Log.debugf 50 (fun k -> k "(@[cdsat.core.assert@ %a@])" Term.pp t); let sign, t = Term.abs self.tst t in