AIMA.Core.Logic.Propositional.Algorithms.Model.getAssignedSymbols C# (CSharp) Method

getAssignedSymbols() public method

public getAssignedSymbols ( ) : ReadOnlyCollection
return ReadOnlyCollection
    public ReadOnlyCollection<Symbol> getAssignedSymbols()
    {
		return new ReadOnlyCollection<Symbol>(h.Keys.ToList<Symbol>());
	}

Usage Example

Example #1
0
        private SymbolValuePair findUnitClause(List <Sentence> clauseList, Model model,
                                               List <Symbol> symbols)
        {
            for (int i = 0; i < clauseList.Count; i++)
            {
                Sentence clause = (Sentence)clauseList[i];
                if ((clause is Symbol) &&
                    (!(model.getAssignedSymbols().Contains(clause))))
                {
                    // System.Console.WriteLine("found unit clause - assigning");
                    return(new SymbolValuePair(new Symbol(((Symbol)clause)
                                                          .getValue()), true));
                }

                if (clause is UnarySentence)
                {
                    UnarySentence sentence = (UnarySentence)clause;
                    Sentence      negated  = sentence.getNegated();
                    if ((negated is Symbol) &&
                        (!(model.getAssignedSymbols().Contains(negated))))
                    {
                        // System.Console.WriteLine("found unit clause type 2 -
                        // assigning");
                        return(new SymbolValuePair(new Symbol(((Symbol)negated)
                                                              .getValue()), false));
                    }
                }
            }

            return(new SymbolValuePair());// failed to find any unit clause;
        }
All Usage Examples Of AIMA.Core.Logic.Propositional.Algorithms.Model::getAssignedSymbols