Examples of ListTerm


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

        return false;
      }
      // Create arguments
      Term wam = SymbolTerm.makeSymbol(_wam);
      Term dir = SymbolTerm.makeSymbol(_dir);
      Term[] args = { new ListTerm(wam, new ListTerm(dir, Prolog.Nil)) };
      // Create predicate
      // Class clazz =
      // PredicateEncoder.getClass("jp.ac.kobe_u.cs.prolog.compiler.am2j",
      // "am2j", 1);
      Class clazz = new PrologClassLoader().loadPredicateClass(
View Full Code Here

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

            a6 = args[0];
            a7 = args[1];
        } else if (a1.isVariable()){
            a6 = new VariableTerm(engine);
            a7 = new VariableTerm(engine);
            ((VariableTerm) a1).bind(new ListTerm(a6, a7), engine.trail);
        } else {
            return engine.fail();
        }
        a6 = a6.dereference();
        if (a6.isStructure()){
            if (! s2.equals(((StructureTerm)a6).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a6).args();
            a8 = args[0];
            a9 = args[1];
        } else if (a6.isVariable()){
            a8 = new VariableTerm(engine);
            a9 = new VariableTerm(engine);
            Term[] args = {a8, a9};
            ((VariableTerm) a6).bind(new StructureTerm(s2, args), engine.trail);
        } else {
            return engine.fail();
        }
        a3 = a3.dereference();
        if (a3.isList()){
            Term[] args = {((ListTerm)a3).car(), ((ListTerm)a3).cdr()};
            a10 = args[0];
            a11 = args[1];
        } else if (a3.isVariable()){
            a10 = new VariableTerm(engine);
            a11 = new VariableTerm(engine);
            ((VariableTerm) a3).bind(new ListTerm(a10, a11), engine.trail);
        } else {
            return engine.fail();
        }
        a10 = a10.dereference();
        if (a10.isStructure()){
            if (! s2.equals(((StructureTerm)a10).functor()))
                return engine.fail();
            Term[] args = ((StructureTerm)a10).args();
            if (! a8.unify(args[0], engine.trail))
                return engine.fail();
            if (! a9.unify(args[1], engine.trail))
                return engine.fail();
        } else if (a10.isVariable()){
            Term[] args = {a8, a9};
            ((VariableTerm) a10).bind(new StructureTerm(s2, args), engine.trail);
        } else {
            return engine.fail();
        }
        a4 = a4.dereference();
        if (a4.isList()){
            Term[] args = {((ListTerm)a4).car(), ((ListTerm)a4).cdr()};
            if (! a9.unify(args[0], engine.trail))
                return engine.fail();
            a12 = args[1];
        } else if (a4.isVariable()){
            a12 = new VariableTerm(engine);
            ((VariableTerm) a4).bind(new ListTerm(a9, a12), engine.trail);
        } else {
            return engine.fail();
        }
        a13 = new VariableTerm(engine);
        //START inline expansion of $get_level(a(13))
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.