1,304 research outputs found
SWI-Prolog and the Web
Where Prolog is commonly seen as a component in a Web application that is
either embedded or communicates using a proprietary protocol, we propose an
architecture where Prolog communicates to other components in a Web application
using the standard HTTP protocol. By avoiding embedding in external Web servers
development and deployment become much easier. To support this architecture, in
addition to the transfer protocol, we must also support parsing, representing
and generating the key Web document types such as HTML, XML and RDF.
This paper motivates the design decisions in the libraries and extensions to
Prolog for handling Web documents and protocols. The design has been guided by
the requirement to handle large documents efficiently. The described libraries
support a wide range of Web applications ranging from HTML and XML documents to
Semantic Web RDF processing.
To appear in Theory and Practice of Logic Programming (TPLP)Comment: 31 pages, 24 figures and 2 tables. To appear in Theory and Practice
of Logic Programming (TPLP
SWISH: SWI-Prolog for Sharing
Recently, we see a new type of interfaces for programmers based on web
technology. For example, JSFiddle, IPython Notebook and R-studio. Web
technology enables cloud-based solutions, embedding in tutorial web pages,
atractive rendering of results, web-scale cooperative development, etc. This
article describes SWISH, a web front-end for Prolog. A public website exposes
SWI-Prolog using SWISH, which is used to run small Prolog programs for
demonstration, experimentation and education. We connected SWISH to the
ClioPatria semantic web toolkit, where it allows for collaborative development
of programs and queries related to a dataset as well as performing maintenance
tasks on the running server and we embedded SWISH in the Learn Prolog Now!
online Prolog book.Comment: International Workshop on User-Oriented Logic Programming (IULP
2015), co-located with the 31st International Conference on Logic Programming
(ICLP 2015), Proceedings of the International Workshop on User-Oriented Logic
Programming (IULP 2015), Editors: Stefan Ellmauthaler and Claudia Schulz,
pages 99-113, August 201
Portability of Prolog programs: theory and case-studies
(Non-)portability of Prolog programs is widely considered as an important
factor in the lack of acceptance of the language. Since 1995, the core of the
language is covered by the ISO standard 13211-1. Since 2007, YAP and SWI-Prolog
have established a basic compatibility framework. This article describes and
evaluates this framework. The aim of the framework is running the same code on
both systems rather than migrating an application. We show that today, the
portability within the family of Edinburgh/Quintus derived Prolog
implementations is good enough to allow for maintaining portable real-world
applications.Comment: Online proceedings of the Joint Workshop on Implementation of
Constraint Logic Programming Systems and Logic-based Methods in Programming
Environments (CICLOPS-WLPE 2010), Edinburgh, Scotland, U.K., July 15, 201
Probabilistic inference in SWI-Prolog
Probabilistic Logic Programming (PLP) emerged as one of the most prominent approaches to cope with real-world domains. The distribution semantics is one of most used in PLP, as it is followed by many languages, such as Independent Choice Logic, PRISM, pD, Logic Programs with Annotated Disjunctions (LPADs) and ProbLog. A possible system that allows performing inference on LPADs is PITA, which transforms the input LPAD into a Prolog program containing calls to library predicates for handling Binary Decision Diagrams (BDDs). In particular, BDDs are used to compactly encode explanations for goals and efficiently compute their probability. However, PITA needs mode-directed tabling (also called tabling with answer subsumption), which has been implemented in SWI-Prolog only recently. This paper shows how SWI-Prolog has been extended to include correct answer subsumption and how the PITA transformation has been changed to use SWI-Prolog implementation
Lock-free atom garbage collection for multithreaded Prolog
The runtime system of dynamic languages such as Prolog or Lisp and their
derivatives contain a symbol table, in Prolog often called the atom table. A
simple dynamically resizing hash-table used to be an adequate way to implement
this table. As Prolog becomes fashionable for 24x7 server processes we need to
deal with atom garbage collection and concurrent access to the atom table.
Classical lock-based implementations to ensure consistency of the atom table
scale poorly and a stop-the-world approach to implement atom garbage collection
quickly becomes a bottle-neck, making Prolog unsuitable for soft real-time
applications. In this article we describe a novel implementation for the atom
table using lock-free techniques where the atom-table remains accessible even
during atom garbage collection. Relying only on CAS (Compare And Swap) and not
on external libraries, the implementation is straightforward and portable.
Under consideration for acceptance in TPLP.Comment: Paper presented at the 32nd International Conference on Logic
Programming (ICLP 2016), New York City, USA, 16-21 October 2016, 14 pages,
LaTeX, 4 PDF figure
TOR: modular search with hookable disjunction
Horn Clause Programs have a natural exhaustive depth-first procedural
semantics. However, for many programs this semantics is
ineffective. In order to compute useful solutions, one needs the
ability to modify the search method that explores the alternative
execution branches.
Tor, a well-defined hook into Prolog disjunction, provides this ability.
It is light-weight thanks to its library approach and efficient
because it is based on program transformation.
Tor is general enough to mimic search-modifying
predicates like ECLiPSe's search/6. Moreover, Tor supports
modular composition of search methods and other hooks.
The Tor library is already
provided and used as an add-on to SWI-Prolog.publisher: Elsevier
articletitle: Tor: Modular search with hookable disjunction
journaltitle: Science of Computer Programming
articlelink: http://dx.doi.org/10.1016/j.scico.2013.05.008
content_type: article
copyright: Copyright © 2013 Elsevier B.V. All rights reserved.status: publishe
- …