99 research outputs found

    Homeomorphic Embedding for Online Termination of Symbolic Methods

    No full text
    Well-quasi orders in general, and homeomorphic embedding in particular, have gained popularity to ensure the termination of techniques for program analysis, specialisation, transformation, and verification. In this paper we survey and discuss this use of homeomorphic embedding and clarify the advantages of such an approach over one using well-founded orders. We also discuss various extensions of the homeomorphic embedding relation. We conclude with a study of homeomorphic embedding in the context of metaprogramming, presenting some new (positive and negative) results and open problems

    Turchin's Relation for Call-by-Name Computations: A Formal Approach

    Full text link
    Supercompilation is a program transformation technique that was first described by V. F. Turchin in the 1970s. In supercompilation, Turchin's relation as a similarity relation on call-stack configurations is used both for call-by-value and call-by-name semantics to terminate unfolding of the program being transformed. In this paper, we give a formal grammar model of call-by-name stack behaviour. We classify the model in terms of the Chomsky hierarchy and then formally prove that Turchin's relation can terminate all computations generated by the model.Comment: In Proceedings VPT 2016, arXiv:1607.0183

    A hybrid approach to conjunctive partial evaluation of logic programs

    Full text link
    Conjunctive partial deduction is a well-known technique for the partial evaluation of logic programs. The original formulation follows the so called online approach where all termination decisions are taken on-the-fly. In contrast, offline partial evaluators first analyze the source program and produce an annotated version so that the partial evaluation phase should only follow these annotations to ensure the termination of the process. In this work, we introduce a lightweight approach to conjunctive partial deduction that combines some of the advantages of both online and offline styles of partial evaluation. © 2011 Springer-Verlag.This work has been partially supported by the Spanish Ministerio de Ciencia e Innovación under grant TIN2008-06622-C03-02 and by the Generalitat Valenciana under grant ACOMP/2010/042.Vidal Oriola, GF. (2011). A hybrid approach to conjunctive partial evaluation of logic programs. En Logic-Based Program Synthesis and Transformation. Springer Verlag (Germany). 6564:200-214. https://doi.org/10.1007/978-3-642-20551-4_13S2002146564Ben-Amram, A., Codish, M.: A SAT-Based Approach to Size Change Termination with Global Ranking Functions. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 218–232. Springer, Heidelberg (2007)Bruynooghe, M., De Schreye, D., Martens, B.: A General Criterion for Avoiding Infinite Unfolding during Partial Deduction of Logic Programs. In: Saraswat, V., Ueda, K. (eds.) Proc. 1991 Int’l Symp. on Logic Programming, pp. 117–131 (1991)Christensen, N.H., Glück, R.: Offline Partial Evaluation Can Be as Accurate as Online Partial Evaluation. ACM Transactions on Programming Languages and Systems 26(1), 191–220 (2004)Codish, M., Taboch, C.: A Semantic Basis for the Termination Analysis of Logic Programs. Journal of Logic Programming 41(1), 103–123 (1999)De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., Sørensen, M.H.: Conjunctive Partial Deduction: Foundations, Control, Algorihtms, and Experiments. Journal of Logic Programming 41(2&3), 231–277 (1999)Hruza, J., Stepánek, P.: Speedup of logic programs by binarization and partial deduction. TPLP 4(3), 355–380 (2004)Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, Englewood Cliffs (1993)Leuschel, M.: Homeomorphic Embedding for Online Termination of Symbolic Methods. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 379–403. Springer, Heidelberg (2002)Leuschel, M.: The DPPD (Dozens of Problems for Partial Deduction) Library of Benchmarks (2007), http://www.ecs.soton.ac.uk/~mal/systems/dppd.htmlLeuschel, M., Elphick, D., Varea, M., Craig, S., Fontaine, M.: The Ecce and Logen Partial Evaluators and Their Web Interfaces. In: Proc. of PEPM 2006, pp. 88–94. IBM Press (2006)Leuschel, M., Vidal, G.: Fast Offline Partial Evaluation of Large Logic Programs. In: Hanus, M. (ed.) LOPSTR 2008. LNCS, vol. 5438, pp. 119–134. Springer, Heidelberg (2009)Lloyd, J.W., Shepherdson, J.C.: Partial Evaluation in Logic Programming. Journal of Logic Programming 11, 217–242 (1991)Somogyi, Z.: A System of Precise Modes for Logic Programs. In: Shapiro, E.Y. (ed.) Proc. of Third Int’l Conf. on Logic Programming, pp. 769–787. The MIT Press, Cambridge (1986

    A Partial Evaluation Framework for Order-sorted Equational Programs modulo Axioms

    Full text link
    [EN] Partial evaluation is a powerful and general program optimization technique with many successful applications. Existing PE schemes do not apply to expressive rule-based languages like Maude, CafeOBJ, OBJ, ASF+SDF, and ELAN, which support: 1) rich type structures with sorts, subsorts, and overloading; and 2) equational rewriting modulo various combinations of axioms such as associativity, commutativity, and identity. In this paper, we develop the new foundations needed and illustrate the key concepts by showing how they apply to partial evaluation of expressive programs written in Maude. Our partial evaluation scheme is based on an automatic unfolding algorithm that computes term variants and relies on high-performance order-sorted equational least general generalization and order-sorted equational homeomorphic embedding algorithms for ensuring termination. We show that our partial evaluation technique is sound and complete for convergent rewrite theories that may contain various combinations of associativity, commutativity, and/or identity axioms for different binary operators. We demonstrate the effectiveness of Maude's automatic partial evaluator, Victoria, on several examples where it shows significant speed-ups. (C) 2019 Elsevier Inc. All rights reserved.This work has been partially supported by the EU (FEDER) and the Spanish MCIU under grant RTI2018-094403-B-C32, by Generalitat Valenciana under grant PROMETEO/2019/098, and by NRL under contract number N00173-17-1-G002. Angel Cuenca-Ortega has been supported by the SENESCYT, Ecuador (scholarship program 2013).Alpuente Frasnedo, M.; Cuenca-Ortega, AE.; Escobar Román, S.; Meseguer, J. (2020). A Partial Evaluation Framework for Order-sorted Equational Programs modulo Axioms. Journal of Logical and Algebraic Methods in Programming. 110:1-36. https://doi.org/10.1016/j.jlamp.2019.100501S13611

    A generic framework for the analysis and specialization of logic programs

    Get PDF
    The relationship between abstract interpretation and partial deduction has received considerable attention and (partial) integrations have been proposed starting from both the partial deduction and abstract interpretation perspectives. In this work we present what we argüe is the first fully described generic algorithm for efñcient and precise integration of abstract interpretation and partial deduction. Taking as starting point state-of-the-art algorithms for context-sensitive, polyvariant abstract interpretation and (abstract) partial deduction, we present an algorithm which combines the best of both worlds. Key ingredients include the accurate success propagation inherent to abstract interpretation and the powerful program transformations achievable by partial deduction. In our algorithm, the calis which appear in the analysis graph are not analyzed w.r.t. the original definition of the procedure but w.r.t. specialized definitions of these procedures. Such specialized definitions are obtained by applying both unfolding and abstract executability. Our framework is parametric w.r.t. different control strategies and abstract domains. Different combinations of such parameters correspond to existing algorithms for program analysis and specialization. Simultaneously, our approach opens the door to the efñcient computation of strictly more precise results than those achievable by each of the individual techniques. The algorithm is now one of the key components of the CiaoPP analysis and specialization system

    A Framework for Computing Finite SLD Trees

    Full text link
    The search space of SLD resolution, usually represented by means of a so-called SLD tree, is often infinite. However, there are many applications that must deal with possibly infinite SLD trees, like partial evaluation or some static analyses. In this context, being able to construct a finite representation of an infinite SLD tree becomes useful. In this work, we introduce a framework to construct a finite data structure representing the (possibly infinite) SLD derivations for a goal. This data structure, called closed SLD tree, is built using four basic operations: unfolding, flattening, splitting, and subsumption. We prove some basic properties for closed SLD trees, namely that both computed answers and calls are preserved. We present a couple of simple strategies for constructing closed SLD trees with different levels of abstraction, together with some examples of its application. Finally, we illustrate the viability of our approach by introducing a test case generator based on exploring closed SLD trees.This work has been partially supported by the EU (FEDER) and the Spanish Ministerio de Economia y Competitividad (Secretaria de Estado de Investigacion, Desarrollo e Innovacion) under grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under grant PROMETEO/2011/052.Nishid, N.; Vidal Oriola, GF. (2015). A Framework for Computing Finite SLD Trees. Journal of Logical and Algebraic Methods in Programming. 84(2):197-217. https://doi.org/10.1016/j.jlamp.2014.11.006S19721784

    Finiteness theorems in stochastic integer programming

    Full text link
    We study Graver test sets for families of linear multi-stage stochastic integer programs with varying number of scenarios. We show that these test sets can be decomposed into finitely many ``building blocks'', independent of the number of scenarios, and we give an effective procedure to compute these building blocks. The paper includes an introduction to Nash-Williams' theory of better-quasi-orderings, which is used to show termination of our algorithm. We also apply this theory to finiteness results for Hilbert functions.Comment: 36 p

    Normalisierung und partielle Auswertung von funktional-logischen Programmen

    Get PDF
    This thesis deals with the development of a normalization scheme and a partial evaluator for the functional logic programming language Curry. The functional logic programming paradigm combines the two most important fields of declarative programming, namely functional and logic programming. While functional languages provide concepts such as algebraic data types, higher-order functions or demanddriven evaluation, logic languages usually support a non-deterministic evaluation and a built-in search for results. Functional logic languages finally combine these two paradigms in an integrated way, hence providing multiple syntactic constructs and concepts to facilitate the concise notation of high-level programs. However, both the variety of syntactic constructs and the high degree of abstraction complicate the translation into efficient target programs. To reduce the syntactic complexity of functional logic languages, a typical compilation scheme incorporates a normalization phase to subsequently replace complex constructs by simpler ones until a minimal language subset is reached. While the individual transformations are usually simple, they also have to be correctly combined to make the syntactic constructs interact in the intended way. The efficiency of normalized programs can then be improved by means of different optimization techniques. A very powerful optimization technique is the partial evaluation of programs. Partial evaluation basically anticipates the execution of certain program fragments at compile time and computes a semantically equivalent program, which is usually more efficient at run time. Since partial evaluation is a fully automatic optimization technique, it can also be incorporated into the normal compilation scheme of programs. Nevertheless, this also requires termination of the optimization process, which establishes one of the main challenges for partial evaluation besides semantic equivalence. In this work we consider the language Curry as a representative of the functional logic programming paradigm. We develop a formal representation of the normalization process of Curry programs into a kernel language, while respecting the interference of different language constructs. We then define the dynamic semantics of this kernel language, before we subsequently develop a partial evaluation scheme and show its correctness and termination. Due to the previously described normalization process, this scheme is then directly applicable to arbitrary Curry programs. Furthermore, the implementation of a practical partial evaluator is sketched based on the partial evaluation scheme, and its applicability and usefulness is documented by a variety of typical partial evaluation examples

    Annotation of logic programs for independent AND-Parallelism by partial evaluation

    Full text link
    Traditional approaches to automatic AND-parallelization of logic programs rely on some static analysis to identify independent goals that can be safely and efficiently run in parallel in any possible execution. In this paper, we present a novel technique for generating annotations for independent AND-parallelism that is based on partial evaluation. Basically, we augment a simple partial evaluation procedure with (run-time) groundness and variable sharing information so that parallel conjunctions are added to the residual clauses when the conditions for independence are met. In contrast to previous approaches, our partial evaluator is able to transform the source program in order to expose more opportunities for parallelism. To the best of our knowledge, we present the first approach to a parallelizing partial evaluator.This work has been partially supported by the Spanish Ministerio de Economia y Competitividad (Secretaria de Estado de Investigacion, Desarrollo e Innovacion) under grant TIN2008-06622-C03-02 and by the Generalitat Valenciana under grant PROMETEO/2011/052.Vidal Oriola, GF. (2012). Annotation of logic programs for independent AND-Parallelism by partial evaluation. Theory and Practice of Logic Programming. 12(4-5):583-600. https://doi.org/10.1017/S1471068412000191S583600124-5Gras, D. C., & Hermenegildo, M. V. (2009). Non-strict independence-based program parallelization using sharing and freeness information. Theoretical Computer Science, 410(46), 4704-4723. doi:10.1016/j.tcs.2009.07.044Muthukumar, K., Bueno, F., García de la Banda, M., & Hermenegildo, M. (1999). Automatic compile-time parallelization of logic programs for restricted, goal level, independent and parallelism. The Journal of Logic Programming, 38(2), 165-218. doi:10.1016/s0743-1066(98)10022-5Leuschel, M., Elphick, D., Varea, M., Craig, S.-J., & Fontaine, M. (2006). The Ecce and Logen partial evaluators and their web interfaces. Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation - PEPM ’06. doi:10.1145/1111542.1111557SWI Prolog 2012. URL: http://www.swi-prolog.org/.Consel, C., & Danvy, O. (1993). Partial evaluation in parallel. Lisp and Symbolic Computation, 5(4), 327-342. doi:10.1007/bf01806309De Schreye, D., Glück, R., Jørgensen, J., Leuschel, M., Martens, B., & Sørensen, M. H. (1999). Conjunctive partial deduction: foundations, control, algorithms, and experiments. The Journal of Logic Programming, 41(2-3), 231-277. doi:10.1016/s0743-1066(99)00030-8Debois, S. (2004). Imperative program optimization by partial evaluation. Proceedings of the 2004 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation - PEPM ’04. doi:10.1145/1014007.1014019Debray, S. K. (1989). Static inference of modes and data dependencies in logic programs. ACM Transactions on Programming Languages and Systems, 11(3), 418-450. doi:10.1145/65979.65983Gallagher, J. P. (1993). Tutorial on specialisation of logic programs. Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation - PEPM ’93. doi:10.1145/154630.154640Gurr C. 1994. A Self-Applicable Partial Evaluator for the Logic Programming Language Goedel. PhD Thesis, Department of Computer Science, University of Bristol.Jones, N. D. (2004). Transformation by interpreter specialisation. Science of Computer Programming, 52(1-3), 307-339. doi:10.1016/j.scico.2004.03.010Leuschel, M., & Vidal, G. (2009). Fast Offline Partial Evaluation of Large Logic Programs. Lecture Notes in Computer Science, 119-134. doi:10.1007/978-3-642-00515-2_9Lloyd, J. W., & Shepherdson, J. C. (1991). Partial evaluation in logic programming. The Journal of Logic Programming, 11(3-4), 217-242. doi:10.1016/0743-1066(91)90027-
    • …
    corecore