Implement semantic analysis