Ejemplo n.º 1
0
        public Or(Or another)
        {
            Oid refOid = null;
            formula = new ArrayList();

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

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

            oid = refOid;
            isCorrected = another.isCorrected;
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
0
        public AndOrFormula(AndOrFormula another)
        {
            Atom refAtom = null;
            And refAnd = null;
            Or refOr = null;

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

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

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

            atom = refAtom;
            and = refAnd;
            or = refOr;
        }
Ejemplo n.º 4
0
        public Integrity(Integrity another)
        {
            Oid refOid = null;
            Atom refAtom = null;
            Or refOr = null;
            And refAnd = null;
            AndOrFormula refFormula = null;

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

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

                if (another.InnerOr != null)
                {
                    refOr = (Or)another.InnerOr.Clone();
                }

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

                if (another.Formula != null)
                {
                    refFormula = (AndOrFormula)another.Formula.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            and = refAnd;
            or = refOr;
            formula = refFormula;
            atom = refAtom;
        }
Ejemplo n.º 5
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Or other = new Or((Or)o);

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

            if (this.formula.Count != other.formula.Count)
            {
                return false;
            }

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

            return true;
        }