Package jp.ac.kobe_u.cs.prolog.lang

Examples of jp.ac.kobe_u.cs.prolog.lang.StructureTerm


            a4 = args[1];
        } else if (a1.isVariable()){
            a3 = new VariableTerm(engine);
            a4 = new VariableTerm(engine);
            Term[] args = {a3, a4};
            ((VariableTerm) a1).bind(new StructureTerm(s1, args), engine.trail);
        } else {
            return engine.fail();
        }
        a2 = a2.dereference();
        if (a2.isStructure()){
            if (! s1.equals(((StructureTerm)a2).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a2).args();
            if (! a3.unify(args[0], engine.trail))
                return engine.fail();
            a5 = args[1];
        } else if (a2.isVariable()){
            a5 = new VariableTerm(engine);
            Term[] args = {a3, a5};
            ((VariableTerm) a2).bind(new StructureTerm(s1, args), engine.trail);
        } else {
            return engine.fail();
        }
        //START inline expansion of $neck_cut
        engine.neckCut();
View Full Code Here


            a4 = args[1];
        } else if (a1.isVariable()){
            a3 = new VariableTerm(engine);
            a4 = new VariableTerm(engine);
            Term[] args = {a3, a4};
            ((VariableTerm) a1).bind(new StructureTerm(s2, args), engine.trail);
        } else {
            return engine.fail();
        }
        a2 = a2.dereference();
        if (a2.isStructure()){
            if (! s3.equals(((StructureTerm)a2).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a2).args();
            a5 = args[0];
            a6 = args[1];
        } else if (a2.isVariable()){
            a5 = new VariableTerm(engine);
            a6 = new VariableTerm(engine);
            Term[] args = {a5, a6};
            ((VariableTerm) a2).bind(new StructureTerm(s3, args), engine.trail);
        } else {
            return engine.fail();
        }
        a6 = a6.dereference();
        if (a6.isStructure()){
            if (! s4.equals(((StructureTerm)a6).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a6).args();
            a7 = args[0];
            a8 = args[1];
        } else if (a6.isVariable()){
            a7 = new VariableTerm(engine);
            a8 = new VariableTerm(engine);
            Term[] args = {a7, a8};
            ((VariableTerm) a6).bind(new StructureTerm(s4, args), engine.trail);
        } else {
            return engine.fail();
        }
        a9 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(9))
        if (! a9.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        //START inline expansion of nonvar(a(3))
        a3 = a3.dereference();
        if (a3.isVariable()) {
            return engine.fail();
        }
        //END inline expansion
        a10 = new VariableTerm(engine);
        a11 = new VariableTerm(engine);
        Term[] y1 = {a10, a11};
        a12 = new StructureTerm(s4, y1);
        //START inline expansion of $unify(a(3),a(12))
        if (! a3.unify(a12, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
View Full Code Here

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

        } else {
            engine.cut(((IntegerTerm) a3).intValue());
        }
        //END inline expansion
        Term[] y1 = {a1};
        a4 = new StructureTerm(s2, y1);
        return new PRED_illarg_3(s1, a4, si3, cont);
    }
View Full Code Here

        } else {
            engine.cut(((IntegerTerm) a3).intValue());
        }
        //END inline expansion
        Term[] y1 = {a1, a2};
        a4 = new StructureTerm(s2, y1);
        return new PRED_illarg_3(s1, a4, si3, cont);
    }
View Full Code Here

        } else {
            engine.cut(((IntegerTerm) a3).intValue());
        }
        //END inline expansion
        Term[] y1 = {a1, a2};
        a4 = new StructureTerm(s2, y1);
        return new PRED_illarg_3(s1, a4, si4, cont);
    }
View Full Code Here

        if (! a7.unify(new IntegerTerm(engine.B0), engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        Term[] y1 = {a6, a2, a3, a1};
        a8 = new StructureTerm(s1, y1);
        p1 = new PRED_$unify_2(a5, a8, cont);
        p2 = new PRED_$cut_1(a7, p1);
        return new PRED_$match_type_2(a4, a1, p2);
    }
View Full Code Here

        engine.setB0();
        Term a1, a2;
        a1 = arg1;
    // assert(A):-[assertz('jp.ac.kobe_u.cs.prolog.builtin':A)]
        Term[] y1 = {s2, a1};
        a2 = new StructureTerm(s1, y1);
        return new PRED_assertz_1(a2, cont);
    }
View Full Code Here

        a1 = engine.aregs[1];
        a2 = engine.aregs[2];
        cont = engine.cont;
    // set_prolog_flag(A,B):-[illarg(type(atom),set_prolog_flag(A,B),1)]
        Term[] y1 = {a1, a2};
        a3 = new StructureTerm(s2, y1);
        return new PRED_illarg_3(s8, a3, si3, cont);
    }
View Full Code Here

        } else {
            engine.cut(((IntegerTerm) a3).intValue());
        }
        //END inline expansion
        Term[] y1 = {s3, a1};
        a4 = new StructureTerm(s2, y1);
        return new PRED_call_1(a4, cont);
    }
View Full Code Here

TOP

Related Classes of jp.ac.kobe_u.cs.prolog.lang.StructureTerm

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.