Example #1
0
        public Query(Query another)
        {
            formula = new ArrayList();
            Oid refOid = null;

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

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

            oid = refOid;
        }
Example #2
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;
        }
Example #3
0
        public Assert(Assert another)
        {
            Oid refOid = null;
            formula = new ArrayList();

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

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

            oid = refOid;
        }
Example #4
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;
        }
Example #5
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;
        }
Example #6
0
        public Oid(Oid another)
        {
            if (another.Data != null)
            {
                data = (string)another.Data.Clone();
            }

            if (another.Individual != null)
            {
                individual = (string)another.Individual.Clone();
            }
        }
Example #7
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;
        }
Example #8
0
        public Protect(Protect another)
        {
            formula = new ArrayList();
            warden = new ArrayList();
            Oid refOid = null;

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

                if (another.Formula != null)
                {
                    AssertFormula[] items = (AssertFormula[])another.Formula.Clone();
                    formula.Clear();
                    foreach (AssertFormula item in items)
                    {
                        formula.Add(new AssertFormula(item));
                    }
                }

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

            oid = refOid;
        }
Example #9
0
        public Exist(Exist another)
        {
            Oid refOid = null;
            QueryFormula refFormula = null;
            declare = new ArrayList();

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

                if (another.Declare != null)
                {
                    Declare[] items = (Declare[])another.Declare.Clone();
                    declare.Clear();
                    foreach (Declare item in items)
                    {
                        declare.Add(new Declare(item));
                    }
                }

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

            oid = refOid;
            formula = refFormula;
        }
Example #10
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Oid other = new Oid((Oid)o);

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

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

            return true;
        }
Example #11
0
        public Atom(Atom another)
        {
            Oid refOid = null;
            individual = new ArrayList();
            variable = new ArrayList();
            slot = new ArrayList();
            data = new ArrayList();
            variableNames = new ArrayList();
            variableValues = new ArrayList();
            Degree refDegree = null;
            Operator refOperator = null;

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

                if (another.Degree != null)
                {
                    refDegree = (Degree)another.Degree.Clone();
                }

                if (another.Operator != null)
                {
                    refOperator = (Operator)another.Operator.Clone();
                }

                if (another.Data != null)
                {
                    string[] items = (string[])another.Data.Clone();
                    foreach (string item in items)
                    {
                        data.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.Individual != null)
                {
                    string[] items = (string[])another.Individual.Clone();
                    foreach (string item in items)
                    {
                        individual.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.Variable != null)
                {
                    string[] items = (string[])another.Variable.Clone();
                    foreach (string item in items)
                    {
                        variable.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.Slot != null)
                {
                    Slot[] items = (Slot[])another.Slot.Clone();
                    foreach (Slot item in items)
                    {
                        slot.Add(new Slot(item));
                    }
                }

                if (another.VariableNames != null)
                {
                    string[] items = (string[])another.VariableNames.Clone();
                    foreach (string item in items)
                    {
                        variableNames.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.VariableValues != null)
                {
                    string[] items = (string[])another.VariableValues.Clone();
                    foreach (string item in items)
                    {
                        variableValues.Add(new string(item.ToCharArray()));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            degree = refDegree;
            Operator = refOperator;
            fixedInd = another.FixedIndCount;
            assignedVariableCount = another.assignedVariableCount;
            variablesAssigned = another.variablesAssigned;
            index = -1;
        }
Example #12
0
        public RuleML(RuleML another)
        {
            Oid refOid = null;
            Assert refAssert = null;
            Query refQuery = null;
            Protect refProtect = null;
            parent = new ArrayList();
            try
            {
                if (another.Assert != null)
                {
                    refAssert = (Assert)another.Assert.Clone();
                }

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

                if (another.Query != null)
                {
                    refQuery = (Query)another.Query.Clone();
                }

                if (another.Protect != null)
                {
                    refProtect = (Protect)another.Protect.Clone();
                }

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

            assert = refAssert;
            oid = refOid;
            protect = refProtect;
            query = refQuery;
            id = another.id;
        }