Mapping Fusion and Synchronized Hyperedge Replacement into Logic Programming