Evaluation of functional expressions by hypergraph rewriting