static Automaton <T> CreateAutomaton1 <T>(Func <int, T> f, int bitWidth, IBooleanAlgebra <T> Z) { Func <int, string, MSOPredicate <T> > pred = (i, s) => new MSOPredicate <T>(f(i), new Variable(s, true)); MSOFormula <T> phi = new MSOFalse <T>(); for (int index = 0; index < bitWidth; index++) { var phi1 = pred(index, "var"); phi = new MSOOr <T>(phi, phi1); } phi = new MSOExists <T>(new Variable("var", true), phi); var aut = phi.GetAutomaton(Z); return(aut); }
Automaton <T> CreateAutomaton2 <T>(Func <int, T> f, int bitWidth, IBooleanAlgebra <T> Z) { Func <int, Variable, MSOPredicate <T> > pred = (i, s) => new MSOPredicate <T>(f(i), s); MSOFormula <T> phi = new MSOFalse <T>(); for (int index = 0; index < bitWidth; index++) { MSOFormula <T> phi1 = pred(index, V1("var")); phi1 = new MSOExists <T>(V1("var"), phi1); phi = new MSOOr <T>(phi, phi1); } phi = new MSOExists <T>(V1("var"), phi); var aut = phi.GetAutomaton(Z); return(aut); }
Automaton <T> CreateAutomaton1 <T>(Func <int, T> f, int bitWidth, IBooleanAlgebra <T> Z) { Func <int, string, MSOPredicate <T> > pred = (i, s) => new MSOPredicate <T>(f(i), s); MSOFormula <T> phi = new MSOFalse <T>(); for (int index = 0; index < bitWidth; index++) { var phi1 = pred(index, "var"); phi = new MSOOr <T>(phi, phi1); } phi = new MSOExistsFo <T>("var", phi); var aut = phi.GetAutomaton(Z); //aut.ShowGraph("aut"); return(aut); }