refactor: remove Value, just use terms in the model

This commit is contained in:
Simon Cruanes 2021-03-22 12:53:38 -04:00
parent b6713fb833
commit be97938e12
2 changed files with 4 additions and 18 deletions

View file

@ -626,17 +626,6 @@ module type SOLVER = sig
val sign : t -> bool val sign : t -> bool
end end
(* FIXME: just use terms instead? *)
(** {3 Semantic values} *)
module Value : sig
type t
val equal : t -> t -> bool
val hash : t -> int
val ty : t -> ty
val pp : t Fmt.printer
end
module Model : sig module Model : sig
type t type t
@ -644,9 +633,9 @@ module type SOLVER = sig
val mem : t -> term -> bool val mem : t -> term -> bool
val find : t -> term -> Value.t option val find : t -> term -> term option
val eval : t -> term -> Value.t option val eval : t -> term -> term option
val pp : t Fmt.printer val pp : t Fmt.printer
end end

View file

@ -561,13 +561,10 @@ module Make(A : ARG)
| U_incomplete -> Fmt.string out "incomplete fragment" | U_incomplete -> Fmt.string out "incomplete fragment"
end [@@ocaml.warning "-37"] end [@@ocaml.warning "-37"]
(* just use terms as values *)
module Value = Term
module Model = struct module Model = struct
type t = type t =
| Empty | Empty
| Map of Value.t Term.Tbl.t | Map of term Term.Tbl.t
let empty = Empty let empty = Empty
let mem = function let mem = function
| Empty -> fun _ -> false | Empty -> fun _ -> false
@ -580,7 +577,7 @@ module Make(A : ARG)
| Empty -> Fmt.string out "(model)" | Empty -> Fmt.string out "(model)"
| Map tbl -> | Map tbl ->
let pp_pair out (t,v) = let pp_pair out (t,v) =
Fmt.fprintf out "(@[<1>%a@ := %a@])" Term.pp t Value.pp v Fmt.fprintf out "(@[<1>%a@ := %a@])" Term.pp t Term.pp v
in in
Fmt.fprintf out "(@[<hv>model@ %a@])" Fmt.fprintf out "(@[<hv>model@ %a@])"
(Util.pp_iter pp_pair) (Term.Tbl.to_iter tbl) (Util.pp_iter pp_pair) (Term.Tbl.to_iter tbl)