Exemplo n.º 1
0
        private bool isClauseTrueInModel(Sentence clause, Model model)
        {
            List<Symbol> positiveSymbols = new SymbolClassifier().getPositiveSymbolsIn(clause);
            List<Symbol> negativeSymbols = new SymbolClassifier().getNegativeSymbolsIn(clause);

            foreach (Symbol symbol in positiveSymbols)
            {
                if ((model.isTrue(symbol)))
                {
                    return true;
                }
            }
            foreach (Symbol symbol in negativeSymbols)
            {
                if ((model.isFalse(symbol)))
                {
                    return true;
                }
            }
            return false;

        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        public void setUp()
        {
            classifier = new SymbolClassifier();
            parser = new PEParser();

        }
Exemplo n.º 4
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);

            }