mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-10 21:24:06 -05:00
rename prop to bool
This commit is contained in:
parent
080a20480f
commit
5f6ded8566
6 changed files with 14 additions and 14 deletions
|
|
@ -61,7 +61,7 @@ and ty = {
|
||||||
}
|
}
|
||||||
|
|
||||||
and ty_view =
|
and ty_view =
|
||||||
| Ty_prop
|
| Ty_bool
|
||||||
| Ty_atomic of {
|
| Ty_atomic of {
|
||||||
def: ty_def;
|
def: ty_def;
|
||||||
args: ty list;
|
args: ty list;
|
||||||
|
|
@ -139,7 +139,7 @@ let pp_value out = function
|
||||||
let pp_db out (i,_) = Format.fprintf out "%%%d" i
|
let pp_db out (i,_) = Format.fprintf out "%%%d" i
|
||||||
|
|
||||||
let rec pp_ty out t = match t.ty_view with
|
let rec pp_ty out t = match t.ty_view with
|
||||||
| Ty_prop -> Fmt.string out "prop"
|
| Ty_bool -> Fmt.string out "prop"
|
||||||
| Ty_atomic {def=Ty_uninterpreted id; args=[]; _} -> ID.pp out id
|
| Ty_atomic {def=Ty_uninterpreted id; args=[]; _} -> ID.pp out id
|
||||||
| Ty_atomic {def=Ty_uninterpreted id; args; _} ->
|
| Ty_atomic {def=Ty_uninterpreted id; args; _} ->
|
||||||
Fmt.fprintf out "(@[%a@ %a@])" ID.pp id (Util.pp_list pp_ty) args
|
Fmt.fprintf out "(@[%a@ %a@])" ID.pp id (Util.pp_list pp_ty) args
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ let empty : t = {
|
||||||
(* get or make a default value for this type *)
|
(* get or make a default value for this type *)
|
||||||
let rec get_ty_default (ty:Ty.t) : Value.t =
|
let rec get_ty_default (ty:Ty.t) : Value.t =
|
||||||
match Ty.view ty with
|
match Ty.view ty with
|
||||||
| Ty_prop -> Value.true_
|
| Ty_bool -> Value.true_
|
||||||
| Ty_atomic { def = Ty_uninterpreted _;_} ->
|
| Ty_atomic { def = Ty_uninterpreted _;_} ->
|
||||||
(* domain element *)
|
(* domain element *)
|
||||||
Ty_tbl.get_or_add ty_tbl ~k:ty
|
Ty_tbl.get_or_add ty_tbl ~k:ty
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ type state = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let[@inline] make st (c:t term_view) : t =
|
let[@inline] make st (c:t term_view) : t =
|
||||||
let t = {term_id= -1; term_ty=Ty.prop; term_view=c} in
|
let t = {term_id= -1; term_ty=Ty.bool; term_view=c} in
|
||||||
let t' = H.hashcons st.tbl t in
|
let t' = H.hashcons st.tbl t in
|
||||||
if t == t' then (
|
if t == t' then (
|
||||||
t'.term_ty <- Term_cell.ty c;
|
t'.term_ty <- Term_cell.ty c;
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ let if_ a b c =
|
||||||
If (a,b,c)
|
If (a,b,c)
|
||||||
|
|
||||||
let ty (t:t): Ty.t = match t with
|
let ty (t:t): Ty.t = match t with
|
||||||
| Bool _ | Eq _ | Not _ -> Ty.prop
|
| Bool _ | Eq _ | Not _ -> Ty.bool
|
||||||
| App_cst (f, args) ->
|
| App_cst (f, args) ->
|
||||||
begin match Cst.view f with
|
begin match Cst.view f with
|
||||||
| Cst_undef fty ->
|
| Cst_undef fty ->
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,14 @@ let equal_def d1 d2 = match d1, d2 with
|
||||||
module H = Hashcons.Make(struct
|
module H = Hashcons.Make(struct
|
||||||
type t = ty
|
type t = ty
|
||||||
let equal a b = match a.ty_view, b.ty_view with
|
let equal a b = match a.ty_view, b.ty_view with
|
||||||
| Ty_prop, Ty_prop -> true
|
| Ty_bool, Ty_bool -> true
|
||||||
| Ty_atomic a1, Ty_atomic a2 ->
|
| Ty_atomic a1, Ty_atomic a2 ->
|
||||||
equal_def a1.def a2.def && CCList.equal equal a1.args a2.args
|
equal_def a1.def a2.def && CCList.equal equal a1.args a2.args
|
||||||
| Ty_prop, _ | Ty_atomic _, _
|
| Ty_bool, _ | Ty_atomic _, _
|
||||||
-> false
|
-> false
|
||||||
|
|
||||||
let hash t = match t.ty_view with
|
let hash t = match t.ty_view with
|
||||||
| Ty_prop -> 1
|
| Ty_bool -> 1
|
||||||
| Ty_atomic {def=Ty_uninterpreted id; args; _} ->
|
| Ty_atomic {def=Ty_uninterpreted id; args; _} ->
|
||||||
Hash.combine3 10 (ID.hash id) (Hash.list hash args)
|
Hash.combine3 10 (ID.hash id) (Hash.list hash args)
|
||||||
| Ty_atomic {def=Ty_def d; args; _} ->
|
| Ty_atomic {def=Ty_def d; args; _} ->
|
||||||
|
|
@ -47,10 +47,10 @@ let make_ : ty_view -> t =
|
||||||
H.hashcons tbl ty
|
H.hashcons tbl ty
|
||||||
|
|
||||||
let card t = match view t with
|
let card t = match view t with
|
||||||
| Ty_prop -> Finite
|
| Ty_bool -> Finite
|
||||||
| Ty_atomic {card=lazy c; _} -> c
|
| Ty_atomic {card=lazy c; _} -> c
|
||||||
|
|
||||||
let prop = make_ Ty_prop
|
let bool = make_ Ty_bool
|
||||||
|
|
||||||
let atomic def args : t =
|
let atomic def args : t =
|
||||||
let card = lazy (
|
let card = lazy (
|
||||||
|
|
@ -63,8 +63,8 @@ let atomic def args : t =
|
||||||
|
|
||||||
let atomic_uninterpreted id = atomic (Ty_uninterpreted id) []
|
let atomic_uninterpreted id = atomic (Ty_uninterpreted id) []
|
||||||
|
|
||||||
let is_prop t =
|
let is_bool t =
|
||||||
match t.ty_view with | Ty_prop -> true | _ -> false
|
match t.ty_view with | Ty_bool -> true | _ -> false
|
||||||
|
|
||||||
let is_uninterpreted t =
|
let is_uninterpreted t =
|
||||||
match t.ty_view with | Ty_atomic {def=Ty_uninterpreted _; _} -> true | _ -> false
|
match t.ty_view with | Ty_atomic {def=Ty_uninterpreted _; _} -> true | _ -> false
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ type def = Base_types.ty_def
|
||||||
val id : t -> int
|
val id : t -> int
|
||||||
val view : t -> view
|
val view : t -> view
|
||||||
|
|
||||||
val prop : t
|
val bool : t
|
||||||
val atomic : def -> t list -> t
|
val atomic : def -> t list -> t
|
||||||
|
|
||||||
val atomic_uninterpreted : ID.t -> t
|
val atomic_uninterpreted : ID.t -> t
|
||||||
|
|
||||||
val card : t -> ty_card
|
val card : t -> ty_card
|
||||||
|
|
||||||
val is_prop : t -> bool
|
val is_bool : t -> bool
|
||||||
val is_uninterpreted : t -> bool
|
val is_uninterpreted : t -> bool
|
||||||
|
|
||||||
include Intf.EQ with type t := t
|
include Intf.EQ with type t := t
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue