37,117 research outputs found
A principled approach to programming with nested types in Haskell
Initial algebra semantics is one of the cornerstones of the theory of modern functional programming languages. For each inductive data type, it provides a Church encoding for that type, a build combinator which constructs data of that type, a fold combinator which encapsulates structured recursion over data of that type, and a fold/build rule which optimises modular programs by eliminating from them data constructed using the buildcombinator, and immediately consumed using the foldcombinator, for that type. It has long been thought that initial algebra semantics is not expressive enough to provide a similar foundation for programming with nested types in Haskell. Specifically, the standard folds derived from initial algebra semantics have been considered too weak to capture commonly occurring patterns of recursion over data of nested types in Haskell, and no build combinators or fold/build rules have until now been defined for nested types. This paper shows that standard folds are, in fact, sufficiently expressive for programming with nested types in Haskell. It also defines buildcombinators and fold/build fusion rules for nested types. It thus shows how initial algebra semantics provides a principled, expressive, and elegant foundation for programming with nested types in Haskell
A logic with temporally accessible iteration
Deficiency in expressive power of the first-order logic has led to developing
its numerous extensions by fixed point operators, such as Least Fixed-Point
(LFP), inflationary fixed-point (IFP), partial fixed-point (PFP), etc. These
logics have been extensively studied in finite model theory, database theory,
descriptive complexity. In this paper we introduce unifying framework, the
logic with iteration operator, in which iteration steps may be accessed by
temporal logic formulae. We show that proposed logic FO+TAI subsumes all
mentioned fixed point extensions as well as many other fixed point logics as
natural fragments. On the other hand we show that over finite structures FO+TAI
is no more expressive than FO+PFP. Further we show that adding the same
machinery to the logic of monotone inductions (FO+LFP) does not increase its
expressive power either
Signatures and Induction Principles for Higher Inductive-Inductive Types
Higher inductive-inductive types (HIITs) generalize inductive types of
dependent type theories in two ways. On the one hand they allow the
simultaneous definition of multiple sorts that can be indexed over each other.
On the other hand they support equality constructors, thus generalizing higher
inductive types of homotopy type theory. Examples that make use of both
features are the Cauchy real numbers and the well-typed syntax of type theory
where conversion rules are given as equality constructors. In this paper we
propose a general definition of HIITs using a small type theory, named the
theory of signatures. A context in this theory encodes a HIIT by listing the
constructors. We also compute notions of induction and recursion for HIITs, by
using variants of syntactic logical relation translations. Building full
categorical semantics and constructing initial algebras is left for future
work. The theory of HIIT signatures was formalised in Agda together with the
syntactic translations. We also provide a Haskell implementation, which takes
signatures as input and outputs translation results as valid Agda code
Structural Resolution with Co-inductive Loop Detection
A way to combine co-SLD style loop detection with structural resolution was
found and is introduced in this work, to extend structural resolution with
co-induction. In particular, we present the operational semantics, called
co-inductive structural resolution, of this novel combination and prove its
soundness with respect to the greatest complete Herbrand model.Comment: In Proceedings CoALP-Ty'16, arXiv:1709.0419
HoCHC: A Refutationally Complete and Semantically Invariant System of Higher-order Logic Modulo Theories
We present a simple resolution proof system for higher-order constrained Horn
clauses (HoCHC) - a system of higher-order logic modulo theories - and prove
its soundness and refutational completeness w.r.t. the standard semantics. As
corollaries, we obtain the compactness theorem and semi-decidability of HoCHC
for semi-decidable background theories, and we prove that HoCHC satisfies a
canonical model property. Moreover a variant of the well-known translation from
higher-order to 1st-order logic is shown to be sound and complete for HoCHC in
standard semantics. We illustrate how to transfer decidability results for
(fragments of) 1st-order logic modulo theories to our higher-order setting,
using as example the Bernays-Schonfinkel-Ramsey fragment of HoCHC modulo a
restricted form of Linear Integer Arithmetic
- โฆ