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

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


            return engine.fail();
        }
        //END inline expansion
        a5 = new ListTerm(new VariableTerm(engine), new VariableTerm(engine));
        //START inline expansion of $unify(a(1),a(5))
        if (! a1.unify(a5, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        //START inline expansion of $cut(a(4))
        a4 = a4.dereference();
View Full Code Here


        //END inline expansion
        a3 = new VariableTerm(engine);
        Term[] y1 = {a3, new VariableTerm(engine)};
        a4 = new StructureTerm(s1, y1);
        //START inline expansion of $unify(a(1),a(4))
        if (! a1.unify(a4, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        a5 = new VariableTerm(engine);
        a6 = new VariableTerm(engine);
View Full Code Here

  @Override
  public Predicate exec(Prolog engine) {
    // engine.setB0();
    Term a1;
    a1 = arg1;
    if (!a1.unify(new IntegerTerm(engine.B0), engine.trail)) {
      return engine.fail();
    }
    return cont;
  }
}
View Full Code Here

    a1 = a1.dereference();
    if (a1.isVariable()) {
      ((VariableTerm) a1).bind(new JavaObjectTerm(engine
          .getCurrentInput()), engine.trail);
    } else if (a1.isJavaObject()) {
      if (!a1.unify(new JavaObjectTerm(engine.getCurrentInput()),
          engine.trail)) {
        return engine.fail();
      }
    } else {
      throw new IllegalDomainException(this, 1, "stream", a1);
View Full Code Here

  public Predicate exec(Prolog engine) {
    engine.setB0();
    Term a1;
    a1 = arg1;

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

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

        cont = engine.cont;
    // 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

        cont = engine.cont;
    // '$dummy_8_builtins.pl'(A,B,C):-['$not_unifiable'(A,C:B)]
        Term[] y1 = {a3, a2};
        a4 = new StructureTerm(s1, y1);
        //START inline expansion of $not_unifiable(a(1),a(4))
        if (a1.unify(a4, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        return cont;
    }
View Full Code Here

        a1 = engine.aregs[1];
        a2 = engine.aregs[2];
        a3 = engine.aregs[3];
        cont = engine.cont;
    // '$write_space_if_needed'(A,A,B):-['$neck_cut',put_char(B,' ')]
        if (! a1.unify(a2, engine.trail))
            return engine.fail();
        //START inline expansion of $neck_cut
        engine.neckCut();
        //END inline expansion
        return new PRED_put_char_2(a3, s2, cont);
View Full Code Here

        }
        //END inline expansion
        Term[] y1 = {a2};
        a5 = new StructureTerm(s1, y1);
        //START inline expansion of $unify(a(1),a(5))
        if (! a1.unify(a5, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        //START inline expansion of $plus(a(2),si(2),a(3))
        try {
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.