Examples of unify()


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;
    // '$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

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

        }
        //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

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

        Term a1, a2;
        a1 = arg1;
        a2 = arg2;
    // A\=B:-['$not_unifiable'(A,B)]
        //START inline expansion of $not_unifiable(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()

        } else if (a2.isVariable()){
            ((VariableTerm) a2).bind(s1, engine.trail);
        } else {
            return engine.fail();
        }
        if (! a1.unify(a3, engine.trail))
            return engine.fail();
        return cont;
    }
}
View Full Code Here

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

        cont = engine.cont;
    // A;B:-['$not_unifiable'(A,(C->D)),call('jp.ac.kobe_u.cs.prolog.builtin':A)]
        Term[] y1 = {new VariableTerm(engine), new VariableTerm(engine)};
        a3 = new StructureTerm(s1, y1);
        //START inline expansion of $not_unifiable(a(1),a(3))
        if (a1.unify(a3, engine.trail)) {
            return engine.fail();
        }
        //END inline expansion
        Term[] y2 = {s3, a1};
        a4 = new StructureTerm(s2, y2);
View Full Code Here

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

    a1 = a1.dereference();
    a2 = a2.dereference();
    if (a1.isVariable()) { // atom_chars(-Atom, +CharList)
      if (a2.isNil()) {
        if (!a1.unify(SymbolTerm.makeSymbol(""), engine.trail)) {
          return engine.fail();
        }
        return cont;
      } else if (a2.isVariable()) {
        throw new PInstantiationException(this, 2);
View Full Code Here

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

    a1 = a1.dereference();
    if (!a1.isVariable()) {
      throw new IllegalTypeException(this, 1, "variable", a1);
    }
    if (!a1
        .unify(new JavaObjectTerm(engine.getHashManager()),
            engine.trail)) {
      return engine.fail();
    }
    return cont;
View Full Code Here

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

    a1 = a1.dereference();
    if (!a1.isVariable()) {
      throw new IllegalTypeException(this, 1, "variable", a1);
    }
    if (!a1.unify(new JavaObjectTerm(engine.getStreamManager()),
        engine.trail)) {
      return engine.fail();
    }
    return cont;
  }
View Full Code Here

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

    engine.setB0();
    Term a1;
    a1 = arg1;

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

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

      }
      int i = ((IntegerTerm) a2).intValue();
      if (!Character.isDefined(i)) {
        throw new RepresentationException(this, 2, "character_code");
      }
      if (!a1.unify(SymbolTerm.makeSymbol(String.valueOf((char) i)),
          engine.trail)) {
        return engine.fail();
      }
    } else if (a1.isSymbol()) { // char_code(+Char, ?CharCode)
      String s = ((SymbolTerm) a1).name();
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.