573 research outputs found

    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

    On Hoare-McCarthy algebras

    Get PDF
    We discuss an algebraic approach to propositional logic with side effects. To this end, we use Hoare's conditional [1985], which is a ternary connective comparable to if-then-else. Starting from McCarthy's notion of sequential evaluation [1963] we discuss a number of valuation congruences and we introduce Hoare-McCarthy algebras as the structures that characterize these congruences.Comment: 29 pages, 1 tabl

    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

    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

    Classical logic with n truth values as a symmetric many-valued logic

    Get PDF
    We introduce Boolean-like algebras of dimension n (nBA s) having n constants e1, … , en, and an (n+ 1) -ary operation q (a “generalised if-then-else”) that induces a decomposition of the algebra into n factors through the so-called n-central elements. Varieties of nBA s share many remarkable properties with the variety of Boolean algebras and with primal varieties. The nBA s provide the algebraic framework for generalising the classical propositional calculus to the case of n–perfectly symmetric–truth-values. Every finite-valued tabular logic can be embedded into such a n-valued propositional logic, nCL , and this embedding preserves validity. We define a confluent and terminating first-order rewriting system for deciding validity in nCL , and, via the embeddings, in all the finite tabular logics

    Factor Varieties

    Get PDF
    The universal algebraic literature is rife with generalisations of discriminator varieties, whereby several investigators have tried to preserve in more general settings as much as possible of their structure theory. Here, we modify the definition of discriminator algebra by having the switching function project onto its third coordinate in case the ordered pair of its first two coordinates belongs to a designated relation (not necessarily the diagonal relation). We call these algebras factor algebras and the varieties they generate factor varieties. Among other things, we provide an equational description of these varieties and match equational conditions involving the factor term with properties of the associated factor relation. Factor varieties include, apart from discriminator varieties, several varieties of algebras from quantum and fuzzy logics

    Discriminator varieties and symbolic computation

    Get PDF
    AbstractWe look at two aspects of discriminator varieties which could be of considerable interest in symbolic computation:1.discriminator varieties are unitary (i.e., there is always a most general unifier of two unifiable terms), and2.every mathematical problem can be routinely cast in the form†p1 ≈ q1, …, pk ≈ qk implies the equation x ≈ y.Item (l) offers possibilities for implementations in computational logic, and (2) shows that Birkhoff's five rules of inference for equational logic are all one needs to prove theorems in mathematics
    • …
    corecore