comments
This commit is contained in:
parent
d12641a7ef
commit
fe03ff0351
3 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,7 @@ type t =
|
||||||
| App of t * t
|
| App of t * t
|
||||||
[@@deriving eq, ord, show]
|
[@@deriving eq, ord, show]
|
||||||
|
|
||||||
|
(** string of Term *)
|
||||||
let rec string_of_term = function
|
let rec string_of_term = function
|
||||||
| Var v -> "Var '" ^ v ^ "'"
|
| Var v -> "Var '" ^ v ^ "'"
|
||||||
| IntConst n -> string_of_int n
|
| IntConst n -> string_of_int n
|
||||||
|
|
|
@ -5,6 +5,7 @@ type t =
|
||||||
| Arrow of t * t
|
| Arrow of t * t
|
||||||
[@@deriving eq, ord, show]
|
[@@deriving eq, ord, show]
|
||||||
|
|
||||||
|
(** string of Type *)
|
||||||
let rec string_of_type = function
|
let rec string_of_type = function
|
||||||
| Var v -> "Var '" ^ v ^ "'"
|
| Var v -> "Var '" ^ v ^ "'"
|
||||||
| Int -> "Int"
|
| Int -> "Int"
|
||||||
|
|
|
@ -39,6 +39,7 @@ let compose s2 s1 =
|
||||||
s2
|
s2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(** string of IdentifierMap *)
|
||||||
let to_string map =
|
let to_string map =
|
||||||
let rec ty_str = function
|
let rec ty_str = function
|
||||||
| Type.Var s -> "Var('" ^ s ^ "')"
|
| Type.Var s -> "Var('" ^ s ^ "')"
|
||||||
|
@ -53,8 +54,10 @@ let to_string map =
|
||||||
^ "}"
|
^ "}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(** Find an element in an IdentifierMap *)
|
||||||
let find = IdentifierMap.find_opt
|
let find = IdentifierMap.find_opt
|
||||||
|
|
||||||
|
(** Check if two IdentifierMap are equal *)
|
||||||
let equal map1 map2 =
|
let equal map1 map2 =
|
||||||
let l_map1 = List.length (IdentifierMap.bindings map1) in
|
let l_map1 = List.length (IdentifierMap.bindings map1) in
|
||||||
let l_map2 = List.length (IdentifierMap.bindings map2) in
|
let l_map2 = List.length (IdentifierMap.bindings map2) in
|
||||||
|
|
Reference in a new issue