4-variable-simplifier/truthtable_set/add.c
2026-04-25 16:00:10 -04:00

36 lines
549 B
C

#include <debug.h>
#include <avl/avl.h>
#include "struct.h"
#include "add.h"
bool truthtable_set_add(
struct truthtable_set* this,
truthtable_t truthtable)
{
bool is_new;
struct avl_node_t* node = avl_search(this->tree, &truthtable);
if (node)
{
TODO;
}
else
{
is_new = true;
truthtable_t* item = smalloc(sizeof(*item));
*item = truthtable;
avl_insert(this->tree, item);
this->n++;
}
return is_new;
}