예제 #1
0
        public bool TrueIn(NullPredicate aPredicate, uint aKindOfWorld)
        {
            for (int i = 0; i < mNullPredicates.Length; i++)
            {
                if (aPredicate.Equals(mNullPredicates[i]))
                {
                    return(VerifiesPredicate(aKindOfWorld, i));
                }
            }

            throw new EngineException("Null predicate {0}. not found in proposition.", aPredicate);
        }
예제 #2
0
        public NullPredicate AddNullPredicate(char aSymbol)
        {
            if (mNullPredicates.ContainsKey(aSymbol))
            {
                return(mNullPredicates[aSymbol]);
            }
            else
            {
                NullPredicate aPredicate = Factory.NullPredicate(aSymbol.ToString());

                mNullPredicates.Add(aSymbol, aPredicate);

                return(aPredicate);
            }
        }
예제 #3
0
        public void Test_Bits_Needed_Modal()
        {
            NullPredicate[]  lNullPredicates  = new NullPredicate[34];
            UnaryPredicate[] lUnaryPredicates = new UnaryPredicate[7];
            bool[ , , ] lMap = new bool[lNullPredicates.Length + 2, lUnaryPredicates.Length + 2, 19];

            for (int n = lNullPredicates.Length; n >= 0; n--)
            {
                for (int u = lUnaryPredicates.Length; u >= 0; u--)
                {
                    for (int i = 17; i >= 1 || (i == 0 && u == 0); i--)
                    {
                        try
                        {
                            new Predicates(lNullPredicates.Take(n), lUnaryPredicates.Take(u), i, true, 0);
                            lMap[n, u, i] = true;
                        }
                        catch (EngineException)
                        {
                        }
                    }
                }
            }

            for (int n = lNullPredicates.Length; n >= 0; n--)
            {
                for (int u = lUnaryPredicates.Length; u >= 0; u--)
                {
                    for (int i = 17; i >= 1 || (i == 0 && u == 0); i--)
                    {
                        if (lMap[n, u, i] && !lMap[n + 1, u, i] && !lMap[n, u + 1, i] && !lMap[n, u, i + 1])
                        {
                            //Console.WriteLine( "n = {0}, u = {1}, i = {2}, t = {3}", n, u, i, t );
                            Console.WriteLine("  <tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>", n, u, i);
                        }
                    }
                }
            }

            new Predicates(lNullPredicates.Take(32), lUnaryPredicates.Take(0), 0, false, 0);
        }
예제 #4
0
 public bool Denies(NullPredicate aPredicate)
 {
     return(mPredicates.ContainsKey(aPredicate) ? !mPredicates[aPredicate] : false);
 }
예제 #5
0
 public bool Affirms(NullPredicate aPredicate)
 {
     return(mPredicates.ContainsKey(aPredicate) ? mPredicates[aPredicate] : false);
 }