improve the datalog  dependency graph generator 

deal with all types of functions