aboutsummaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/map.h16
-rw-r--r--inc/reduce.h2
-rw-r--r--inc/term.h2
3 files changed, 12 insertions, 8 deletions
diff --git a/inc/map.h b/inc/map.h
index 53b0c98..b389bfa 100644
--- a/inc/map.h
+++ b/inc/map.h
@@ -6,14 +6,16 @@
#include <lib/hash.h>
#include <lib/pqueue.h>
+#include <lib/hashmap.h>
-struct term *map_get(hash_t hash);
-void map_set(struct term *term, hash_t hash);
-void map_delete(struct term *term);
+struct hashmap *map_all_terms(void);
+struct term *map_get(struct hashmap *map, hash_t hash);
+void map_set(struct hashmap *map, struct term *term, hash_t hash);
+void map_delete(struct hashmap *map, struct term *term);
void map_initialize(void);
-void map_destroy(void);
-void map_dump(void); // TODO: remove
-struct pqueue *map_to_pqueue(pqueue_cmp_pri_f cmppri, pqueue_get_pri_f getpri,
- pqueue_set_pos_f set_pos);
+void map_destroy(struct hashmap *map);
+void map_dump(struct hashmap *map); // TODO: remove
+struct pqueue *map_to_pqueue(struct hashmap *map, pqueue_cmp_pri_f cmppri,
+ pqueue_get_pri_f getpri, pqueue_set_pos_f set_pos);
#endif
diff --git a/inc/reduce.h b/inc/reduce.h
index 9856075..4fff82f 100644
--- a/inc/reduce.h
+++ b/inc/reduce.h
@@ -6,6 +6,6 @@
#include <term.h>
-struct term *reduce(struct term *term);
+void reduce(struct term *term);
#endif
diff --git a/inc/term.h b/inc/term.h
index c94894d..3216e4a 100644
--- a/inc/term.h
+++ b/inc/term.h
@@ -5,12 +5,14 @@
#define CALM_TERM_H
#include <lib/hash.h>
+#include <lib/hashmap.h>
typedef enum { INV, ABS, APP, VAR } term_type_t;
struct term {
term_type_t type;
hash_t hash;
+ struct hashmap *parents;
size_t refs;
size_t depth;
union {