Examples of GdlList


Examples of stanfordlogic.gdl.GdlList

        assertEquals( new GroundFact(symbolTable_, "gt", "2", "1"), answer1 );
    }
   
    public void testGroundProofWithRuleAndVars()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 2) (succ 1 3)");
        addFacts(succs);
       
        Expression conjunct = VariableFact.fromList( parser_.parse("succ 1 ?x") );
        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x 1")), conjunct);
       
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

        assertEquals( new GroundFact(symbolTable_, "gt", "2", "1"), answer1 );
    }

    public void testGroundProofWithRulesAndVars()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 2) (succ 1 3)");
        addFacts(succs);
       
        Expression conjunct = VariableFact.fromList( parser_.parse("succ 2 ?x") );
        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x 1")), conjunct);
       
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

        assertEquals( 3, answers.size() );
    }
   
    public void testGroundProofWithMultiConjunction()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 2) (succ 1 3) (succ 2 3) (succ 3 2)");
        addFacts(succs);
       
        Expression conjunct = VariableFact.fromList( parser_.parse("succ 2 ?x") );
        Expression conjunct2 = VariableFact.fromList( parser_.parse("succ ?x 2") );
        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x")), conjunct, conjunct2);
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

        assertEquals( 2, answers.size() );
    }
   
    public void testGroundProofWithLevels()
    {
        GdlList succs = parser_.parse("(succ 1 2) (succ 2 2) (succ 1 3) (succ 2 3) (succ 3 2) (succ 2 1)");
        addFacts(succs);
       
        Expression conjunct = VariableFact.fromList( parser_.parse("succ 2 ?x") );
        Expression conjunct2 = VariableFact.fromList( parser_.parse("pop ?x") );
        Implication rule = new Implication( VariableFact.fromList(parser_.parse("gt ?x")), conjunct, conjunct2);
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

    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") ) );
        assertNull(f);
       
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

       
        assertEquals(26, rules.size());
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_);
       
        GdlList facts = parser_.parse( "(true (cell 1 1 x)) (true (cell 1 2 x)) (true (cell 1 3 o)) (true (cell 2 1 x)) (true (cell 2 2 o)) (true (cell 2 3 b)) (true (cell 3 1 o)) (true (cell 3 2 b)) (true (cell 3 3 b)) (true (control xplayer))" );
        addFacts(facts);
       
        List<GroundFact> results = getAllAnswers( r, Fact.fromExpression( parser_.parse("legal xplayer ?x") ) );
        assertEquals(3, results.size());
    }
View Full Code Here

Examples of stanfordlogic.gdl.GdlList

    {
        GameInformation info = MetaGdl.examineGame("game-defs/tictactoe.kif", parser_);
        List<Implication> rules = info.getRules();
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_);
       
        GdlList facts = parser_.parse("(true (cell 1 1 x))(true (cell 1 2 o))(true (cell 1 3 x))(true (cell 2 1 o))(true (cell 2 2 x))(true (cell 2 3 b))(true (cell 3 1 b))(true (cell 3 2 b))(true (cell 3 3 b))(true (control oplayer))");
        addFacts(facts);
       
        // Get all next facts
        GroundFact does = GroundFact.fromExpression( parser_.parse("does xplayer noop") );
        GroundFact does2 = GroundFact.fromExpression( parser_.parse("does oplayer (mark 2 3)") );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.