Package stanfordlogic.prover

Examples of stanfordlogic.prover.BasicReasoner


        GameInformation gameInfo = new MetaGdl(parser).examineGdl(description);
       
        KnowledgeBase staticKb = new BasicKB();
        staticKb.loadWithFacts(gameInfo.getAllGrounds());
       
        AbstractReasoner reasoner = new BasicReasoner(staticKb, gameInfo.getIndexedRules(), parser);
       
        TermObject myRole = (TermObject) TermObject.buildFromGdl(role);
       
        gamer.initializeGame(myRole, playClock, gameInfo, reasoner);
       
View Full Code Here


    public void testGroundProof()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 3) (succ 3 4)");
        addFacts(succs);
       
        AbstractReasoner r = new BasicReasoner(kb_, new ArrayList<Implication>(), parser_ );
       
        // Make sure we can prove all of our ground facts!
        GroundFact answer1 = getAnAnswer( r, new GroundFact(symbolTable_, "succ", "1", "2") );
        GroundFact answer2 = getAnAnswer( r, new GroundFact(symbolTable_, "succ", "2", "3") );
        GroundFact answer3 = getAnAnswer( r, new GroundFact(symbolTable_, "succ", "3", "4") );
View Full Code Here

    public void testSingleGroundProofWithVars()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 3) (succ 3 4)");
        addFacts(succs);
       
        AbstractReasoner r = new BasicReasoner(kb_, new ArrayList<Implication>(), parser_ );
       
        // See if we can get just one answer
        GdlList questionList = parser_.parse("succ ?x 2");
        Fact question = VariableFact.fromList(questionList);
       
View Full Code Here

    public void testMultiGroundProofWithVars()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 3) (succ 3 4)");
        addFacts(succs);
       
        AbstractReasoner r = new BasicReasoner(kb_, new ArrayList<Implication>(), parser_ );
       
        //  Now see if we can get *all* answers
        GdlList questionList = parser_.parse("succ ?x ?y");
        Fact question = VariableFact.fromList(questionList);
       
View Full Code Here

        Implication rule = new Implication( GroundFact.fromList(parser_.parse("gt 2 1")), conjunct);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
       
        // Make sure we can prove all of our ground facts!
        GroundFact answer1 = getAnAnswer( r, new GroundFact(symbolTable_, "gt", "2", "1") );
       
        assertEquals( new GroundFact(symbolTable_, "gt", "2", "1"), answer1 );
View Full Code Here

        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x 1")), conjunct);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
       
        // Make sure we can prove all of our ground facts!
        GroundFact answer1 = getAnAnswer( r, new GroundFact(symbolTable_, "gt", "2", "1") );
       
        assertEquals( new GroundFact(symbolTable_, "gt", "2", "1"), answer1 );
View Full Code Here

       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
        rules.add(rule2);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
       
        // Make sure we can prove all of our ground facts!
        List<GroundFact> answers = getAllAnswers( r, VariableFact.fromList(parser_.parse("gt ?x ?y")) );
       
        // note: we'll see if we get (gt 2 1) twice
View Full Code Here

        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x")), conjunct, conjunct2);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
       
       
        // Make sure we can prove all of our ground facts!
        List<GroundFact> answers = getAllAnswers( r, VariableFact.fromList(parser_.parse("gt ?y")) );
       
View Full Code Here

       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
        rules.add(rule2);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
        
        // Make sure we can prove all of our ground facts!
        List<GroundFact> answers = getAllAnswers( r, VariableFact.fromList(parser_.parse("gt ?y")) );
       
        assertEquals( 3, answers.size() );
View Full Code Here

    }
   
    public void testTicTacToeTerminal() throws IOException
    {
        List<Implication> rules = getTicTacToeRules();
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_);
       
        GdlList facts = parser_.parse("(true (cell 1 1 b))(true (cell 1 2 b))(true (cell 1 3 b))(true (cell 2 1 b))(true (cell 2 2 b))(true (cell 2 3 b))(true (cell 3 1 b))(true (cell 3 2 b))(true (cell 3 3 b))(true (control xplayer))");
        addFacts(facts);
       
        Fact f = getAnAnswer( r, Fact.fromExpression( parser_.parse("terminal") ) );
View Full Code Here

TOP

Related Classes of stanfordlogic.prover.BasicReasoner

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.