private static boolean isDirectObservation(Term term) {

	if (term.var != null) {
	    return true;
        } else if (term.operation.isBehavorial()) {

            // check whether it has hidden varable
            boolean found = false;
	    for (int i=0; i<term.subterms.length; i++) {
		if (term.subterms[i].var != null &&
		    term.subterms[i].var.sort.isHidden()) {
		    found = true;
		    break;
		}		    
	    }

	    if (found) {
		return ! term.operation.resultSort.isHidden();
	    } else {
		for (int i=0; i<term.subterms.length; i++) {
		    if (!isDirectObservation(term.subterms[i])) {
			return false;
		    }
		}
		return true;
	    }

	} else {
	    return false;
	}
    }