707,795 research outputs found

    Evolutionary improvement of programs

    Get PDF
    Most applications of genetic programming (GP) involve the creation of an entirely new function, program or expression to solve a specific problem. In this paper, we propose a new approach that applies GP to improve existing software by optimizing its non-functional properties such as execution time, memory usage, or power consumption. In general, satisfying non-functional requirements is a difficult task and often achieved in part by optimizing compilers. However, modern compilers are in general not always able to produce semantically equivalent alternatives that optimize non-functional properties, even if such alternatives are known to exist: this is usually due to the limited local nature of such optimizations. In this paper, we discuss how best to combine and extend the existing evolutionary methods of GP, multiobjective optimization, and coevolution in order to improve existing software. Given as input the implementation of a function, we attempt to evolve a semantically equivalent version, in this case optimized to reduce execution time subject to a given probability distribution of inputs. We demonstrate that our framework is able to produce non-obvious optimizations that compilers are not yet able to generate on eight example functions. We employ a coevolved population of test cases to encourage the preservation of the function's semantics. We exploit the original program both through seeding of the population in order to focus the search, and as an oracle for testing purposes. As well as discussing the issues that arise when attempting to improve software, we employ rigorous experimental method to provide interesting and practical insights to suggest how to address these issues

    Combining Static and Dynamic Contract Checking for Curry

    Full text link
    Static type systems are usually not sufficient to express all requirements on function calls. Hence, contracts with pre- and postconditions can be used to express more complex constraints on operations. Contracts can be checked at run time to ensure that operations are only invoked with reasonable arguments and return intended results. Although such dynamic contract checking provides more reliable program execution, it requires execution time and could lead to program crashes that might be detected with more advanced methods at compile time. To improve this situation for declarative languages, we present an approach to combine static and dynamic contract checking for the functional logic language Curry. Based on a formal model of contract checking for functional logic programming, we propose an automatic method to verify contracts at compile time. If a contract is successfully verified, dynamic checking of it can be omitted. This method decreases execution time without degrading reliable program execution. In the best case, when all contracts are statically verified, it provides trust in the software since crashes due to contract violations cannot occur during program execution.Comment: Pre-proceedings paper presented at the 27th International Symposium on Logic-Based Program Synthesis and Transformation (LOPSTR 2017), Namur, Belgium, 10-12 October 2017 (arXiv:1708.07854

    Reachability Analysis of Innermost Rewriting

    Get PDF
    We consider the problem of inferring a grammar describing the output of a functional program given a grammar describing its input. Solutions to this problem are helpful for detecting bugs or proving safety properties of functional programs and, several rewriting tools exist for solving this problem. However, known grammar inference techniques are not able to take evaluation strategies of the program into account. This yields very imprecise results when the evaluation strategy matters. In this work, we adapt the Tree Automata Completion algorithm to approximate accurately the set of terms reachable by rewriting under the innermost strategy. We prove that the proposed technique is sound and precise w.r.t. innermost rewriting. The proposed algorithm has been implemented in the Timbuk reachability tool. Experiments show that it noticeably improves the accuracy of static analysis for functional programs using the call-by-value evaluation strategy

    Proof mining with the bounded functional interpretation

    Get PDF
    In this doctoral thesis, we will see how the bounded functional interpretation of Ferreira and Oliva [13] can be used and contribute to the Proof Mining program, a program which aims to extract computational information from mathematical theorems using proof-theoretic techniques. We present a method for the elimination of sequential weak compactness arguments from the quantitative analysis of certain mathematical results. This method works as a “macro” and allowed us to obtain quantitative versions of important results of F. E. Browder [6], R. Wittmann [51] and H. H. Bauschke [2] in fixed point theory in Hilbert spaces. Although Browder’s and Wittmann’s theorems were previously analyzed by Kohlenbach using the monotone functional interpretation, it was not clear why such analyses did not require the use of functionals defined by bar recursion. This phenomenon is now fully understood, by a theoretical justification for the elimination of sequential weak compactness in the context of the bounded functional interpretation. Bauschke’s theorem is an important generalization of Wittmann’s theorem and its original proof is also analyzed here. The analyses of these results also required a quantitative version of a projection argument which turned out to be simpler when guided by the bounded functional interpretation than when using the monotone functional interpretation. In the context of the theory of monotone operators, results due to Boikanyo/Moro¸sanu [5] and Xu [52] for the strong convergence of variants of the proximal point algorithm were analyzed and bounds on the metastablility property of these iterations obtained. These results are the first applications of the bounded functional interpretation to the proof mining of concrete mathematical results

    Static Application-Level Race Detection in STM Haskell using Contracts

    Get PDF
    Writing concurrent programs is a hard task, even when using high-level synchronization primitives such as transactional memories together with a functional language with well-controlled side-effects such as Haskell, because the interferences generated by the processes to each other can occur at different levels and in a very subtle way. The problem occurs when a thread leaves or exposes the shared data in an inconsistent state with respect to the application logic or the real meaning of the data. In this paper, we propose to associate contracts to transactions and we define a program transformation that makes it possible to extend static contract checking in the context of STM Haskell. As a result, we are able to check statically that each transaction of a STM Haskell program handles the shared data in a such way that a given consistency property, expressed in the form of a user-defined boolean function, is preserved. This ensures that bad interference will not occur during the execution of the concurrent program.Comment: In Proceedings PLACES 2013, arXiv:1312.2218. [email protected]; [email protected]

    Resynchronization of Lactating Dairy Cows at Open Pregnancy Diagnosis Based on the Presence or Absence of a Corpus Luteum: A Practical Approach

    Get PDF
    Lactating Holstein cows in three herds were enrolled in a study at the time of nonpregnancy diagnosis. Cows were assigned to a resynchronization program based on ovarian structures determined by transrectal ultrasonography. Three resynchronization treatments were employed starting on the day of open diagnosis to test: (1) accuracy of ultrasound technician’s ability to identify a functional corpus luteum (CL); (2) whether an initial GnRH injection is required to start resynchronization when a CL is present at nonpregnant diagnosis (Short Synch: PGF2α — 24 hours — PGF2α — 32 hours — GnRH — 16 hours — timed artificial insemination [AI]); and (3) whether applying progesterone to cows without a CL as part of a traditional Ovsynch program (CIDR + Ovsynch: GnRH + CIDR insert — 7 days — PGF2α + CIDR removal — 24 hours — PGF2α — 32 hours — GnRH — 16 hours — timed AI) would be equivalent to a standard Ovsynch program (same as CIDR-Ovsynch treatment but no CIDR was applied). Treatments produced similar proportions of pregnancies per AI, with a tendency for increased fertility when the first injection of GnRH was administered as part of a standard Ovsynch. The technician’s ability to detect a functional CL was more accurate when the CL visualized was actually functional (progesterone ≥ 1 ng/mL) than when it was not functional (progesterone \u3c 1 ng/mL). Although pregnancy outcomes tended to improve when cows were treated with Ovsynch compared with Short Synch, when a functional CL was accurately detected, pregnancy outcomes did not differ. Technician accuracy for detecting a functional CL is important for improving pregnancy outcomes when applying the Short Synch treatment

    Do ACE inhibitors improve the response to exercise training in functionally impaired older adults? A randomized controlled trial

    Get PDF
    <br>Background: Loss of muscle mass and strength with ageing is a major cause for falls, disability, and morbidity in older people. Previous studies have found that angiotensin-converting enzyme inhibitors (ACEi) may improve physical function in older people. It is unclear whether ACEi provide additional benefit when added to a standard exercise training program. We examined the effects of ACEi therapy on physical function in older people undergoing exercise training.</br> <b>Methods:</b> Community-dwelling people aged ≥65 years with functional impairment were recruited through general (family) practices. All participants received progressive exercise training. Participants were randomized to receive either 4 mg perindopril or matching placebo daily for 20 weeks. The primary outcome was between-group change in 6-minute walk distance from baseline to 20 weeks. Secondary outcomes included changes in Short Physical Performance Battery, handgrip and quadriceps strength, self-reported quality of life using the EQ-5D, and functional impairment measured using the Functional Limitations Profile.<p></p> <b>Results:</b> A total of 170 participants (n = 86 perindopril, n = 84 placebo) were randomized. Mean age was 75.7 (standard deviation [SD] 6.8) years. Baseline 6-minute walk distance was 306 m (SD 99). Both groups increased their walk distance (by 29.6 m perindopril, 36.4 m placebo group) at 20 weeks, but there was no statistically significant treatment effect between groups (−8.6m [95% confidence interval: −30.1, 12.9], p = .43). No statistically significant treatment effects were observed between groups for the secondary outcomes. Adverse events leading to withdrawal were few (n = 0 perindopril, n = 4 placebo).<p></p> <b>Interpretation:</b> ACE inhibitors did not enhance the effect of exercise training on physical function in functionally impaired older people.<p></p&gt

    CHAD: Combinatory Homomorphic Automatic Differentiation

    Get PDF
    We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a principled, pure, provably correct define-then-run method for performing forward and reverse mode automatic differentiation (AD) on programming languages with expressive features. It implements AD as a compositional, type-respecting source-code transformation that generates purely functional code. This code transformation is principled in the sense that it is the unique homomorphic (structure preserving) extension to expressive languages of Elliott's well-known and unambiguous definitions of AD for a first-order functional language. Correctness of the method follows by a (compositional) logical relations argument that shows that the semantics of the syntactic derivative is the usual calculus derivative of the semantics of the original program. In their most elegant formulation, the transformations generate code with linear types. However, the code transformations can be implemented in a standard functional language lacking linear types: while the correctness proof requires tracking of linearity, the actual transformations do not. In fact, even in a standard functional language, we can get all of the type-safety that linear types give us: we can implement all linear types used to type the transformations as abstract types, by using a basic module system. In this paper, we detail the method when applied to a simple higher-order language for manipulating statically sized arrays. However, we explain how the methodology applies, more generally, to functional languages with other expressive features. Finally, we discuss how the scope of CHAD extends beyond applications in AD to other dynamic program analyses that accumulate data in a commutative monoid.Comment: arXiv admin note: substantial text overlap with arXiv:2007.0528
    corecore