AIMA.Core.Logic.FOL.SubstVisitor.subst C# (CSharp) Метод

subst() публичный Метод

public subst ( Term>.Dictionary theta, Function aFunction ) : Function
theta Term>.Dictionary
aFunction Function
Результат Function
        public Function subst(Dictionary<Variable, Term> theta, Function aFunction)
        {
            return (Function)aFunction.accept(this, theta);
        }

Same methods

SubstVisitor::subst ( Term>.Dictionary theta, Literal aLiteral ) : Literal
SubstVisitor::subst ( Term>.Dictionary theta, Sentence aSentence ) : Sentence
SubstVisitor::subst ( Term>.Dictionary theta, Term aTerm ) : Term

Usage Example

Пример #1
0
        // Note: see page 327.
        public StandardizeApartResult standardizeApart(Sentence aSentence,
                                                       StandardizeApartIndexical standardizeApartIndexical)
        {
            List <Variable> toRename = variableCollector
                                       .collectAllVariables(aSentence);
            Dictionary <Variable, Term> renameSubstitution  = new Dictionary <Variable, Term>();
            Dictionary <Variable, Term> reverseSubstitution = new Dictionary <Variable, Term>();

            foreach (Variable var in toRename)
            {
                Variable v = null;
                do
                {
                    v = new Variable(standardizeApartIndexical.getPrefix()
                                     + standardizeApartIndexical.getNextIndex());
                    // Ensure the new variable name is not already
                    // accidentally used in the sentence
                } while (toRename.Contains(v));

                renameSubstitution.Add(var, v);
                reverseSubstitution.Add(v, var);
            }

            Sentence standardized = substVisitor.subst(renameSubstitution,
                                                       aSentence);

            return(new StandardizeApartResult(aSentence, standardized,
                                              renameSubstitution, reverseSubstitution));
        }
All Usage Examples Of AIMA.Core.Logic.FOL.SubstVisitor::subst