Commit dd07b7d3 authored by danfis's avatar danfis

bin/sym-reduce.c: Improved fixpoint computation

parent 40148988
......@@ -222,15 +222,13 @@ static int inferOpMutexes(const plan_strips_t *strips,
plan_op_mutex_pairs_t op_mutex_diff;
planOpMutexPairsInit(&op_mutex_fam, strips);
planOpMutexInferFAMGroups(&op_mutex_fam, strips, &mgroup, err);
planOpMutexPairsInit(&op_mutex_h2_comp, strips);
planOpMutexInferH2OpFactCompilation(&op_mutex_h2_comp, strips, err);
planOpMutexPairsInit(&op_mutex_h2_all, strips);
//planOpMutexInferH2FromEachOp(&op_mutex_h2_all, strips, mutex, NULL, err);
planOpMutexPairsInit(&op_mutex_uncover, strips);
planOpMutexInferFAMGroups(&op_mutex_fam, strips, &mgroup, err);
planOpMutexInferH2OpFactCompilation(&op_mutex_h2_comp, strips, err);
//planOpMutexInferH2FromEachOp(&op_mutex_h2_all, strips, mutex, NULL, err);
planOpMutexInferUncoveredFacts(&op_mutex_uncover, strips, &mgroup, err);
planOpMutexPairsUnion(op_mutex, &op_mutex_fam);
......@@ -364,18 +362,39 @@ static int reduceOpMutexSym(plan_strips_t *strips,
static int sym_reduce(plan_strips_t *strips, bor_err_t *err)
{
plan_mutex_pairs_t mutex;
int size;
int update_red = 1, update_op_mutex = 1;
while (update_red || update_op_mutex){
if (update_red){
update_red = 0;
size = planStripsFactsSize(&strips->fact);
size += planStripsOpsSize(&strips->op);
if (reduce(strips, &mutex, err) != 0)
BOR_TRACE_RET(err, -1);
size -= planStripsFactsSize(&strips->fact);
size -= planStripsOpsSize(&strips->op);
if (size > 0)
update_op_mutex = 1;
}
if (reduce(strips, &mutex, err) != 0)
BOR_TRACE_RET(err, -1);
if (update_op_mutex){
update_op_mutex = 0;
size = planStripsFactsSize(&strips->fact);
size += planStripsOpsSize(&strips->op);
int ret = 1;
while (ret == 1){
if ((ret = reduceOpMutexSym(strips, &mutex, err)) < 0)
BOR_TRACE_RET(err, -1);
}
int ret = 1;
while (ret == 1){
if ((ret = reduceOpMutexSym(strips, &mutex, err)) < 0)
BOR_TRACE_RET(err, -1);
}
if (reduce(strips, &mutex, err) != 0)
BOR_TRACE_RET(err, -1);
size -= planStripsFactsSize(&strips->fact);
size -= planStripsOpsSize(&strips->op);
if (size > 0)
update_red = 1;
}
}
planMutexPairsFree(&mutex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment