Logic Programming as Hypergraph Rewriting