AIMA.Core.Logic.Propositional.Visitors.BasicTraverser.visitBinarySentence C# (CSharp) Method

visitBinarySentence() public method

public visitBinarySentence ( BinarySentence bs, Object arg ) : Object
bs AIMA.Core.Logic.Propositional.Parsing.Ast.BinarySentence
arg Object
return Object
        public virtual Object visitBinarySentence(BinarySentence bs, Object arg)
        {
            List<Sentence> s = new List<Sentence>();
            if (arg is List<Symbol>)
            {
                List<Symbol> symbols = ((List<Symbol>)arg);
                foreach (Symbol symbol in symbols)
                {
                    s.Add((Sentence)symbol);
                }
            }
            else
            {
                throw new ArgumentException("Could not cast arg to List<Sentence>");
            }
            List<Sentence> termunion = SetOps.union((List<Sentence>)bs.getFirst().accept(this, arg),
                    (List<Sentence>)bs.getSecond().accept(this, arg));
            return SetOps.union(s, termunion);
        }