mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 19:25:36 -05:00
refactor: small cleanup in terms
This commit is contained in:
parent
a14fe25ba0
commit
1ef0cf4183
6 changed files with 1 additions and 17 deletions
|
|
@ -42,7 +42,6 @@ and cst_view =
|
||||||
do_cc: bool; (* participate in congruence closure? *)
|
do_cc: bool; (* participate in congruence closure? *)
|
||||||
relevant : 'a. ID.t -> 'a IArray.t -> int -> bool; (* relevant argument? *)
|
relevant : 'a. ID.t -> 'a IArray.t -> int -> bool; (* relevant argument? *)
|
||||||
ty : ID.t -> term IArray.t -> ty; (* compute type *)
|
ty : ID.t -> term IArray.t -> ty; (* compute type *)
|
||||||
is_value: bool; (* value constructor *)
|
|
||||||
eval: value IArray.t -> value; (* evaluate term *)
|
eval: value IArray.t -> value; (* evaluate term *)
|
||||||
}
|
}
|
||||||
(** Methods on the custom term view whose arguments are ['a].
|
(** Methods on the custom term view whose arguments are ['a].
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,6 @@ let create ?(size=1024) () : state =
|
||||||
ignore (Lazy.force st.false_); (* not true *)
|
ignore (Lazy.force st.false_); (* not true *)
|
||||||
st
|
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 app_cst st f a =
|
||||||
let cell = Term_cell.app_cst f a in
|
let cell = Term_cell.app_cst f a in
|
||||||
make st cell
|
make st cell
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,8 @@ val abs : t -> t * bool
|
||||||
|
|
||||||
val to_seq : t -> t Sequence.t
|
val to_seq : t -> t Sequence.t
|
||||||
|
|
||||||
val all_terms : state -> t Sequence.t
|
|
||||||
|
|
||||||
val pp : t Fmt.printer
|
val pp : t Fmt.printer
|
||||||
|
|
||||||
val is_value : t -> bool
|
|
||||||
(** Values are special terms that behave specially wrt congruence/equality *)
|
|
||||||
|
|
||||||
(** {6 Views} *)
|
(** {6 Views} *)
|
||||||
|
|
||||||
val is_true : t -> bool
|
val is_true : t -> bool
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,6 @@ include Make_eq(struct
|
||||||
let true_ = Bool true
|
let true_ = Bool true
|
||||||
let false_ = Bool false
|
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 app_cst f a = App_cst (f, a)
|
||||||
let const c = App_cst (c, IArray.empty)
|
let const c = App_cst (c, IArray.empty)
|
||||||
let eq a b =
|
let eq a b =
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ val app_cst : cst -> term IArray.t -> t
|
||||||
val eq : term -> term -> t
|
val eq : term -> term -> t
|
||||||
val if_ : term -> term -> term -> t
|
val if_ : term -> term -> term -> t
|
||||||
|
|
||||||
val is_value : t -> bool
|
|
||||||
|
|
||||||
val ty : t -> Ty.t
|
val ty : t -> Ty.t
|
||||||
(** Compute the type of this term cell. Not totally free *)
|
(** Compute the type of this term cell. Not totally free *)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ module C = struct
|
||||||
let mk_cst ?(do_cc=false) id : cst =
|
let mk_cst ?(do_cc=false) id : cst =
|
||||||
{cst_id=id;
|
{cst_id=id;
|
||||||
cst_view=Cst_def {
|
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 not = mk_cst id_not
|
||||||
let and_ = mk_cst id_and
|
let and_ = mk_cst id_and
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue