jason.asSemantics
Class Unifier

Package class diagram package Unifier
java.lang.Object
  extended by jason.asSemantics.Unifier
All Implemented Interfaces:
java.lang.Cloneable

public class Unifier
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  java.util.HashMap<VarTerm,Term> function
           
 
Constructor Summary
Unifier()
           
 
Method Summary
 void apply(Pred p)
          Deprecated. use p.apply(un) instead.
 void apply(Term t)
          Deprecated. use t.apply(un) instead.
 void bind(VarTerm vt1, VarTerm vt2)
           
 void clear()
           
 Unifier clone()
           
 void compose(Unifier u)
          add all unifications from u
 VarTerm deref(VarTerm v)
           
 boolean equals(java.lang.Object o)
           
 Term get(java.lang.String var)
          gets the value for a Var, if it is unified with another var, gets this other's value
 Term get(VarTerm vtp)
          gets the value for a Var, if it is unified with another var, gets this other's value
 org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
          get as XML
 Term getAsTerm()
           
 int size()
           
 java.lang.String toString()
           
 boolean unifies(Term t1, Term t2)
          this version of unifies undo the variables' mapping if the unification fails.
 boolean unifies(Trigger te1, Trigger te2)
           
 boolean unifiesNoUndo(Term t1g, Term t2g)
          this version of unifies does not undo the variables' mapping in case of failure.
 boolean unifiesNoUndo(Trigger te1, Trigger te2)
           
protected  boolean unifyTerms(Term t1g, Term t2g)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

function

protected java.util.HashMap<VarTerm,Term> function
Constructor Detail

Unifier

public Unifier()
Method Detail

apply

public void apply(Term t)
Deprecated. use t.apply(un) instead.


apply

public void apply(Pred p)
Deprecated. use p.apply(un) instead.


get

public Term get(java.lang.String var)
gets the value for a Var, if it is unified with another var, gets this other's value


get

public Term get(VarTerm vtp)
gets the value for a Var, if it is unified with another var, gets this other's value


unifies

public boolean unifies(Trigger te1,
                       Trigger te2)

unifiesNoUndo

public boolean unifiesNoUndo(Trigger te1,
                             Trigger te2)

unifies

public boolean unifies(Term t1,
                       Term t2)
this version of unifies undo the variables' mapping if the unification fails. E.g. u.unifier( a(X,10), a(1,1) ); does not change u, i.e., u = {}


unifiesNoUndo

public boolean unifiesNoUndo(Term t1g,
                             Term t2g)
this version of unifies does not undo the variables' mapping in case of failure. It is however faster than the version with undo. E.g. u.unifier( a(X,10), a(1,1) ); fails, but changes u to {X = 10}


unifyTerms

protected boolean unifyTerms(Term t1g,
                             Term t2g)

deref

public VarTerm deref(VarTerm v)

bind

public void bind(VarTerm vt1,
                 VarTerm vt2)

clear

public void clear()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAsTerm

public Term getAsTerm()

size

public int size()

compose

public void compose(Unifier u)
add all unifications from u


clone

public Unifier clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAsDOM

public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
get as XML