Ignore:
Timestamp:
Jul 8, 2015, 2:59:03 PM (4 years ago)
Author:
nmedfort
Message:

Partial roll back of Trie structure. Seemed to introduce the potential of generating a cycle in the AST. More analysis is needed here before mixing together multiple Advance DAG traversals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r4649 r4650  
    509509        PabloAST * m2 = pb.createOr(base, starAccum);
    510510        PabloAST * loopComputation = markerVar(AdvanceMarker(process(repeated, makeMarker(InitialPostPositionByte, m1), pb), InitialPostPositionByte, pb));
    511         PabloAST * starPending_ = pb.createAnd(loopComputation, pb.createNot(m2));
    512         PabloAST * starAccum_ = pb.createOr(loopComputation, m2);
    513         mWhileTest = pb.createOr(mWhileTest, starPending_);
    514        
    515         Next * nextPending = pb.createNext(starPending, starPending_);
    516         Next * nextStarAccum = pb.createNext(starAccum, starAccum_);
     511        Next * nextPending = pb.createNext(starPending, pb.createAnd(loopComputation, pb.createNot(m2)));
     512        Next * nextStarAccum = pb.createNext(starAccum, pb.createOr(loopComputation, m2));
     513        mWhileTest = pb.createOr(mWhileTest, nextPending);
    517514        mLoopVariants.push_back(nextPending);
    518515        mLoopVariants.push_back(nextStarAccum);
    519516        mStarDepth--;
    520517       
    521         return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", pb.createOr(base, starAccum_)));
     518        return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", pb.createOr(base, nextStarAccum)));
    522519    }   
    523520    else {
     
    531528
    532529        PabloAST * loopComputation = markerVar(AdvanceMarker(process(repeated, makeMarker(InitialPostPositionByte, whilePending), wb), InitialPostPositionByte, wb));
    533         PabloAST * whilePending_ = wb.createAnd(loopComputation, wb.createNot(whileAccum));
    534         PabloAST * whileAccum_ = wb.createOr(loopComputation, whileAccum);
    535         PabloAST * whileTest_ = wb.createOr(mWhileTest, whilePending_);
    536         Next * nextWhilePending = wb.createNext(whilePending, whilePending_);
    537         Next * nextWhileAccum = wb.createNext(whileAccum, whileAccum_);
    538         Next * nextWhileTest = wb.createNext(whileTest, whileTest_);
     530        Next * nextWhilePending = wb.createNext(whilePending, wb.createAnd(loopComputation, wb.createNot(whileAccum)));
     531        Next * nextWhileAccum = wb.createNext(whileAccum, wb.createOr(loopComputation, whileAccum));
     532        Next * nextWhileTest = wb.createNext(whileTest, wb.createOr(mWhileTest, nextWhilePending));
    539533        mLoopVariants.push_back(nextWhilePending);
    540534        mLoopVariants.push_back(nextWhileAccum);
    541535        mLoopVariants.push_back(nextWhileTest);
    542         pb.createWhile(whileTest_, mLoopVariants, wb);
     536        pb.createWhile(nextWhileTest, mLoopVariants, wb);
    543537        mStarDepth--;
    544538        mLoopVariants.clear();
    545         return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", whileAccum_));
     539        return makeMarker(InitialPostPositionByte, pb.createAssign("unbounded", nextWhileAccum));
    546540    }   
    547541} // end of namespace re
Note: See TracChangeset for help on using the changeset viewer.