Skip to content

Commit

Permalink
Move typed symbols from ModelMap to Id
Browse files Browse the repository at this point in the history
  • Loading branch information
Halbaroth committed Jan 2, 2024
1 parent f451ee0 commit fd6d11f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/lib/structures/id.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

type t = Hstring.t [@@deriving ord]

type typed = t * Ty.t list * Ty.t [@@deriving ord]

let equal = Hstring.equal

let pp ppf id =
Expand Down
7 changes: 7 additions & 0 deletions src/lib/structures/id.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@

type t = Hstring.t [@@deriving ord]

type typed = t * Ty.t list * Ty.t
(** Typed identifier of function. In order:
- The identifier.
- Types of its arguments.
- The returned type. *)

val compare_typed : typed -> typed -> int
val equal : t -> t -> bool
val show : t -> string
val pp : t Fmt.t
Expand Down
6 changes: 2 additions & 4 deletions src/lib/structures/modelMap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
module X = Shostak.Combine
module Sy = Symbols

type sy = Id.t * Ty.t list * Ty.t [@@deriving ord]

module Graph = struct
module M = Map.Make
(struct
Expand Down Expand Up @@ -113,9 +111,9 @@ end

module P = Map.Make
(struct
type t = sy
type t = Id.typed

let compare = compare_sy
let compare = Id.compare_typed
end)

type t = {
Expand Down
8 changes: 1 addition & 7 deletions src/lib/structures/modelMap.mli
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,10 @@
(* *)
(**************************************************************************)

type sy = Id.t * Ty.t list * Ty.t
(** Typed symbol of function defined in the model. In order:
- The identifier of the symbol.
- The types of its arguments.
- The returned type. *)

type t
(** Type of model. *)

val add : sy -> Expr.t list -> Expr.t -> t -> t
val add : Id.typed -> Expr.t list -> Expr.t -> t -> t
(** [add sy args ret mdl] adds the binding [args -> ret] to the partial graph
associated with the symbol [sy]. *)

Expand Down

0 comments on commit fd6d11f

Please sign in to comment.