On The Correctness Of Transactional Memory Algorithms