work on type inference some more
[ccc.git] / sem / hm / subst.h
1 #ifndef SEM_HM_SUBST_H
2 #define SEM_HM_SUBST_H
3
4 #include "../../ast.h"
5 #include "../hm.h"
6
7 struct subst {
8 int nvar;
9 char **vars;
10 struct type **types;
11 };
12
13 struct subst *subst_id();
14 struct subst *subst_singleton(char *ident, struct type *t);
15 struct subst *subst_union(struct subst *l, struct subst *r);
16
17 struct type *subst_apply_t(struct subst *subst, struct type *l);
18 struct scheme *subst_apply_s(struct subst *subst, struct scheme *scheme);
19 struct gamma *subst_apply_g(struct subst *subst, struct gamma *gamma);
20
21 void subst_print(struct subst *s, FILE *out);
22 void subst_free(struct subst *s, bool type);
23
24 #endif