Package stanfordlogic.prover

Examples of stanfordlogic.prover.AbstractReasoner


    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

TOP

Related Classes of stanfordlogic.prover.AbstractReasoner

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.