//For random strategy: /// <summary> /// Used during game: /// 2. Step Condition Check of the Duplicator: Fp(alpha(x)) smaller Fp(alpha(y)) </summary> /// <param name="predicate"> the move of spoiler p_1</param> /// <param name="t1"> Fp(alpha(x))</param> /// <param name="t2"> Fp(alpha(y))</param> public bool getRandomPredicate_HelperMethod(List <int> predicate_1, List <int> predicate_2, List <List <int> > t1, List <List <int> > t2) { List <List <int> > Fp1_t1 = ReturnFp(predicate_1)(t1); List <List <int> > Fp2_t2 = ReturnFp(predicate_2)(t2); if (Fp1_t1.Count == 0 && Fp2_t2.Count == 0) { return(false); } int alphabets = Fp2_t2.Count; bool ret = false; if (Fp1_t1.Count == 0 && Fp2_t2.Count == 0) { return(false); } else { // has to satisfy this for all alphabets: for (int i = 0; i < alphabets; i++) { if (Fp2_t2[i].Contains(1) && Fp1_t1[i].Count != 0) { ret = true; //{0,1} <= {1} } if ((Fp1_t1[i].Contains(0) && Fp1_t1[i].Count == 1) && (Fp2_t2[i].Count != 0)) { ret = true; //{0} <= {0,1} and {0} <= {1} } } } return(ret); }
public string Fpalpha_xToString(int state, List <int> predicate, Matrix <List <List <int> >, int> ts) { string ret = "{"; List <List <int> > t = ReturnAlpha_X(state, ts.columns(), ts, ts.Alphabet); List <List <int> > Fp_t = ReturnFp(predicate)(t); int alphabets = Fp_t.Count; // has to satisfy this for all alphabets: for (int i = 0; i < alphabets; i++) { if (i != 0 && !ret.Substring(ret.Length - 1).Equals("{")) { if (Fp_t[i].Contains(0) && Fp_t[i].Contains(1)) { ret = ret + ",(" + ts.Alphabet[i].ToString() + ",0)" + "," + "(" + ts.Alphabet[i].ToString() + ",1)"; } if (Fp_t[i].Contains(0) && !Fp_t[i].Contains(1)) { ret = ret + ",(" + ts.Alphabet[i].ToString() + ",0)"; } if (Fp_t[i].Contains(1) && !Fp_t[i].Contains(0)) { ret = ret + ",(" + ts.Alphabet[i].ToString() + ",1)"; } } else { if (Fp_t[i].Contains(0) && Fp_t[i].Contains(1)) { ret = ret + "(" + ts.Alphabet[i].ToString() + ",0)" + "," + "(" + ts.Alphabet[i].ToString() + ",1)"; } if (Fp_t[i].Contains(0) && !Fp_t[i].Contains(1)) { ret = ret + "(" + ts.Alphabet[i].ToString() + ",0)"; } if (Fp_t[i].Contains(1) && !Fp_t[i].Contains(0)) { ret = ret + "(" + ts.Alphabet[i].ToString() + ",1)"; } } } ret = ret + "}"; return(ret); }