2,625 research outputs found

    C++ Templates as Partial Evaluation

    Full text link
    This paper explores the relationship between C++ templates and partial evaluation. Templates were designed to support generic programming, but unintentionally provided the ability to perform compile-time computations and code generation. These features are completely accidental, and as a result their syntax is awkward. By recasting these features in terms of partial evaluation, a much simpler syntax can be achieved. C++ may be regarded as a two-level language in which types are first-class values. Template instantiation resembles an offline partial evaluator. This paper describes preliminary work toward a single mechanism based on Partial Evaluation which unifies generic programming, compile-time computation and code generation. The language Catat is introduced to illustrate these ideas.Comment: 13 page

    Efficient Orthogonal Tensor Decomposition, with an Application to Latent Variable Model Learning

    Full text link
    Decomposing tensors into orthogonal factors is a well-known task in statistics, machine learning, and signal processing. We study orthogonal outer product decompositions where the factors in the summands in the decomposition are required to be orthogonal across summands, by relating this orthogonal decomposition to the singular value decompositions of the flattenings. We show that it is a non-trivial assumption for a tensor to have such an orthogonal decomposition, and we show that it is unique (up to natural symmetries) in case it exists, in which case we also demonstrate how it can be efficiently and reliably obtained by a sequence of singular value decompositions. We demonstrate how the factoring algorithm can be applied for parameter identification in latent variable and mixture models

    Bottleneck Surfaces and Worldsheet Geometry of Higher-Curvature Quantum Gravity

    Full text link
    We describe a simple lattice model of higher-curvature quantum gravity in two dimensions and study the phase structure of the theory as a function of the curvature coupling. It is shown that the ensemble of flat graphs is entropically unstable to the formation of baby universes. In these simplified models the growth in graphs exhibits a branched polymer behaviour in the phase directly before the flattening transition.Comment: 18 pages LaTeX, 3 .eps figures, uses epsf.tex; clarifying comments added and typos correcte

    Vacuum Tunneling and Periodic Structure in Lattice Higgs Models

    Get PDF
    Using a geometric definition for the lattice Chern-Simons term in even dimensions, we have studied the distribution of Chern-Simons numbers for the 2d-U(1) and the 4d-SU(2) lattice Higgs models. The periodic structure of the distributions is preserved in our lattice formulation and has been examined in detail. In both cases the finite size effects visible in the distribution of Chern-Simons numbers are well accounted for by the Haar measure. Moreover, we find that NCS2\langle N_{CS}^2 \rangle grows with the spatial volume. We also find numerical evidence that tunneling in 4d is increased at high temperature. (PS-File including Figures available via E-mail: [email protected])Comment: 25 pages, 5 figures, LaTeX (+ PicLaTeX) file, HLRZ-93-08 and BI-TP 93/0

    Software (Re-)Engineering with PSF III: an IDE for PSF

    Full text link
    We describe the design of an integrated development environment (IDE) for PSF. In the software engineering process we used process algebra in the form of PSF for the specification of the architecture of the IDE. This specification is refined to a PSF specification of the IDE system as a ToolBus application, by applying vertical and horizontal implementation techniques. We implemented the various tools as specified and connected them with a ToolBus script extracted from the system specification

    Extended Initiality for Typed Abstract Syntax

    Full text link
    Initial Semantics aims at interpreting the syntax associated to a signature as the initial object of some category of 'models', yielding induction and recursion principles for abstract syntax. Zsid\'o proves an initiality result for simply-typed syntax: given a signature S, the abstract syntax associated to S constitutes the initial object in a category of models of S in monads. However, the iteration principle her theorem provides only accounts for translations between two languages over a fixed set of object types. We generalize Zsid\'o's notion of model such that object types may vary, yielding a larger category, while preserving initiality of the syntax therein. Thus we obtain an extended initiality theorem for typed abstract syntax, in which translations between terms over different types can be specified via the associated category-theoretic iteration operator as an initial morphism. Our definitions ensure that translations specified via initiality are type-safe, i.e. compatible with the typing in the source and target language in the obvious sense. Our main example is given via the propositions-as-types paradigm: we specify propositions and inference rules of classical and intuitionistic propositional logics through their respective typed signatures. Afterwards we use the category--theoretic iteration operator to specify a double negation translation from the former to the latter. A second example is given by the signature of PCF. For this particular case, we formalize the theorem in the proof assistant Coq. Afterwards we specify, via the category-theoretic iteration operator, translations from PCF to the untyped lambda calculus

    Explicit connection actions in multiparty session types

    Get PDF
    This work extends asynchronous multiparty session types (MPST) with explicit connection actions to support protocols with op- tional and dynamic participants. The actions by which endpoints are connected and disconnected are a key element of real-world protocols that is not treated in existing MPST works. In addition, the use cases motivating explicit connections often require a more relaxed form of mul- tiparty choice: these extensions do not satisfy the conservative restric- tions used to ensure safety in standard syntactic MPST. Instead, we de- velop a modelling-based approach to validate MPST safety and progress for these enriched protocols. We present a toolchain implementation, for distributed programming based on our extended MPST in Java, and a core formalism, demonstrating the soundness of our approach. We discuss key implementation issues related to the proposed extensions: a practi- cal treatment of choice subtyping for MPST progress, and multiparty correlation of dynamic binary connections

    Parsing Expression Grammars Made Practical

    Full text link
    Parsing Expression Grammars (PEGs) define languages by specifying recursive-descent parser that recognises them. The PEG formalism exhibits desirable properties, such as closure under composition, built-in disambiguation, unification of syntactic and lexical concerns, and closely matching programmer intuition. Unfortunately, state of the art PEG parsers struggle with left-recursive grammar rules, which are not supported by the original definition of the formalism and can lead to infinite recursion under naive implementations. Likewise, support for associativity and explicit precedence is spotty. To remedy these issues, we introduce Autumn, a general purpose PEG library that supports left-recursion, left and right associativity and precedence rules, and does so efficiently. Furthermore, we identify infix and postfix operators as a major source of inefficiency in left-recursive PEG parsers and show how to tackle this problem. We also explore the extensibility of the PEG paradigm by showing how one can easily introduce new parsing operators and how our parser accommodates custom memoization and error handling strategies. We compare our parser to both state of the art and battle-tested PEG and CFG parsers, such as Rats!, Parboiled and ANTLR.Comment: "Proceedings of the International Conference on Software Language Engineering (SLE 2015)" - 167-172 (ISBN : 978-1-4503-3686-4
    corecore