getValue() public method

public getValue ( ) : String
return String
Ejemplo n.º 1
0
        public override bool Equals(Object o)
        {
            if (this == o)
            {
                return(true);
            }
            if ((o == null) || !(o is Symbol))
            {
                return(false);
            }
            Symbol sym = (Symbol)o;

            return(sym.getValue().Equals(getValue()));
        }
Ejemplo n.º 2
0
        public SymbolValuePair findPureSymbolValuePair(List<Sentence> clauseList,
                Model model, List<Symbol> symbols)
        {
            List<Sentence> _clausesWithNonTrueValues = clausesWithNonTrueValues(clauseList,
                    model);
            Sentence nonTrueClauses = LogicUtils.chainWith("AND",
                    _clausesWithNonTrueValues);
            // System.Console.WriteLine("Unsatisfied clauses = "
            // + clausesWithNonTrueValues.Count);
            List<Symbol> symbolsAlreadyAssigned = new List<Symbol>( model.getAssignedSymbols());

            // debug
            // List symList = asList(symbolsAlreadyAssigned);
            //
            // System.Console.WriteLine(" assignedSymbols = " + symList.Count);
            // if (symList.Count == 52) {
            // System.Console.WriteLine("untrue clauses = " + clausesWithNonTrueValues);
            // System.Console.WriteLine("model= " + model);
            // }

            // debug
            List<Symbol> purePositiveSymbols = SetOps
                    .difference(new SymbolClassifier()
                            .getPurePositiveSymbolsIn(nonTrueClauses),
                            symbolsAlreadyAssigned);

            List<Symbol> pureNegativeSymbols = SetOps
                    .difference(new SymbolClassifier()
                            .getPureNegativeSymbolsIn(nonTrueClauses),
                            symbolsAlreadyAssigned);
            // if none found return "not found
            if ((purePositiveSymbols.Count == 0)
                    && (pureNegativeSymbols.Count == 0))
            {
                return new SymbolValuePair();// automatically set to null values
            }
            else
            {
                if (purePositiveSymbols.Count > 0)
                {
                    Symbol symbol =purePositiveSymbols[0];
                    if (pureNegativeSymbols.Contains(symbol))
                    {
                        throw new ApplicationException("Symbol " + symbol.getValue()
                                + "misclassified");
                    }
                    return new SymbolValuePair(symbol, true);
                }
                else
                {
                    Symbol symbol = new Symbol((pureNegativeSymbols[0])
                            .getValue());
                    if (purePositiveSymbols.Contains(symbol))
                    {
                        throw new ApplicationException("Symbol " + symbol.getValue()
                                + "misclassified");
                    }
                    return new SymbolValuePair(symbol, false);
                }
            }
        }
Ejemplo n.º 3
0
 public Object visitSymbol(Symbol s, Object arg)
 {
     return new Symbol(s.getValue());
 }
Ejemplo n.º 4
0
 public override Object visitSymbol(Symbol s, Object arg)
 {
     List<Symbol> symbolsCollectedSoFar = (List<Symbol>)arg;
     symbolsCollectedSoFar.Add(new Symbol(s.getValue()));
     return symbolsCollectedSoFar;
 }