Package stanfordlogic.prover

Examples of stanfordlogic.prover.Substitution


       
        TermVariable varX = getVariable("?x");
        TermVariable varY = getVariable("?y");
        TermVariable varZ = getVariable("?z");
       
        Substitution s = new Substitution();
        s.addMapping(varX, tf);
        s.addMapping(varY, getTermObject("1"));
        s.addMapping(varZ, getTermObject("2"));
       
       
        Fact result = (Fact) f1.applySubstitution(s);
       
        assertEquals( makeFact("legal (mark 1 2)"), result );
View Full Code Here


               
                if(nFact.getArity() > 0 && nFact.getTerm(0) instanceof TermFunction)
                {
                    if(((TermFunction) nFact.getTerm(0)).functionName_ == ((TermFunction) fact.getTerm(0)).functionName_)
                    {
                        Substitution s = fact.unify(nFact);
                        if ( s != null )
                            result.add(s);
                    }
                }
            }
        }
        else
        {
            for(GroundFact nFact : facts)
            {
                Substitution s = fact.unify(nFact);
                if ( s != null )
                    result.add( s );
            }
        }
        return result;
View Full Code Here

    {
        long startTime = System.nanoTime();
       
        logger_.fine(" ---------- Beginning new proof request (single) ----------");
       
        Substitution s = proveOne(f, context);

        GameManager.addTime(GameManager.TIME_GET_AN_ANSWER, System.nanoTime() - startTime);
       
        // No proof?
        if (s == null)
View Full Code Here

        for ( Implication rule : rules )
        {
            rule = rule.uniquefy();

            Substitution unification = f.unify(rule.getConsequent());

            // Stop if unification fails.
            if ( unification == null )
                continue;

            context.reportRuleHead(rule.getConsequent(), unification);

            Conjunction conjuncts =
                    (Conjunction) rule.getAntecedents().applySubstitution(unification);

            List<Substitution> ruleResults = proveConjunction(conjuncts, context, proveAll);

            if ( ruleResults != null )
            {
                for (Substitution sub: ruleResults)
                {
                    Substitution s = unification.copy(sub);

                    results.add(s);
                   
                    if (!proveAll) {
                        // we can just stop here.
View Full Code Here

   
    private List<Substitution> proveNegation(Negation s, ProofContext context, boolean proveAll)
    {
        context.enterProof(s, proveAll);
       
        Substitution result = proveOne(s.getNegated(), context);
       
        // Make sure we *failed* the proof.
        if ( result == null ) {
            List<Substitution> res = new ArrayList<Substitution>(1);
            res.add(EMPTY_SUB);
View Full Code Here

TOP

Related Classes of stanfordlogic.prover.Substitution

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.