Пример #1
0
        public Body(Body another)
        {
            Atom refAtom = null;
            And refAnd = null;
            Or refOr = null;

            try
            {
                if (another.And != null)
                {
                    refAnd = (And)another.And.Clone();
                }

                if (another.Atom != null)
                {
                    refAtom = (Atom)another.Atom.Clone();
                }

                if (another.Or != null)
                {
                    refOr = (Or)another.Or.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            cf = another.cf;
            or = refOr;
            and = refAnd;
            atom = refAtom;
        }
Пример #2
0
        public Implies(Implies another)
        {
            Oid refOid = null;
            Head refHead = null;
            Body refBody = null;

            try
            {
                if (another.Oid != null)
                {
                    refOid = (Oid)another.Oid.Clone();
                }

                if (another.Body != null)
                {
                    refBody = (Body)another.Body.Clone();
                }

                if (another.Head != null)
                {
                    refHead = (Head)another.Head.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            body = refBody;
            head = refHead;
        }
Пример #3
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Body other = new Body((Body)o);

            if (this.Atom != null)
            {
                if (!this.Atom.Equals(other.Atom))
                {
                    return false;
                }
            }

            if (this.Or != null)
            {
                if (!this.Or.Equals(other.Or))
                {
                    return false;
                }
            }

            if (this.And != null)
            {
                if (!this.And.Equals(other.And))
                {
                    return false;
                }
            }

            return true;
        }