Examples of unify()


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

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

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

        a2 = arg2;
        a3 = arg3;
    // '$compare0'(A,B,C):-['$INSERT_AM'([deref(a(2),a(2)),deref(a(3),a(3))]),'$INSERT'(['\tif(! a1.unify(new IntegerTerm(a2.compareTo(a3)), engine.trail))','\t\treturn engine.fail();'])]
        a2 = a2.dereference();
        a3 = a3.dereference();
  if(! a1.unify(new IntegerTerm(a2.compareTo(a3)), engine.trail))
    return engine.fail();
        return cont;
    }
}
View Full Code Here

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

        a1 = arg1;
        a2 = arg2;
    // A is B:-[A is B]
        //START inline expansion of a(1)is a(2)
        try {
            if (! a1.unify(Arithmetic.evaluate(a2), engine.trail)) {
                return engine.fail();
            }
        } catch (BuiltinException e) {
            e.goal = this;
            throw e;
View Full Code Here

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

        Predicate cont;
        cont = engine.cont;
    // trace:-['$get_level'(A),current_prolog_flag(debug,on),'$cut'(A)]
        a1 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(1))
        if (! a1.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        p1 = new PRED_$cut_1(a1, cont);
        return new PRED_current_prolog_flag_2(s1, s2, p1);
View Full Code Here

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

        Predicate cont;
        cont = engine.cont;
    // trace:-['$get_level'(A),set_prolog_flag(debug,on),'$trace_init','$fast_write'('{Small debugger is switch on}'),nl,'$cut'(A)]
        a1 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(1))
        if (! a1.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        p1 = new PRED_$cut_1(a1, cont);
        p2 = new PRED_nl_0(p1);
View Full Code Here

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

        Predicate cont;
        cont = engine.cont;
    // notrace:-['$get_level'(A),current_prolog_flag(debug,off),'$cut'(A)]
        a1 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(1))
        if (! a1.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        p1 = new PRED_$cut_1(a1, cont);
        return new PRED_current_prolog_flag_2(s1, s2, p1);
View Full Code Here

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

        Predicate cont;
        cont = engine.cont;
    // notrace:-['$get_level'(A),set_prolog_flag(debug,off),'$fast_write'('{Small debugger is switch off}'),nl,'$cut'(A)]
        a1 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(1))
        if (! a1.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        p1 = new PRED_$cut_1(a1, cont);
        p2 = new PRED_nl_0(p1);
View Full Code Here

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

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

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

        cont = engine.cont;
    // '$member_in_reverse'(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 = {a5, a3, a2, a4};
        a7 = new StructureTerm(s1, y1);
        //START inline expansion of $unify(a(1),a(7))
        if (! a1.unify(a7, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        return cont;
    }
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.