Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public KnowPredicate(KnowPredicate kp) : base(kp.Name)
 {
     Knowledge    = kp.Knowledge;
     Value        = kp.Value;
     Parametrized = kp.Parametrized;
 }
Exemplo n.º 5
0
        public override Predicate Clone()
        {
            KnowPredicate kp = new KnowPredicate(Knowledge.Clone());

            return(kp);
        }