public void checkEval() { PDLPred phi = new PDLIntEq(new PDLIndicesOf("aaa"), 1); System.Console.WriteLine("Exactly once aaa:"); System.Console.WriteLine(phi.Eval("baaaabbb", new Dictionary <string, int>())); PDLPred phi1 = new PDLNot(new PDLIntLeq(new PDLIndicesOf("aa"), 0)); PDLPred phi2 = (new PDLBelongs(new PDLPredecessor(new PDLLast()), new PDLIndicesOf("ab"))); //System.Console.WriteLine("prevLast " + (new PDLprev(new PDLlast())).Eval("aaabbccab", new Dictionary<string, int>())); //System.Console.WriteLine("indab " + (new PDLindicesOf("ab")).Eval("aaabbccab", new Dictionary<string, int>())); //System.Console.WriteLine("phi2 " + phi2.Eval("aaabbccab", new Dictionary<string, int>())); phi = new PDLAnd(phi1, new PDLNot(phi2)); System.Console.WriteLine("Contains aa and not end ab:"); System.Console.WriteLine(phi.Eval("aaabbccabc", new Dictionary <string, int>())); phi = new PDLAnd(new PDLIf(new PDLAtPos('a', new PDLFirst()), new PDLAtPos('a', new PDLLast())), new PDLIf(new PDLAtPos('b', new PDLFirst()), new PDLAtPos('b', new PDLLast()))); System.Console.WriteLine("Same First Last:"); System.Console.WriteLine(phi.Eval("abbba", new Dictionary <string, int>())); phi = new PDLExistsFO("x0", new PDLAtPos('a', new PDLPosVar("x0"))); System.Console.WriteLine("exists a:"); System.Console.WriteLine(phi.Eval("ab", new Dictionary <string, int>())); phi = new PDLEndsWith("abc"); System.Console.WriteLine("ends with abc:"); System.Console.WriteLine(phi.Eval("bc", new Dictionary <string, int>())); phi = new PDLStartsWith("abc"); System.Console.WriteLine("starts with abc:"); System.Console.WriteLine(phi.Eval("abcababcccabc", new Dictionary <string, int>())); }
public void checkEval() { PDLPred phi = new PDLIntEq(new PDLIndicesOf("aaa"), 1); System.Console.WriteLine("Exactly once aaa:"); System.Console.WriteLine(phi.Eval("baaaabbb", new Dictionary<string, int>())); PDLPred phi1 = new PDLNot(new PDLIntLeq(new PDLIndicesOf("aa"), 0)); PDLPred phi2 = (new PDLBelongs(new PDLPredecessor(new PDLLast()), new PDLIndicesOf("ab"))); //System.Console.WriteLine("prevLast " + (new PDLprev(new PDLlast())).Eval("aaabbccab", new Dictionary<string, int>())); //System.Console.WriteLine("indab " + (new PDLindicesOf("ab")).Eval("aaabbccab", new Dictionary<string, int>())); //System.Console.WriteLine("phi2 " + phi2.Eval("aaabbccab", new Dictionary<string, int>())); phi = new PDLAnd(phi1, new PDLNot(phi2)); System.Console.WriteLine("Contains aa and not end ab:"); System.Console.WriteLine(phi.Eval("aaabbccabc", new Dictionary<string, int>())); phi = new PDLAnd(new PDLIf(new PDLAtPos('a', new PDLFirst()), new PDLAtPos('a', new PDLLast())), new PDLIf(new PDLAtPos('b', new PDLFirst()), new PDLAtPos('b', new PDLLast()))); System.Console.WriteLine("Same First Last:"); System.Console.WriteLine(phi.Eval("abbba", new Dictionary<string, int>())); phi = new PDLExistsFO("x0", new PDLAtPos('a', new PDLPosVar("x0"))); System.Console.WriteLine("exists a:"); System.Console.WriteLine(phi.Eval("ab", new Dictionary<string, int>())); phi = new PDLEndsWith("abc"); System.Console.WriteLine("ends with abc:"); System.Console.WriteLine(phi.Eval("bc", new Dictionary<string, int>())); phi = new PDLStartsWith("abc"); System.Console.WriteLine("starts with abc:"); System.Console.WriteLine(phi.Eval("abcababcccabc", new Dictionary<string, int>())); }