We explore space improvements in LRP, a polymorphically typed call-by-need functional core language. A relaxed space measure is chosen for the maximal size usage during an evaluation. It abstracts from the details of the implementation via abstract machines, but it takes garbage collection into account and thus can be seen as a realistic approximation of space usage. The results are: a context lemma for space improving translations and for space equivalences; all but one reduction rule of the calculus are shown to be space improvements, and for the exceptional one we show bounds on the space increase. Several further program transformations are shown to be space improvements or space equivalences, in particular the translation into machine expressions is a space equivalence. We also classify certain space-worsening transformations as space-leaks or as space-safe. These results are a step forward in making predictions about the change in runtime space behavior of optimizing transformations in call-by-need functional languages. * supported by the Deutsche Forschungsgemeinschaft (DFG) under grant SCHM 986/11-1.
We present an implementation of an interpreter LRPi for the call-by-need calculus LRP, based on a variant of Sestoft's abstract machine Mark 1, extended with an eager garbage collector. It is used as a tool for exact space usage analyses as a support for our investigations into space improvements of call-by-need calculi.
This paper is a contribution to exploring and analyzing space-improvements in concurrent programming languages, in particular in the functional process-calculus CHF. Space-improvements are defined as a generalization of the corresponding notion in deterministic pure functional languages. The main part of the paper is the O(n · log n) algorithm SPOPTN for offline space optimization of several parallel independent processes. Applications of this algorithm are: (i) affirmation of space improving transformations for particular classes of program transformations; (ii) support of an interpreter-based method for refuting space-improvements; and (iii) as a stand-alone offline-optimizer for space (or similar resources) of parallel processes.• (independent) concurrent threads, independent of a programming language.Our model is also extended to synchronization constraints in the form of a Boolean combination of conditions on simultaneous and/or relative time points of two threads. The results for the space optimization for synchronization-free processes can be transferred to processes with synchronizations and permits polynomial algorithms for a fixed number of synchronization constructs (see Theorem 6.2) and therefore allows further analyses of space in more concrete scenarios. In general, i.e. for arbitrary Boolean constraints, finding the minimum is NP-complete (Theorem 6.4).The concrete programming language model that we investigate is the functional process calculus CHF, a variant of Concurrent Haskell, which permits pure and declarative functional modelling in combination with sequential (monadic) execution of processes with synchronization and which employs lazy evaluation [2,7,8]. Related work on space improvements in deterministic call-by-need functional languages is [5,6,10].An application of results and algorithms for the space-minimization task in special cases is on the one hand to identify program transformation as space improvements (in CHF) and on the other hand to accelerate an automated search for potential counterexamples to conjectures of space-improvements. Space optimization of parallel processes can sometimes be also applied to CHF-programs. For example for processes that are deterministically parallel, i.e. there is no sharing between processes, no free variables and the computation terminates. In these special cases the notion of space improvement is the same as space optimization.The structure of the paper is first to informally explain the functional process calculus CHF * GC and a definition of a space improvement in Section 2. A process-model and the interleaving is defined in Section 3. Then the computation of a standard form as a preparation of space optimization is given in Section 4. The optimization algorithm SPOPTN is defined in Section 5, where also the correctness and complexity are determined in Theorem 5.6. Extensions for synchronization constructs are in Section 6. Section 7 illustrates a relation to other scheduling methods and reports on an implementation and use of the algorithm. T...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.