fuctional programming, graph reduction