Package net.sf.kpex.util

Examples of net.sf.kpex.util.Trail


  public Prog(Clause goal, Prog parent)
  {
    super(parent);
    this.parent = parent;
    goal = goal.ccopy();
    trail = new Trail();
    orStack = new Stack();
    if (null != goal)
    {
      orStack.push(new Unfolder(goal, this));
    }
View Full Code Here


    }
    if (provenGround())
    {
      return this;
    }
    Trail trail = new Trail();
    for (Entry entry : (Set<Entry>) dict.entrySet())
    {
      if (entry.getKey() instanceof String)
      {
        Var V = (Var) entry.getValue();
        long occNb = ((Int) dict.get(V)).longValue();
        String s = occNb < 2 && replaceAnonymous ? "_" : (String) entry.getKey();
        // bug: occNb not accurate when adding artif. '[]' head
        V.unify(new PseudoVar(s), trail);
      }
    }
    Clause NewC = (Clause) numberVars();
    trail.unwind(0);
    return NewC;
  }
View Full Code Here

   * shared term are not interfering, i.e as in:
   * SHARED.matches(NONSHARED,trail).
   */
  synchronized public boolean matches(Term that)
  {
    Trail trail = new Trail();
    boolean ok = unify(that, trail);
    trail.unwind(0);
    return ok;
  }
View Full Code Here

   * Synchronization happens over this, not over that. Make sure it is used as
   * SHARED.matching_copy(NONSHARED,trail).
   */
  synchronized public Term matchingCopy(Term that)
  {
    Trail trail = new Trail();
    boolean ok = unify(that, trail);
    // if(ok) that=that.copy();
    if (ok)
    {
      that = copy();
    }
    trail.unwind(0);
    return ok ? that : null;
  }
View Full Code Here

    // S.setPersistent(true);
    Term X = S.getElement();
    Term Xs = Const.NIL;
    if (null != X)
    {
      Xs = new LazyList(X, S, new Trail());
      p.getTrail().push(Xs);
    }
    return putArg(1, Xs, p);
  }
View Full Code Here

TOP

Related Classes of net.sf.kpex.util.Trail

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.