refactor: small cleanup in terms

This commit is contained in:
Simon Cruanes 2019-02-16 14:58:13 -06:00
parent a14fe25ba0
commit 1ef0cf4183
6 changed files with 1 additions and 17 deletions

View file

@ -42,7 +42,6 @@ and cst_view =
do_cc: bool; (* participate in congruence closure? *)
relevant : 'a. ID.t -> 'a IArray.t -> int -> bool; (* relevant argument? *)
ty : ID.t -> term IArray.t -> ty; (* compute type *)
is_value: bool; (* value constructor *)
eval: value IArray.t -> value; (* evaluate term *)
}
(** Methods on the custom term view whose arguments are ['a].

View file

@ -61,9 +61,6 @@ let create ?(size=1024) () : state =
ignore (Lazy.force st.false_); (* not true *)
st
let[@inline] all_terms st = Term_cell.Tbl.values st.tbl
let[@inline] is_value t = Term_cell.is_value t.term_view
let app_cst st f a =
let cell = Term_cell.app_cst f a in
make st cell

View file

@ -39,13 +39,8 @@ val abs : t -> t * bool
val to_seq : t -> t Sequence.t
val all_terms : state -> t Sequence.t
val pp : t Fmt.printer
val is_value : t -> bool
(** Values are special terms that behave specially wrt congruence/equality *)
(** {6 Views} *)
val is_true : t -> bool

View file

@ -53,11 +53,6 @@ include Make_eq(struct
let true_ = Bool true
let false_ = Bool false
let is_value = function
| Bool _ -> true
| App_cst ({cst_view=Cst_def r;_}, _) -> r.is_value
| If _ | App_cst _ | Eq _ -> false
let app_cst f a = App_cst (f, a)
let const c = App_cst (c, IArray.empty)
let eq a b =

View file

@ -19,8 +19,6 @@ val app_cst : cst -> term IArray.t -> t
val eq : term -> term -> t
val if_ : term -> term -> term -> t
val is_value : t -> bool
val ty : t -> Ty.t
(** Compute the type of this term cell. Not totally free *)

View file

@ -86,7 +86,7 @@ module C = struct
let mk_cst ?(do_cc=false) id : cst =
{cst_id=id;
cst_view=Cst_def {
pp=None; abs; ty=get_ty; relevant; is_value=false; do_cc; eval=eval id; }; }
pp=None; abs; ty=get_ty; relevant; do_cc; eval=eval id; }; }
let not = mk_cst id_not
let and_ = mk_cst id_and