private bool FindSentence(List<Symbol> symbols, Sentence s) { foreach (Symbol symbol in symbols) { if (symbol is Sentence && symbol.Equals(s)) { return true; } } return false; }