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