12,415 research outputs found
TWAM: A Certifying Abstract Machine for Logic Programs
Type-preserving (or typed) compilation uses typing derivations to certify
correctness properties of compilation. We have designed and implemented a
type-preserving compiler for a simply-typed dialect of Prolog we call T-Prolog.
The crux of our approach is a new certifying abstract machine which we call the
Typed Warren Abstract Machine (TWAM). The TWAM has a dependent type system
strong enough to specify the semantics of a logic program in the logical
framework LF. We present a soundness metatheorem which constitutes a partial
correctness guarantee: well-typed programs implement the logic program
specified by their type. This metatheorem justifies our design and
implementation of a certifying compiler from T-Prolog to TWAM.Comment: 41 pages, under submission to ACM Transactions on Computational Logi
A logical approach to A-Prolog
It has been recently provided a characterization of Answer Sets by intuitionistic logic as follows: a literal is entailed by a program in the stable model semantics if and only if it belongs to every intuitionistically complete and consistent extension of the program formed by adding only negated literals. We show that if we replace intuitionistic logic by any si-logic the result still holds
GRAMPAL: A Morphological Processor for Spanish implemented in Prolog
A model for the full treatment of Spanish inflection for verbs, nouns and
adjectives is presented. This model is based on feature unification and it
relies upon a lexicon of allomorphs both for stems and morphemes. Word forms
are built by the concatenation of allomorphs by means of special contextual
features. We make use of standard Definite Clause Grammars (DCG) included in
most Prolog implementations, instead of the typical finite-state approach. This
allows us to take advantage of the declarativity and bidirectionality of Logic
Programming for NLP.
The most salient feature of this approach is simplicity: A really
straightforward rule and lexical components. We have developed a very simple
model for complex phenomena.
Declarativity, bidirectionality, consistency and completeness of the model
are discussed: all and only correct word forms are analysed or generated, even
alternative ones and gaps in paradigms are preserved. A Prolog implementation
has been developed for both analysis and generation of Spanish word forms. It
consists of only six DCG rules, because our {\em lexicalist\/} approach --i.e.
most information is in the dictionary. Although it is quite efficient, the
current implementation could be improved for analysis by using the non logical
features of Prolog, especially in word segmentation and dictionary access.Comment: 11 page
Lambda Calculus for Engineers
In pure functional programming it is awkward to use a stateful sub-computation in a predominantly stateless computation. The problem is that the state of the subcomputation has to be passed around using ugly plumbing. Classical examples of the plumbing problem are: providing a supply of fresh names, and providing a supply of random numbers. We propose to use (deterministic) inductive definitions rather than recursion equations as a basic paradigm and show how this makes it easier to add the plumbing
The Ciao clp(FD) library. A modular CLP extension for Prolog
We present a new free library for Constraint Logic Programming over Finite Domains, included with the Ciao Prolog system. The library is entirely written in Prolog, leveraging on Ciao's module system and code transformation capabilities in order to achieve a highly modular design without compromising performance. We describe the interface,
implementation, and design rationale of each modular component. The library meets several design goals: a high level of modularity, allowing the individual components to be replaced by different versions; highefficiency, being competitive with other TT> implementations; a glass-box
approach, so the user can specify new constraints at different levels; and a Prolog implementation, in order to ease the integration with Ciao's code analysis components. The core is built upon two small libraries which implement integer ranges and closures. On top of that, a finite domain
variable datatype is defined, taking care of constraint reexecution depending on range changes. These three libraries form what we call the TT> kernel of the library. This TT> kernel is used in turn to implement several higher-level finite domain constraints, specified using indexicals. Together with a labeling module this layer forms what we name the TT> solver. A final level integrates the CLP (J7©) paradigm with our TT> solver. This is achieved using attributed variables and a compiler from
the CLP (J7©) language to the set of constraints provided by the solver. It should be noted that the user of the library is encouraged to work in any of those levels as seen convenient: from writing a new range module to enriching the set of TT> constraints by writing new indexicals
- …