public void LLConfEmptyPushPeekTest() { CharSymbol chSym = new CharSymbol('A'); var ll = new LlConfiguration <CharSymbol>(chSym); Assert.AreEqual(ll.Push(states["A1"]).Peek(), states["A1"]); }
public void LLConfEmptyPushTest() { CharSymbol chSym = new CharSymbol('A'); var imList = ImmutableList.Create(states["A1"]); var ll = new LlConfiguration <CharSymbol>(chSym); Assert.AreEqual(ll.Push(states["A1"]).stack, imList); }
public void LLConfThreePushEqualTest() { CharSymbol chSym = new CharSymbol('A'); var targetList = ImmutableList.Create(states["A1"], states["B2"], states["A3"]); var ll1 = new LlConfiguration <CharSymbol>(chSym); var ll2 = new LlConfiguration <CharSymbol>(chSym, targetList); Assert.AreEqual(ll1.Push(states["A1"]).Push(states["B2"]).Push(states["A3"]), ll2); }
public void LLConfEmptyPushEqualTest() { CharSymbol chSym = new CharSymbol('A'); var imList = ImmutableList.Create(states["A3"]); var ll1 = new LlConfiguration <CharSymbol>(chSym); var ll2 = new LlConfiguration <CharSymbol>(chSym, imList); Assert.AreEqual(ll1.Push(states["A3"]), ll2); }
public void LLConfPushCountTest() { CharSymbol chSym = new CharSymbol('A'); var stack = new Stack <DfaState <CharSymbol> >(); stack.Push(states["A1"]); stack.Push(states["A2"]); var ll = new LlConfiguration <CharSymbol>(chSym, stack); Assert.AreEqual(ll.Push(states["A3"]).Count(), 3); }
public void LLConfSubsumesFalseTest() { CharSymbol chSym = new CharSymbol('A'); var llA = new LlConfiguration <CharSymbol>(chSym); var llB = new LlConfiguration <CharSymbol>(chSym); llA = llA.Push(states["B2"]).Push(states["A3"]); llB = llB.Push(states ["A1"]).Push(states ["A2"]).Push(states ["A3"]); bool result = llA.Subsumes(llB); Assert.AreEqual(false, result); }