diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/map.h | 16 | ||||
-rw-r--r-- | inc/reduce.h | 2 | ||||
-rw-r--r-- | inc/term.h | 2 |
3 files changed, 12 insertions, 8 deletions
@@ -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 @@ -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 { |