1
0
Fork 0
This commit is contained in:
Mylloon 2024-04-30 13:54:48 +02:00
parent d12641a7ef
commit fe03ff0351
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 5 additions and 0 deletions

View file

@ -20,6 +20,7 @@ type t =
| App of t * t
[@@deriving eq, ord, show]
(** string of Term *)
let rec string_of_term = function
| Var v -> "Var '" ^ v ^ "'"
| IntConst n -> string_of_int n

View file

@ -5,6 +5,7 @@ type t =
| Arrow of t * t
[@@deriving eq, ord, show]
(** string of Type *)
let rec string_of_type = function
| Var v -> "Var '" ^ v ^ "'"
| Int -> "Int"

View file

@ -39,6 +39,7 @@ let compose s2 s1 =
s2
;;
(** string of IdentifierMap *)
let to_string map =
let rec ty_str = function
| Type.Var s -> "Var('" ^ s ^ "')"
@ -53,8 +54,10 @@ let to_string map =
^ "}"
;;
(** Find an element in an IdentifierMap *)
let find = IdentifierMap.find_opt
(** Check if two IdentifierMap are equal *)
let equal map1 map2 =
let l_map1 = List.length (IdentifierMap.bindings map1) in
let l_map2 = List.length (IdentifierMap.bindings map2) in