Software Watermarking: A Semantics-based Approach