aboutsummaryrefslogtreecommitdiff
path: root/inc/term.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/term.h')
-rw-r--r--inc/term.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/term.h b/inc/term.h
index f241fa2..0e5902d 100644
--- a/inc/term.h
+++ b/inc/term.h
@@ -12,6 +12,7 @@ typedef enum { INV, ABS, APP, VAR } term_type_t;
struct term {
term_type_t type;
+
hash_t hash;
struct hashmap *parents;
size_t refs;
@@ -35,6 +36,7 @@ struct term {
};
struct term *term_new(term_type_t type, hash_t hash, size_t depth);
+void term_destroy_head(struct term *term, char including_parents);
char term_is_beta_redex(struct term *term);
void term_rehash_parents(struct term *term);
struct term *term_rehash(struct term *term);
@@ -44,8 +46,8 @@ struct term *term_rehash_app(struct term *head, struct term *lhs,
struct term *term_rehash_var(struct term *head, size_t index);
void term_refer_head(struct term *term, size_t depth);
void term_refer(struct term *term, size_t depth);
-void term_deref_head(struct term *term);
-void term_deref(struct term *term);
+char term_deref_head(struct term *term, char destroy_parents);
+char term_deref(struct term *term, char destroy_parents);
void term_print(struct term *term);