예제 #1
0
        public Equivalent(Equivalent another)
        {
            torso = new ArrayList();

            Oid refOid = null;
            torso = new ArrayList();

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

                if (another.Torso != null)
                {
                    Torso[] items = (Torso[])another.Torso.Clone();
                    torso.Clear();
                    foreach (Torso item in items)
                    {
                        torso.Add(new Torso(item));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
        }
예제 #2
0
        public ForAllFormula(ForAllFormula another)
        {
            Atom refAtom = null;
            ForAll refForall = null;
            Implies refImplies = null;
            Equivalent refEquivalent = null;

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

                if (another.Equivalent != null)
                {
                    refEquivalent = (Equivalent)another.Equivalent.Clone();
                }

                if (another.Implies != null)
                {
                    refImplies = (Implies)another.Implies.Clone();
                }

                if (another.InnerForAll != null)
                {
                    refForall = (ForAll)another.InnerForAll.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            atom = refAtom;
            imp = refImplies;
            forall = refForall;
            eq = refEquivalent;
        }
예제 #3
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Equivalent other = new Equivalent((Equivalent)o);

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

            if (this.Torso.Length != other.Torso.Length)
            {
                return false;
            }

            for (int i = 0; i < Torso.Length; i++)
            {
                if (!Torso[i].Equals(other.Torso[i]))
                {
                    return false;
                }
            }

            return true;
        }