Examples of unify()


Examples of aima.core.logic.fol.Unifier.unify()

    Sentence johnKnowsJane = parser.parse("Knows(y,Mother(y))");

    System.out.println("------------");
    System.out.println("Unifier Demo");
    System.out.println("------------");
    Map<Variable, Term> subst = unifier.unify(query, johnKnowsJane, theta);
    System.out.println("Unify '" + query + "' with '" + johnKnowsJane
        + "' to get the substitution " + subst + ".");
    System.out.println("");
  }
View Full Code Here

Examples of com.googlecode.prolog_cafe.lang.Term.unify()

    Term a1 = arg1.dereference();

    Change change = StoredValues.CHANGE.get(engine);
    Project.NameKey name = change.getProject();

    if (!a1.unify(SymbolTerm.create(name.get()), engine.trail)) {
      return engine.fail();
    }
    return cont;
  }
}
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        } else {
            engine.cut(((IntegerTerm) a3).intValue());
        }
        //END inline expansion
        //START inline expansion of $unify(a(1),a(2))
        if (! a1.unify(a2, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        return cont;
    }
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        cont = engine.cont;
    // '$builtin_member'(A,[A|B]):-[]
        a2 = a2.dereference();
        if (a2.isList()){
            Term[] args = {((ListTerm)a2).car(), ((ListTerm)a2).cdr()};
            if (! a1.unify(args[0], engine.trail))
                return engine.fail();
        } else if (a2.isVariable()){
            ((VariableTerm) a2).bind(new ListTerm(a1, new VariableTerm(engine)), engine.trail);
        } else {
            return engine.fail();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        }
        //END inline expansion
        Term[] y1 = {new VariableTerm(engine), new VariableTerm(engine)};
        a7 = new StructureTerm(s4, y1);
        //START inline expansion of $not_unifiable(a(1),a(7))
        if (a1.unify(a7, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        //START inline expansion of $cut(a(6))
        a6 = a6.dereference();
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        a3 = engine.aregs[3];
        a4 = engine.aregs[4];
        a5 = engine.aregs[5];
        cont = engine.cont;
    // '$term_to_predicateindicator'(A,A,B,B,C):-[]
        if (! a1.unify(a2, engine.trail))
            return engine.fail();
        if (! a3.unify(a4, engine.trail))
            return engine.fail();
        return cont;
    }
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        a2 = arg2;
    // ?=(A,B):-['$identical_or_cannot_unify'(A,B)]
        //START inline expansion of $identical_or_cannot_unify(a(1),a(2))
        a1 = a1.dereference();
        a2 = a2.dereference();
        if (! a1.equals(a2) && a1.unify(a2, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        return cont;
    }
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

            if (! s2.equals(((StructureTerm)a4).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a4).args();
            if (! a2.unify(args[0], engine.trail))
                return engine.fail();
            if (! a1.unify(args[1], engine.trail))
                return engine.fail();
        } else if (a4.isVariable()){
            Term[] args = {a2, a1};
            ((VariableTerm) a4).bind(new StructureTerm(s2, args), engine.trail);
        } else {
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        } else if (a2.isVariable()){
            ((VariableTerm) a2).bind(s6, engine.trail);
        } else {
            return engine.fail();
        }
        if (! a1.unify(a3, engine.trail))
            return engine.fail();
        //START inline expansion of $neck_cut
        engine.neckCut();
        //END inline expansion
        return cont;
View Full Code Here

Examples of jp.ac.kobe_u.cs.prolog.lang.Term.unify()

        a1 = engine.aregs[1];
        a2 = engine.aregs[2];
        a3 = engine.aregs[3];
        cont = engine.cont;
    // '$localize_body'(A,B,A):-['$get_level'(C),system_predicate(A),'$cut'(C)]
        if (! a1.unify(a3, engine.trail))
            return engine.fail();
        a4 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(4))
        if (! a4.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
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.