Logic programming as hypergraph Rewriting