2,345 research outputs found
Modelling the Semantic Web using a Type System
We present an approach for modeling the Semantic Web as a type system. By
using a type system, we can use symbolic representation for representing linked
data. Objects with only data properties and references to external resources
are represented as terms in the type system. Triples are represented
symbolically using type constructors as the predicates. In our type system, we
allow users to add analytics that utilize machine learning or knowledge
discovery to perform inductive reasoning over data. These analytics can be used
by the inference engine when performing reasoning to answer a query.
Furthermore, our type system defines a means to resolve semantic heterogeneity
on-the-fly
A Bi-Directional Refinement Algorithm for the Calculus of (Co)Inductive Constructions
The paper describes the refinement algorithm for the Calculus of
(Co)Inductive Constructions (CIC) implemented in the interactive theorem prover
Matita. The refinement algorithm is in charge of giving a meaning to the terms,
types and proof terms directly written by the user or generated by using
tactics, decision procedures or general automation. The terms are written in an
"external syntax" meant to be user friendly that allows omission of
information, untyped binders and a certain liberal use of user defined
sub-typing. The refiner modifies the terms to obtain related well typed terms
in the internal syntax understood by the kernel of the ITP. In particular, it
acts as a type inference algorithm when all the binders are untyped. The
proposed algorithm is bi-directional: given a term in external syntax and a
type expected for the term, it propagates as much typing information as
possible towards the leaves of the term. Traditional mono-directional
algorithms, instead, proceed in a bottom-up way by inferring the type of a
sub-term and comparing (unifying) it with the type expected by its context only
at the end. We propose some novel bi-directional rules for CIC that are
particularly effective. Among the benefits of bi-directionality we have better
error message reporting and better inference of dependent types. Moreover,
thanks to bi-directionality, the coercion system for sub-typing is more
effective and type inference generates simpler unification problems that are
more likely to be solved by the inherently incomplete higher order unification
algorithms implemented. Finally we introduce in the external syntax the notion
of vector of placeholders that enables to omit at once an arbitrary number of
arguments. Vectors of placeholders allow a trivial implementation of implicit
arguments and greatly simplify the implementation of primitive and simple
tactics
Elaboration in Dependent Type Theory
To be usable in practice, interactive theorem provers need to provide
convenient and efficient means of writing expressions, definitions, and proofs.
This involves inferring information that is often left implicit in an ordinary
mathematical text, and resolving ambiguities in mathematical expressions. We
refer to the process of passing from a quasi-formal and partially-specified
expression to a completely precise formal one as elaboration. We describe an
elaboration algorithm for dependent type theory that has been implemented in
the Lean theorem prover. Lean's elaborator supports higher-order unification,
type class inference, ad hoc overloading, insertion of coercions, the use of
tactics, and the computational reduction of terms. The interactions between
these components are subtle and complex, and the elaboration algorithm has been
carefully designed to balance efficiency and usability. We describe the central
design goals, and the means by which they are achieved
Logical relations for coherence of effect subtyping
A coercion semantics of a programming language with subtyping is typically
defined on typing derivations rather than on typing judgments. To avoid
semantic ambiguity, such a semantics is expected to be coherent, i.e.,
independent of the typing derivation for a given typing judgment. In this
article we present heterogeneous, biorthogonal, step-indexed logical relations
for establishing the coherence of coercion semantics of programming languages
with subtyping. To illustrate the effectiveness of the proof method, we develop
a proof of coherence of a type-directed, selective CPS translation from a typed
call-by-value lambda calculus with delimited continuations and control-effect
subtyping. The article is accompanied by a Coq formalization that relies on a
novel shallow embedding of a logic for reasoning about step-indexing
Type classes for efficient exact real arithmetic in Coq
Floating point operations are fast, but require continuous effort on the part
of the user in order to ensure that the results are correct. This burden can be
shifted away from the user by providing a library of exact analysis in which
the computer handles the error estimates. Previously, we [Krebbers/Spitters
2011] provided a fast implementation of the exact real numbers in the Coq proof
assistant. Our implementation improved on an earlier implementation by O'Connor
by using type classes to describe an abstract specification of the underlying
dense set from which the real numbers are built. In particular, we used dyadic
rationals built from Coq's machine integers to obtain a 100 times speed up of
the basic operations already. This article is a substantially expanded version
of [Krebbers/Spitters 2011] in which the implementation is extended in the
various ways. First, we implement and verify the sine and cosine function.
Secondly, we create an additional implementation of the dense set based on
Coq's fast rational numbers. Thirdly, we extend the hierarchy to capture order
on undecidable structures, while it was limited to decidable structures before.
This hierarchy, based on type classes, allows us to share theory on the
naturals, integers, rationals, dyadics, and reals in a convenient way. Finally,
we obtain another dramatic speed-up by avoiding evaluation of termination
proofs at runtime.Comment: arXiv admin note: text overlap with arXiv:1105.275
First-Class Subtypes
First class type equalities, in the form of generalized algebraic data types
(GADTs), are commonly found in functional programs. However, first-class
representations of other relations between types, such as subtyping, are not
yet directly supported in most functional programming languages.
We present several encodings of first-class subtypes using existing features
of the OCaml language (made more convenient by the proposed modular implicits
extension), show that any such encodings are interconvertible, and illustrate
the utility of the encodings with several examples.Comment: In Proceedings ML 2017, arXiv:1905.0590
Gradual Certified Programming in Coq
Expressive static typing disciplines are a powerful way to achieve
high-quality software. However, the adoption cost of such techniques should not
be under-estimated. Just like gradual typing allows for a smooth transition
from dynamically-typed to statically-typed programs, it seems desirable to
support a gradual path to certified programming. We explore gradual certified
programming in Coq, providing the possibility to postpone the proofs of
selected properties, and to check "at runtime" whether the properties actually
hold. Casts can be integrated with the implicit coercion mechanism of Coq to
support implicit cast insertion a la gradual typing. Additionally, when
extracting Coq functions to mainstream languages, our encoding of casts
supports lifting assumed properties into runtime checks. Much to our surprise,
it is not necessary to extend Coq in any way to support gradual certified
programming. A simple mix of type classes and axioms makes it possible to bring
gradual certified programming to Coq in a straightforward manner.Comment: DLS'15 final version, Proceedings of the ACM Dynamic Languages
Symposium (DLS 2015
What kind of free will did the Buddha teach?
The modern version of the problem of free will is usually described as a collision
between two beliefs: the belief that we are free to choose our actions and the belief
that our actions are determined by prior necessary causes. Determinism—the view
that events are determined by specific causes—makes most aspects of reality intelligible.
It works quite well, for example, when explaining aspects of the natural world
(quantum physics aside). When heat, fuel, and oxygen come together there is fire.
There must be fire. To borrow a famous Buddhist simile, when a mango seed is given
the right conditions, it will grow to become a mango tree. It cannot grow to be anything
else. However, we do not usually think of agents as being caused in the same
way. We tend to think that agents somehow transcend natural causation by their
ability to choose freely. If we also think that agents are part of the natural order, we
face a paradox. This is, in short, the problem of free will
The Rooster and the Syntactic Bracket
We propose an extension of pure type systems with an algebraic presentation
of inductive and co-inductive type families with proper indices. This type
theory supports coercions toward from smaller sorts to bigger sorts via
explicit type construction, as well as impredicative sorts. Type families in
impredicative sorts are constructed with a bracketing operation. The necessary
restrictions of pattern-matching from impredicative sorts to types are confined
to the bracketing construct. This type theory gives an alternative presentation
to the calculus of inductive constructions on which the Coq proof assistant is
an implementation.Comment: To appear in the proceedings of the 19th International Conference on
Types for Proofs and Program
- …