1. Specification transformation method for functional program generation based on partition-recursion refinement rule.
- Author
-
Zuo, Zhengkang, Zeng, Zhicheng, Su, Wei, Huang, Qing, Ke, Yuhan, Liu, Zengxin, Wang, Changjing, and Liang, Wei
- Subjects
- *
MULTIPLICATION , *POLYNOMIALS , *PROTOTYPES , *ALGORITHMS , *COMPUTER software - Abstract
Implementations that follow the functional programming paradigm are being used in more and more domains. As functional programming paradigm has mathematical reference transparency, refinement to functional programs contributes to improving the reliability of the transformation process and simplifying the refinement steps. However, it is a challenge to generate functional programs from specifications. Most existing transformation methods refine specifications into abstract algorithm-level programs based on loop invariants rather than functional programs. This paper proposes a novel functional program generation method based on the partition-recursion refinement rule. It establishes a novel program refinement framework based on functional theory for the first time. This is the first study to regard the whole program refinement process as a composition of abstract functions. This paper designs a recurrence-based algorithm design language (Radl+) and implements a software prototype to map Radl+ algorithms into executable Haskell programs. To prove the feasibility and efficiency of this method, this paper transforms the polynomial multiplication problem from a specification into an executable Haskell program. This case shows that compared with existing approaches, the proposed method can simplify the transformation steps and reduce the number of lines of generated code from 38 to 10. • Novel refinement framework provides a new approach to generating a functional program. • The composition of abstract functions explains the program refinement process. • Substitution rule and Recursion rule have none of the side effects. • Software prototype transforms the polynomial multiplication problem into Haskell program. [ABSTRACT FROM AUTHOR]
- Published
- 2023
- Full Text
- View/download PDF