mirror of
https://github.com/c-cube/sidekick.git
synced 2026-01-21 16:56:41 -05:00
fix theory combination for LRA
This commit is contained in:
parent
eb97161992
commit
849d4319f2
3 changed files with 10 additions and 5 deletions
|
|
@ -50,6 +50,8 @@ module type RATIONAL = sig
|
|||
|
||||
val minus_infinity : t
|
||||
|
||||
val of_bigint : bigint -> t
|
||||
|
||||
val is_real : t -> bool
|
||||
(** A proper real, not nan/infinity *)
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ module Th_lra = Sidekick_arith_lra.Make(struct
|
|||
let mk_bool = T.bool
|
||||
|
||||
let rec view_as_lra t = match T.view t with
|
||||
| T.LIA (Arith_const i) -> LRA.LRA_const (Q.of_bigint i)
|
||||
| T.LRA l ->
|
||||
let open Base_types in
|
||||
let module LRA = Sidekick_arith_lra in
|
||||
|
|
|
|||
|
|
@ -630,11 +630,13 @@ module Make(A : ARG) : S with module A = A = struct
|
|||
(* look for subterms of type Real, for they will need theory combination *)
|
||||
let on_subterm (self:state) _ (t:T.t) : unit =
|
||||
Log.debugf 50 (fun k->k "(@[lra.cc-on-subterm@ %a@])" T.pp t);
|
||||
if A.has_ty_real t &&
|
||||
not (T.Tbl.mem self.needs_th_combination t) then (
|
||||
Log.debugf 5 (fun k->k "(@[lra.needs-th-combination@ %a@])" T.pp t);
|
||||
T.Tbl.add self.needs_th_combination t ()
|
||||
)
|
||||
match A.view_as_lra t with
|
||||
| LRA_other _ when not (A.has_ty_real t) -> ()
|
||||
| _ ->
|
||||
if not (T.Tbl.mem self.needs_th_combination t) then (
|
||||
Log.debugf 5 (fun k->k "(@[lra.needs-th-combination@ %a@])" T.pp t);
|
||||
T.Tbl.add self.needs_th_combination t ()
|
||||
)
|
||||
|
||||
let create_and_setup si =
|
||||
Log.debug 2 "(th-lra.setup)";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue