Package stanfordlogic.knowledge

Examples of stanfordlogic.knowledge.RelationNameProcessor


        this.stanfordlogicReasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
    queryTerminal=makeQuery("terminal");
    queryNext=makeQuery("next", "?f");
    queryTrue=makeQuery("true", "?f");
    queryInit=makeQuery("init", "?f");
    trueProcessor=new RelationNameProcessor(parser.TOK_TRUE);
  }
View Full Code Here


     */
    public GDLState(GameReasoner reasoner)
    {
        this.reasoner = reasoner;
        Parser parser = GameManager.getParser();
        RelationNameProcessor trueProcessor = new RelationNameProcessor(parser.TOK_TRUE);
       
        Iterable<GroundFact> inits = reasoner.getAllAnswersIterable(ProofContext.makeDummy(parser), "init", "?x");
        for (GroundFact initFact : inits)
        {
            GroundFact trueFact = trueProcessor.processFact(initFact);
            facts.add(trueFact);
        }
    }
View Full Code Here

        }
       
        List<GroundFact> nextfacts = reasoner.getAllAnswers(reasoner.getQueryNext(), context);
        Set<GroundFact> newfacts = new HashSet<GroundFact>();
       
        RelationNameProcessor trueProcessor = new RelationNameProcessor(GameManager.getParser().TOK_TRUE);
       
        for(GroundFact f : nextfacts)
        {
            newfacts.add(trueProcessor.processFact(f));
        }
       
        return new GDLState(reasoner,newfacts);
    }
View Full Code Here

    {
        super(p);
       
        gameId_ = gameId;
       
        doesProcessor_ = new RelationNameProcessor("does", symbolTable_);
        trueProcessor_ = new RelationNameProcessor(parser_.TOK_TRUE);
    }
View Full Code Here

        // Compute the initial state
        List<GroundFact> inits = r.getAllAnswers(initQuestion);
       
        KnowledgeBase currentState = new BasicKB();
       
        RelationNameProcessor trueProcessor = new RelationNameProcessor(parser_.TOK_TRUE);
        for (GroundFact init: inits) {
            currentState.setTrue(trueProcessor.processFact(init));
        }
       
        assertEquals(10, currentState.getNumFacts());
       
        GroundFact [] moves;
View Full Code Here

       
        List<GroundFact> nexts = r.getAllAnswers(nextQuestion, context);
       
        KnowledgeBase newKb = new BasicKB();
       
        RelationNameProcessor trueProcessor = new RelationNameProcessor(parser_.TOK_TRUE);
       
        for (GroundFact next : nexts) {
            newKb.setTrue(trueProcessor.processFact(next));
        }
       
        return newKb;
       
    }
View Full Code Here

        List<GroundFact> init = reasoner.getAllAnswers( question, context );
       
        // Make sure that we have a cache for all the initial truths
        assertEquals( 18, init.size() );
       
        RelationNameProcessor processor = new RelationNameProcessor(parser_.TOK_TRUE);
       
        for ( GroundFact f : init )
            volatileKb.setTrue ( processor.processFact(f) );
           
                // Find out how many legal moves there are
        List<GroundFact> legal = reasoner.getAllAnswers( makeFact( "legal white ?x" ),
                context );
View Full Code Here

       
        List<GroundFact> init = reasoner.getAllAnswers( question, context );
       
        assertEquals(66, init.size());
       
        RelationNameProcessor processor = new RelationNameProcessor(parser_.TOK_TRUE);
       
        for ( GroundFact f : init )
            volatileKb.setTrue ( processor.processFact(f) );
           
        // Find out how many legal moves there are
        List<GroundFact> legal = reasoner.getAllAnswers( makeFact( "legal white ?x" ),
                context );
View Full Code Here

TOP

Related Classes of stanfordlogic.knowledge.RelationNameProcessor

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.