Verifying Opacity of a Modified PSTM

Software transactional memory (STM) provides programmers with a high-level programming abstraction for synchronization of parallel processes, allowing blocks of codes that execute in an interleaved manner to be treated as an atomic block. Python Software Transactional Memory (PSTM) is an STM implementation in Python language. Its presentation fills a gap that Python lacks an applicable and reliable software transactional memory. PSTM satisfies the basic transaction properties, however it does not satisfy opacity, which defines conditions for serialising concurrent transaction. To alleviate this issue, we modify the PSTM implementation and present a new PSTM called PSTM-M. Based on PSTM-M, we verify opacity of this implementation. We present the formalization of opacity which is based on the history model of transaction. Further, we explain why PSTM does not satisfy opacity and present a modified PSTM called PSTM-M. Finally, we give a machine-checked proof for the opacity of PSTM-M based on the theorem prover Coq.