101 research outputs found

    Monoids with tests and the algebra of possibly non-halting programs

    Get PDF
    We study the algebraic theory of computable functions, which can be viewed as arising from possibly non-halting computer programs or algorithms, acting on some state space, equipped with operations of composition, if-then-else and while-do defined in terms of a Boolean algebra of conditions. It has previously been shown that there is no finite axiomatisation of algebras of partial functions under these operations alone, and this holds even if one restricts attention to transformations (representing halting programs) rather than partial functions, and omits while-do from the signature. In the halting case, there is a natural “fix”, which is to allow composition of halting programs with conditions, and then the resulting algebras admit a finite axiomatisation. In the current setting such compositions are not possible, but by extending the notion of if-then-else, we are able to give finite axiomatisations of the resulting algebras of (partial) functions, with while-do in the signature if the state space is assumed finite. The axiomatisations are extended to consider the partial predicate of equality. All algebras considered turn out to be enrichments of the notion of a (one-sided) restriction semigrou

    Semigroups with if-then-else and halting programs

    Get PDF
    The "if–then–else" construction is one of the most elementary programming commands, and its abstract laws have been widely studied, starting with McCarthy. Possibly, the most obvious extension of this is to include the operation of composition of programs, which gives a semigroup of functions (total, partial, or possibly general binary relations) that can be recombined using if–then–else. We show that this particular extension admits no finite complete axiomatization and instead focus on the case where composition of functions with predicates is also allowed (and we argue there is good reason to take this approach). In the case of total functions — modeling halting programs — we give a complete axiomatization for the theory in terms of a finite system of equations. We obtain a similar result when an operation of equality test and/or fixed point test is included

    Axioms for signatures with domain and demonic composition

    Get PDF
    Demonic composition ∗ is an associative operation on binary relations, and demonic refinement ⊑ is a partial order on binary relations. Other operations on binary relations considered here include the unary domain operation D and the left restrictive multiplication operation ∘ given by s∘t=D(s)∗t. We show that the class of relation algebras of signature {⊑,D,∗}, or equivalently {⊆,∘,∗}, has no finite axiomatisation. A large number of other non-finite axiomatisability consequences of this result are also given, along with some further negative results for related signatures. On the positive side, a finite set of axioms is obtained for relation algebras with signature {⊑,∘,∗}, hence also for {⊆,∘,∗}

    The Algebraic Properties of if-then-else with Commutative Three-Valued Tests

    Get PDF
    This thesis studies an algebraic model of computable programs and the if-then-else operation. The programs here are considered deterministic, but not assumed to be always halting, so they are modelled by a semigroup of partial functions, with several extra operations in addition to the original binary operation of the semigroup. The if-then-else operation involves not only programs, but logical tests too. Hence, it calls for a separate algebra of tests. Evaluating a test often requires running another program, so the tests are also possibly non halting. When tests do not always halt, the results of conjunctions (logical ‘and’) and disjunctions (logical ‘or’) can differ, depending on whether sequential or parallel evaluation is applied. The parallel evaluation is what this thesis adopts. The overall ‘program algebra’ consists of two sorts, one of programs and the other of tests. Each sort has its own operations, and there are hybrid operations such as if-then-else which involve both sorts. This thesis establishes the axioms of all these operations by building an embedding from the abstract program algebra into a concrete one. At the end is a discussion on the algebra of tests without the programs, where the differences between the two evaluation paradigms are explored in detail

    Unbounded loops in quantum programs: categories and weak while loops

    Get PDF
    Control flow of quantum programs is often divided into two different classes: classical and quantum. Quantum programs with classical control flow have their conditional branching determined by the classical outcome of measurements, and these collapse quantum data. Conversely, quantum control flow is coherent, i.e. it does not perturb quantum data; quantum walk-based algorithms are practical examples where coherent quantum feedback plays a major role. This dissertation has two main contributions: (i) a categorical study of coherent quantum iteration and (ii) the introduction of weak while loops. (i) The objective is to endow categories of quantum processes with a traced monoidal structure capable of modelling iterative quantum loops. To this end, the trace of a morphism is calculated via the execution formula, which adds up the contribution of all possible paths of the control flow. Haghverdi's unique decomposition categories are generalised to admit additive inverses and equipped with convergence criteria using basic topology. In this setting, it is possible to prove the validity of the execution formula as a categorical trace on certain categories of quantum processes. (ii) A weak while loop is a classical control flow primitive that offers a trade-off between the collapse caused on each iteration and the amount of information gained. The trade-off may be adjusted by tuning a parameter and, in certain situations, it is possible to set its value so that we may control the algorithm without sacrificing its quantum speed-up. As an example, it is shown that Grover's search problem can be implemented using a weak while loop, maintaining the same time complexity as the standard Grover's algorithm (as previously shown by Mizel).Comment: PhD Thesi

    Foundations of Software Science and Computation Structures

    Get PDF
    This open access book constitutes the proceedings of the 22nd International Conference on Foundations of Software Science and Computational Structures, FOSSACS 2019, which took place in Prague, Czech Republic, in April 2019, held as part of the European Joint Conference on Theory and Practice of Software, ETAPS 2019. The 29 papers presented in this volume were carefully reviewed and selected from 85 submissions. They deal with foundational research with a clear significance for software science

    Unbounded loops in quantum programs: categories and weak while loops

    Get PDF
    Control flow of quantum programs is often divided into two different classes: classical and quantum. Quantum programs with classical control flow have their conditional branching determined by the classical outcome of measurements, and these collapse quantum data. Conversely, quantum control flow is coherent, i.e. it does not perturb quantum data; quantum walk-based algorithms are practical examples where coherent quantum feedback plays a major role. This dissertation has two main contributions: (i) a categorical study of coherent quantum iteration and (ii) the introduction of weak while loops. (i) The objective is to endow categories of quantum processes with a traced monoidal structure capable of modelling iterative quantum loops. To this end, the trace of a morphism is calculated via the execution formula, which adds up the contribution of all possible paths of the control flow. Haghverdi's unique decomposition categories are generalised to admit additive inverses and equipped with convergence criteria using basic topology. In this setting, it is possible to prove the validity of the execution formula as a categorical trace on certain categories of quantum processes. Among these there are categories of quantum processes over finite dimensional Hilbert spaces (as previously shown by Bartha), but also certain categories of quantum processes over infinite dimensional Hilbert spaces, such as a category of time-shift invariant quantum processes over discrete time. (ii) A weak while loop is a classical control flow primitive that offers a trade-off between the collapse caused on each iteration and the amount of information gained. The trade-off may be adjusted by tuning a parameter and, in certain situations, it is possible to set its value so that we may control the algorithm without sacrificing its quantum speed-up. As an example, it is shown that Grover's search problem can be implemented using a weak while loop, maintaining the same time complexity as the standard Grover's algorithm (as previously shown by Mizel). In a more general setting, sufficient conditions are provided that let us determine, with arbitrarily high probability, a worst-case estimate of the number of iterations the loop will run for
    • …
    corecore