Transforming concurrent programs with semaphores into logically constrained term rewrite systems - Kojima, Misaki; Nishida, Naoki; Matsubara, Yutaka (Journal of logical and algebraic methods in programming, 2025)
In this paper, as a first step of modeling concurrent programs by logically constrained term rewrite systems (LCTRSs, for short), we show transformations of concurrent programs with semaphore-based exclusive control into LCTRSs. To this end, we show how to encode configurations of concurrent programs with a fixed number of processes. Then, we show how to encode some well-known operations for semaphores by rewrite rules, showing two transformations of concurrent programs with semaphores into LCTRSs. We adopt list-using and list-free approaches to the encoding of waiting queues for semaphores in LCTRSs. While the former straightforwardly uses lists, the latter uses a so-called take-a-number system in order to avoid using any recursive data structures for waiting queues. •We extend a transformation of sequential programs into LCTRSs to concurrent programs with semaphores.•We show list-using and list-free approaches to the encoding of waiting queues for semaphores.•The list-free approach uses a take-a-number system to avoid using any recursive data structures for waiting queues.