コード例 #1
0
 public override bool Equals(object obj)
 {
     if (obj is KnowPredicate)
     {
         KnowPredicate kp = (KnowPredicate)obj;
         if (Value == kp.Value && Negation == kp.Negation)
         {
             return(Knowledge.Equals(kp.Knowledge));
         }
     }
     return(false);
 }
コード例 #2
0
        public override Predicate Negate()
        {
            /*
             * KnowPredicate kpNegate = new KnowPredicate(Knowledge, Value, Parametrized);
             * kpNegate.Negation = !Negation;
             * return kpNegate;
             */
            KnowPredicate kpNegate = new KnowPredicate(this);

            kpNegate.Negation = !Negation;
            return(kpNegate);
        }
コード例 #3
0
        public override Predicate ToTag()
        {
            KnowPredicate ppNew = new KnowPredicate(this);

            if (Negation)
            {
                ppNew.Name = ppNew.Name + "-Remove";
            }
            else
            {
                ppNew.Name = ppNew.Name + "-Add";
            }
            ppNew.Negation = false;
            return(ppNew);
        }
コード例 #4
0
 public KnowPredicate(KnowPredicate kp) : base(kp.Name)
 {
     Knowledge    = kp.Knowledge;
     Value        = kp.Value;
     Parametrized = kp.Parametrized;
 }
コード例 #5
0
        public override Predicate Clone()
        {
            KnowPredicate kp = new KnowPredicate(Knowledge.Clone());

            return(kp);
        }