getPositiveSymbolsIn() public method

public getPositiveSymbolsIn ( Sentence sentence ) : List
sentence AIMA.Core.Logic.Propositional.Parsing.Ast.Sentence
return List
示例#1
0
        //
        // PRIVATE METHODS
        //

        private List<Sentence> filterOutClausesWithTwoComplementaryLiterals(
                List<Sentence> clauses)
        {
            List<Sentence> filtered = new List<Sentence>();
            SymbolClassifier classifier = new SymbolClassifier();
            foreach(Sentence clause in clauses)
            {

                List<Symbol> positiveSymbols = classifier
                        .getPositiveSymbolsIn(clause);
                List<Symbol> negativeSymbols = classifier
                        .getNegativeSymbolsIn(clause);
                if ((SetOps.intersection(positiveSymbols, negativeSymbols).Count == 0))
                {
                    filtered.Add(clause);
                }
            }
            return filtered;
        }
示例#2
0
            public ClauseSymbols(Sentence clause1, Sentence clause2)
            {

                SymbolClassifier classifier = new SymbolClassifier();

                clause1Symbols = classifier.getSymbolsIn(clause1);
                clause1PositiveSymbols = classifier.getPositiveSymbolsIn(clause1);
                clause1NegativeSymbols = classifier.getNegativeSymbolsIn(clause1);

                clause2Symbols = classifier.getSymbolsIn(clause2);
                clause2PositiveSymbols = classifier.getPositiveSymbolsIn(clause2);
                clause2NegativeSymbols = classifier.getNegativeSymbolsIn(clause2);

                positiveInClause1NegativeInClause2 = SetOps.intersection(
                        clause1PositiveSymbols, clause2NegativeSymbols);
                negativeInClause1PositiveInClause2 = SetOps.intersection(
                        clause1NegativeSymbols, clause2PositiveSymbols);

            }