Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Functional Reactive Programming (FRP) is a high-level declarative language for programming reactive systems. Previous work on FRP has demonstrated its utility in a wide range of application domains, including animation, graphical user interfaces, and robotics. FRP has an elegant continuous-time denotational semantics. However, it guarantees no bounds on execution time or space, thus making it unsuitable for many embedded real-time applications. To alleviate this problem, we recently developed Real-Time FRP (RT-FRP), whose operational semantics permits us to formally guarantee bounds on both execution time and space. In this paper we present a formally veriable compilation strategy from a new language based on RT-FRP into imperative code. The new language, called Event-Driven. | Event-Driven FRP Zhanyong Wan Walid Taha and Paul Hudak Department of Computer Science Yale University New Haven CT USA wan-zhanyong taha hudak-paul @cs.yale.edu Abstract. Functional Reactive Programming FRP is a high-level declarative language for programming reactive systems. Previous work on FRP has demonstrated its utility in a wide range of application domains including animation graphical user interfaces and robotics. FRP has an elegant continuous-time denotational semantics. However it guarantees no bounds on execution time or space thus making it unsuitable for many embedded real-time applications. To alleviate this problem we recently developed Real-Time FRP RT-FRP whose operational semantics permits us to formally guarantee bounds on both execution time and space. In this paper we present a formally verifiable compilation strategy from a new language based on RT-FRP into imperative code. The new language called Event-Driven FRP E-FRP is more tuned to the paradigm of having multiple external events. While it is smaller than RT-FRP it features a key construct that allows us to compile the language into effl-cient code. We have used this language and its compiler to generate code for a small robot controller that runs on a PIC16C66 micro-controller. Because the formal specification of compilation was crafted more for clarity and for technical convenience we describe an implementation that produces more efficient code. 1 Introduction Functional Reactive Programming FRP 12 19 is a high-level declarative language for programming reactive systems. A reactive system is one that continually responds to external stimuli. FRP has been used successfully in domains such as interactive computer animation 6 graphical user interface design 5 computer vision 15 robotics 14 and control systems. FRP is sufficiently high-level that for many domains FRP programs closely resemble equations naturally written by domain experts to specify the problems. For example in the domain .