Skip to content

Commit

Permalink
tweak to basetype definition
Browse files Browse the repository at this point in the history
  • Loading branch information
cp526 committed Sep 6, 2023
1 parent 467aa77 commit 22dd425
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 25 deletions.
9 changes: 3 additions & 6 deletions backend/cn/baseTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ type basetype =
| CType
| Struct of Sym.t
| Datatype of Sym.t
| Record of member_types
| Record of (Id.t * basetype) list
| Map of basetype * basetype
| List of basetype
| Tuple of basetype list
| Set of basetype
(* | Option of basetype *)
[@@deriving eq, ord]

and member_types =
(Id.t * basetype) list


type t = basetype

Expand All @@ -31,10 +28,10 @@ let compare = compare_basetype

type datatype_info = {
dt_constrs: Sym.t list;
dt_all_params: member_types;
dt_all_params: (Id.t * basetype) list;
}
type constr_info = {
c_params: member_types;
c_params: (Id.t * basetype) list;
c_datatype_tag: Sym.t
}

Expand Down
4 changes: 2 additions & 2 deletions backend/cn/solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ module Translate = struct
| StructFunc of { tag : Sym.t }
| CompFunc of { bts : BT.t list; i : int }
| TupleFunc of { bts : BT.t list }
| RecordFunc of { mbts : BT.member_types }
| RecordMemberFunc of { mbts : BT.member_types; member : Id.t }
| RecordFunc of { mbts : (Id.t * basetype) list }
| RecordMemberFunc of { mbts : (Id.t * basetype) list; member : Id.t }
| DefaultFunc of { bt : BT.t }
| DatatypeConsFunc of { nm: Sym.t }
| DatatypeConsRecogFunc of { nm: Sym.t }
Expand Down
17 changes: 1 addition & 16 deletions backend/cn/surfaceBaseTypes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ type basetype =
| Loc of Sctypes.t option
| Struct of Sym.t
| Datatype of Sym.t
| Record of member_types
| Record of (Id.t * basetype) list
| Map of basetype * basetype
| List of basetype
| Tuple of basetype list
| Set of basetype
(* | Option of basetype *)
[@@deriving eq, ord]

and member_types =
(Id.t * basetype) list


type t = basetype
Expand All @@ -31,19 +29,6 @@ let equal = equal_basetype
let compare = compare_basetype


type datatype_info = {
dt_constrs: Sym.t list;
dt_all_params: member_types;
}
type constr_info = {
c_params: member_types;
c_datatype_tag: Sym.t
}

let cons_dom_rng info =
(Record info.c_params, Datatype info.c_datatype_tag)


let rec pp = function
| Unit -> !^"void"
| Bool -> !^"bool"
Expand Down
2 changes: 1 addition & 1 deletion backend/cn/typing.mli
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ val ensure_base_type: Locations.t -> expect:LogicalSorts.t -> LogicalSorts.t ->
val make_return_record:
Locations.t ->
string ->
BaseTypes.member_types ->
(Id.t * BaseTypes.t) list ->
(IndexTerms.t * IndexTerms.t list) m

val bind_logical_return:
Expand Down

0 comments on commit 22dd425

Please sign in to comment.