Package org.ggp.base.util.prover.aima.substitution

Examples of org.ggp.base.util.prover.aima.substitution.Substitution


    LinkedList<GdlLiteral> goals = new LinkedList<GdlLiteral>();
    goals.add(query);

    Set<Substitution> answers = new HashSet<Substitution>();
    Set<GdlSentence> alreadyAsking = new HashSet<GdlSentence>();
    ask(goals, new KnowledgeBase(context), new Substitution(), ProverCache.createSingleThreadedCache(),
        new VariableRenamer(), askOne, answers, alreadyAsking);

    Set<GdlSentence> results = new HashSet<GdlSentence>();
    for (Substitution theta : answers)
    {
View Full Code Here


      Set<Substitution> sentenceResults = new HashSet<Substitution>();
      for (GdlRule rule : candidates)
      {
        GdlRule r = renamer.rename(rule);
        Substitution thetaPrime = Unifier.unify(r.getHead(), sentence);

        if (thetaPrime != null)
        {
          LinkedList<GdlLiteral> sentenceGoals = new LinkedList<GdlLiteral>();
          for (int i = 0; i < r.arity(); i++)
View Full Code Here

public final class Unifier
{

    public static Substitution unify(GdlSentence x, GdlSentence y)
    {
        Substitution theta = new Substitution();
        boolean isGood = unifyTerm(x.toTerm(), y.toTerm(), theta);

        if(isGood)
            return theta;
        else
View Full Code Here

            else
            {
                for ( GdlRule template : templates.get(constant) )
                {
                    Set<GdlRule> results = new HashSet<GdlRule>();
                    instantiate(template, 0, new Substitution(), results);

                    instantiations.get(constant).addAll(results);
                }
            }
        }
View Full Code Here

            if ( literal instanceof GdlSentence )
            {
                GdlSentence sentence = (GdlSentence) Substituter.substitute(literal, theta);
                for ( GdlRule instantiation : getInstantiations(sentence.getName()) )
                {
                    Substitution thetaPrime = Unifier.unify(sentence, instantiation.getHead());
                    if ( thetaPrime!=null )
                    {
                        Substitution thetaCopy = theta.copy();
                        thetaCopy = thetaCopy.compose(thetaPrime);

                        instantiate(template, index + 1, thetaCopy, results);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.ggp.base.util.prover.aima.substitution.Substitution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.