Semantics preserving transformation rules for Prolog