Package stanfordlogic.prover

Examples of stanfordlogic.prover.Implication


    {
        GdlList succs = parser_.parse("(succ 1 2)");
        addFacts(succs);
       
        Expression conjunct = GroundFact.fromList( parser_.parse("succ 1 2") );
        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_ );
View Full Code Here


    {
        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);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
View Full Code Here

    {
        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);
       
        Expression conjunct2 = VariableFact.fromList( parser_.parse("succ ?y ?x") );
        Implication rule2 = new Implication( VariableFact.fromList(parser_.parse("gt ?x ?y")), conjunct2);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
        rules.add(rule2);
       
View Full Code Here

        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);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
       
        AbstractReasoner r = new BasicReasoner(kb_, rules, parser_ );
View Full Code Here

        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);
       
        Expression conjunct3 = VariableFact.fromList( parser_.parse("succ ?y 2") );
        Implication rule2 = new Implication( VariableFact.fromList(parser_.parse("pop ?y")), conjunct3);
       
        ArrayList<Implication> rules = new ArrayList<Implication>();
        rules.add(rule);
        rules.add(rule2);
       
View Full Code Here

        // Note that it is safe to assume that the head is in fact an atom.
        GdlAtom head = (GdlAtom) list.getElement(0);
       
        if ( head.getToken() == parser_.TOK_IMPLIEDBY )
        {
            Implication impl = examineRule(list);
            expressions_.add(impl);
            addRule(impl.getConsequent().getRelationName(), impl);
        }
        else
        {
            // It must be a ground fact at this point: it can't have variables,
            // since there is no rule to specify binding.
View Full Code Here

        // Create the conjunct list
        for ( int i = 2; i < rule.getSize(); i++ )
            conjuncts[i-2] = examineRelation(rule.getElement(i));
       
        // Create a rule structure and add it to our list.
        Implication r = new Implication( false, head, conjuncts );
       
        r = r.uniquefy();
       
        return r;
    }
View Full Code Here

TOP

Related Classes of stanfordlogic.prover.Implication

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.