private void resetTarget() {

	System.out.println("\n--------- reset redex ----------");
	//System.out.println(this);

	if (target == null) {

	    // handle the information about module
	    Equation[] eqs = (Equation[])(module.equations.toArray());
	    Hashtable op2eq = new Hashtable();

	    for (int i=0; i<eqs.length; i++) {
		Term left = eqs[i].getLeft();
		if (left.getTopOperation() != null) {
		    Vector tmp = (Vector)op2eq.get(left.getTopOperation().getName());
		    if (tmp == null)
			tmp = new Vector();
		    tmp.addElement(eqs[i]);
		    op2eq.put(left.getTopOperation().getName(), tmp);
		}
	    }


	    Vector conside = new Vector();
	    if (operation != null) {    
		conside = (Vector)op2eq.get(operation.getName());
	    }

	    //System.out.println("\n======== conside for term "+term);
	    //System.out.println(conside);

	    if (conside == null) {
		conside = new Vector();
	    }

	    for (int i=0; i<conside.size(); i++) {
		Equation eq = (Equation)conside.elementAt(i);
		Term left = eq.getLeft();
		Term right = eq.getRight();
		Term cond = eq.getCondition();

		Hashtable var2term = getMatch(this.toTerm(), left);

		//System.out.println("what ==== "+var2term);

		if (var2term != null ) {
		    Enumeration e = var2term.keys();
		    while (e.hasMoreElements()) {
			Variable var = (Variable)e.nextElement();
			Term trm = (Term)var2term.get(var);
			right = right.subst(var, trm);
		    }

		    //System.out.println("find equation: "+eq);
		    //System.out.println("right: "+right);

		    target = new ReducedTerm(right, module);
		    break;
		}
     
	    }

	}

	System.out.println("------ done ------");
    }