AIMA.Core.Logic.Propositional.Algorithms.PLFCEntails.HornClause.Equals C# (CSharp) Method

Equals() public method

public Equals ( Object o ) : bool
o Object
return bool
            public override bool Equals(Object o)
            {

                if (this == o)
                {
                    return true;
                }
                if ((o == null) || !(o is PLFCEntails))
                {
                    return false;
                }
                HornClause ohc = (HornClause)o;
                if (premiseSymbols.Count != ohc.premiseSymbols.Count)
                {
                    return false;
                }

                foreach (Symbol s in premiseSymbols)
                {
                    if (!ohc.premiseSymbols.Contains(s))
                    {
                        return false;
                    }
                }

                return true;

            }