Compositionality of SLD-derivations and their abstractions