Automatically Splitting a Two-Stage Lambda Calculus

نویسندگان

  • Nicolas Feltman
  • Carlo Angiuli
  • Umut A. Acar
  • Kayvon Fatahalian
چکیده

Staged programming languages assign a stage to each program expression and evaluate each expression in its assigned stage. A common use of staged languages is to describe programs where inputs arrive at different times or rates. In this paper we present an algorithm for statically splitting these mixed-staged programs into two unstaged, but dependent, programs where the outputs of the first program can be efficiently reused across multiple invocations of the second. While previous algorithms for performing this transformation (also called pass separation and data specialization) were limited to operate on simpler, imperative languages, we define a splitting algorithm for an explicitly-two-stage, typed lambda calculus λ with a © modality denoting computation at a later stage, and a ∇ modality noting purely first-stage code. Most notably, the algorithm splits mixed-stage recursive and higher-order functions. We prove the dynamic correctness of our splitting algorithm with respect to a partial-evaluation semantics, and mechanize this proof in Twelf. We also implement the algorithm in a prototype compiler, and demonstrate that the ability to split programs in a language featuring recursion and higher-order features enables non-trivial algorithmic transformations that improve code efficiency and also facilitates modular expression of staged programs.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

LIMIT AVERAGE SHADOWING AND DOMINATED SPLITTING

In this paper the notion of limit average shadowing property is introduced for diffeomorphisms on a compact smooth manifold M and a class of diffeomorphisms is given which has the limit average shadowing property, but does not have the shadowing property. Moreover, we prove that for a closed f-invariant set Lambda  of a diffeomorphism f, if Lambda is C1-stably limit average shadowing and t...

متن کامل

Intersection Logic in sequent calculus style

The intersection type assignment system has been designed directly as deductive system for assigning formulae of the implicative and conjunctive fragment of the intuitionistic logic to terms of lambda-calculus. But its relation with the logic is not standard. Between all the logics that have been proposed as its foundation, we consider ISL, which gives a logical interpretation of the intersecti...

متن کامل

Typed Answer Set Programming and Inverse Lambda Algorithms

Our broader goal is to automatically translate English sentences into formulas in appropriate knowledge representation languages as a step towards understanding and thus answering questions with respect to English text. Our focus in this paper is on the language of Answer Set Programming (ASP). Our approach to translate sentences to ASP rules is inspired by Montague’s use of lambda calculus for...

متن کامل

TILC: The Interactive Lambda-Calculus Tracer

This paper introduces TILC: the interactive lambda-calculus tracer. TILC aims to be a friendly user graphical application that helps teaching/studying the main basic concepts of pure untyped lambda-calculus. This is achieved by allowing users to graphically interact with a sort of parse-tree of the lambda-terms and automatically reproducing these interactions in the lambda-term. This graphical ...

متن کامل

Isomorphisms considered as equalities: Projecting functions and enhancing partial application through and implementation of lambda+

We propose an implementation of λ + , a recently introduced simply typed lambda-calculus with pairs where isomorphic types are made equal. The rewrite system of λ + is a rewrite system modulo an equivalence relation, which makes its implementation non-trivial. We also extend λ + with natural numbers and general recursion and use Beki´c's theorem to split mutual recursions. This splitting, toget...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016