A nesting-preserving transformation of SIMP programs into logically constrained term rewrite systems

In the last decade, several transformations of an imperative program into a logically constrained term rewrite system (LCTRS, for short) have been investigated and extended. They do not preserve the nesting of statements, generating rewrite rules like transition systems, while function calls are rep...

Full description

Saved in:
Bibliographic Details
Published inJournal of logical and algebraic methods in programming Vol. 144; p. 101045
Main Authors Nishida, Naoki, Kojima, Misaki, Matsumi, Ayuka
Format Journal Article
LanguageEnglish
Published Elsevier Inc 01.03.2025
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:In the last decade, several transformations of an imperative program into a logically constrained term rewrite system (LCTRS, for short) have been investigated and extended. They do not preserve the nesting of statements, generating rewrite rules like transition systems, while function calls are represented by the nesting of function symbols. Structural features of the original program must often be useful in analyzing the transformed LCTRS. To use such features, we have to know how to transform the program into the LCTRS by keeping the correspondence between statements in the program and the introduced auxiliary function symbols in the LCTRS, or by transforming the LCTRS into a control flow graph to, e.g., recover loop information. In this paper, we propose a nesting-preserving transformation of a SIMP program (a C-like integer program) into an LCTRS. The transformation is mostly based on previous work and introduces the nesting of function symbols that correspond to the nesting of statements in the original program. To be more precise, we propose a construction of a tree homomorphism which is used as a post-process of the transformation in previous work, i.e., which is applied to the LCTRS obtained from the program. As a correctness statement for the nesting-preserving transformation, we show that the tree homomorphism is sound and complete for the reduction of the LCTRS. •We propose a nesting-preserving transformation of SIMP programs into LCTRSs.•We propose a construction of an injective tree homomorphism which is applied to the LCTRS obtained from the program.•We show that the tree homomorphism is sound and complete for the reduction of the LCTRS.
ISSN:2352-2208
DOI:10.1016/j.jlamp.2025.101045