1,130 research outputs found
Compiling With Classical Connectives
The study of polarity in computation has revealed that an "ideal" programming
language combines both call-by-value and call-by-name evaluation; the two
calling conventions are each ideal for half the types in a programming
language. But this binary choice leaves out call-by-need which is used in
practice to implement lazy-by-default languages like Haskell. We show how the
notion of polarity can be extended beyond the value/name dichotomy to include
call-by-need by adding a mechanism for sharing which is enough to compile a
Haskell-like functional language with user-defined types. The key to capturing
sharing in this mixed-evaluation setting is to generalize the usual notion of
polarity "shifts:" rather than just two shifts (between positive and negative)
we have a family of four dual shifts.
We expand on this idea of logical duality -- "and" is dual to "or;" proof is
dual to refutation -- for the purpose of compiling a variety of types. Based on
a general notion of data and codata, we show how classical connectives can be
used to encode a wide range of built-in and user-defined types. In contrast
with an intuitionistic logic corresponding to pure functional programming,
these classical connectives bring more of the pleasant symmetries of classical
logic to the computationally-relevant, constructive setting. In particular, an
involutive pair of negations bridges the gulf between the wide-spread notions
of parametric polymorphism and abstract data types in programming languages. To
complete the study of duality in compilation, we also consider the dual to
call-by-need evaluation, which shares the computation within the control flow
of a program instead of computation within the information flow
Compiling With Classical Connectives
The study of polarity in computation has revealed that an "ideal" programming
language combines both call-by-value and call-by-name evaluation; the two
calling conventions are each ideal for half the types in a programming
language. But this binary choice leaves out call-by-need which is used in
practice to implement lazy-by-default languages like Haskell. We show how the
notion of polarity can be extended beyond the value/name dichotomy to include
call-by-need by adding a mechanism for sharing which is enough to compile a
Haskell-like functional language with user-defined types. The key to capturing
sharing in this mixed-evaluation setting is to generalize the usual notion of
polarity "shifts:" rather than just two shifts (between positive and negative)
we have a family of four dual shifts.
We expand on this idea of logical duality---"and" is dual to "or;" proof is
dual to refutation---for the purpose of compiling a variety of types. Based on
a general notion of data and codata, we show how classical connectives can be
used to encode a wide range of built-in and user-defined types. In contrast
with an intuitionistic logic corresponding to pure functional programming,
these classical connectives bring more of the pleasant symmetries of classical
logic to the computationally-relevant, constructive setting. In particular, an
involutive pair of negations bridges the gulf between the wide-spread notions
of parametric polymorphism and abstract data types in programming languages. To
complete the study of duality in compilation, we also consider the dual to
call-by-need evaluation, which shares the computation within the control flow
of a program instead of computation within the information flow
Sequent Calculus and Equational Programming
Proof assistants and programming languages based on type theories usually
come in two flavours: one is based on the standard natural deduction
presentation of type theory and involves eliminators, while the other provides
a syntax in equational style. We show here that the equational approach
corresponds to the use of a focused presentation of a type theory expressed as
a sequent calculus. A typed functional language is presented, based on a
sequent calculus, that we relate to the syntax and internal language of Agda.
In particular, we discuss the use of patterns and case splittings, as well as
rules implementing inductive reasoning and dependent products and sums.Comment: In Proceedings LFMTP 2015, arXiv:1507.0759
String-based Multi-adjoint Lattices for Tracing Fuzzy Logic Computations
Classically, most programming languages use in a predefined way thenotion of “string” as an standard data structure for a comfortable management of arbitrary sequences of characters. However, in this paper we assign a different role to this concept: here we are concerned with fuzzy logic programming, a somehow recent paradigm trying to introduce fuzzy logic into logic programming. In this setting, the mathematical concept of multi-adjoint lattice has been successfully exploited into the so-called Multi-adjoint Logic Programming approach, MALP in brief, for modeling flexible notions of truth-degrees beyond the simpler case of true and false. Our main goal points out not only our formal proof verifying that stringbased lattices accomplish with the so-called multi-adjoint property (as well as its Cartesian product with similar structures), but also its correspondence with interesting debugging tasks into the FLOPER system (from “Fuzzy LOgic Programming Environment for Research”) developed in our research group
Towards possibilistic fuzzy answer set programming
Fuzzy answer set programming (FASP) is a generalization of answer set programming to continuous domains. As it can not readily take uncertainty into account, however, FASP is not suitable as a basis for approximate reasoning and cannot easily be used to derive conclusions from imprecise information. To cope with this, we propose an extension of FASP based on possibility theory. The resulting framework allows us to reason about uncertain information in continuous domains, and thus also about information that is imprecise or vague. We propose a syntactic procedure, based on an immediate consequence operator, and provide a characterization in terms of minimal models, which allows us to straightforwardly implement our framework using existing FASP solvers
Carnap: an Open Framework for Formal Reasoning in the Browser
This paper presents an overview of Carnap, a free and open framework for the development of formal reasoning applications. Carnap’s design emphasizes flexibility, extensibility, and rapid prototyping. Carnap-based applications are written in Haskell, but can be compiled to JavaScript to run in standard web browsers. This combination of features makes Carnap ideally suited for educational applications, where ease-of-use is crucial for students and adaptability to different teaching strategies and classroom needs is crucial for instructors. The paper describes Carnap’s implementation, along with its current and projected pedagogical applications
Beyond Polarity: Towards a Multi-Discipline Intermediate Language with Sharing
The study of polarity in computation has revealed that an "ideal" programming language combines both call-by-value and call-by-name evaluation; the two calling conventions are each ideal for half the types in a programming language. But this binary choice leaves out call-by-need which is used in practice to implement lazy-by-default languages like Haskell. We show how the notion of polarity can be extended beyond the value/name dichotomy to include call-by-need by only adding a mechanism for sharing and the extra polarity shifts to connect them, which is enough to compile a Haskell-like functional language with user-defined types
- …