struct fsm* ConditionMerger::union_trees(struct fsm* fst1, struct fsm* fst2) { struct fsm* ret = fsm_topsort( fsm_minimize( fsm_determinize( fsm_union( fsm_copy(fst1), fsm_copy(fst2))))); fsm_sort_arcs(ret, 1); return ret; }
struct fsm *fsm_minimize(struct fsm *net) { extern int g_minimal; extern int g_minimize_hopcroft; if (net == NULL) { return NULL; } /* The network needs to be deterministic and trim before we minimize */ if (net->is_deterministic != YES) net = fsm_determinize(net); if (net->is_pruned != YES) net = fsm_coaccessible(net); if (net->is_minimized != YES && g_minimal == 1) { if (g_minimize_hopcroft != 0) { net = fsm_minimize_hop(net); } else net = fsm_minimize_brz(net); fsm_update_flags(net,YES,YES,YES,YES,UNK,UNK); } return(net); }
static struct fsm *fsm_minimize_brz(struct fsm *net) { return(fsm_determinize(fsm_reverse(fsm_determinize(fsm_reverse(net))))); }