On Applying Program Transformation to Implement Suspension-Based Tabling in Prolog



Similar documents
Global Variables. However, when global variables are used in a function block or control modules, they must be declared as external

DATA STRUCTURES USING C

The Contact-Center Business Analyzer: a case for Persistent Contextual Logic Programming

Lecture 1: Introduction

BET : An Inductive Logic Programming Workbench

Swapping Evaluation: A Memory-Scalable Solution for Answer-On-Demand Tabling

Semester Review. CSC 301, Fall 2015

TOWARDS NEXT GENERATION LOGIC PROGRAMMING SYSTEMS. Ajay Bansal. Dr. Gopal Gupta, Chair. Dr. Farokh Bastani. Dr. Kevin Hamlen. Dr.

The OWC option. Energia das Ondas uma aposta nacional

Secure Portable Data Server. 25/06/2012 Alexei Troussov SMIS team INRIA Rocquencourt

Virtualization is set to become a key requirement

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Efficient representation of integer sets

Reliable Systolic Computing through Redundancy

LaPIe: Collective Communications adapted to Grid Environments

Database-Aware Test Coverage Monitoring. India Software Engineering Conference. February, 2008

Advanced Encryption Standard (AES) User's Guide

Data Structures Fibonacci Heaps, Amortized Analysis

Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Experiments on cost/power and failure aware scheduling for clouds and grids

The previous chapter provided a definition of the semantics of a programming

Fault-Tolerant Computing

Junghyun Ahn Changho Sung Tag Gon Kim. Korea Advanced Institute of Science and Technology (KAIST) Kuseong-dong, Yuseong-gu Daejoen, Korea

8. KNOWLEDGE BASED SYSTEMS IN MANUFACTURING SIMULATION

Chapter 6: Programming Languages

Cassandra. References:

AUTOMATED REASONING SLIDES 3: RESOLUTION The resolution rule Unification Refutation by resolution Factoring Clausal Form and Skolemisation

How To Program With Adaptive Vision Studio

Algorithms and Data Structures

Query Optimization in a Memory-Resident Domain Relational Calculus Database System

A three-dimensional visualization of communications in distributed program environments

Microservices and Erlang/OTP. Christoph Iserlohn

D5.6 Prototype demonstration of performance monitoring tools on a system with multiple ARM boards Version 1.0

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

Outlier Detection Using Clustering Methods: a data cleaning application

MULTI KEYWORD SECURED RANKING FOR AN ENCRYPTED CLOUD DATA

Scheduling Task Parallelism" on Multi-Socket Multicore Systems"

CSC Software II: Principles of Programming Languages

Computer Science 210: Data Structures. Searching

Outline. Architecture of Web Applications. Example Web Application. Black Box Testing. Testing a Web Database Application

Applications of JAVA programming language to database management

Formal Engineering for Industrial Software Development

SDN Programming Languages. Programming SDNs!

Binary Search Trees. Ric Glassey

TUNNA. A tool designed to bypass firewall restrictions on remote webservers. By: Rodrigo Marcos Nikos Vassakis

1-Oct 2015, Bilbao, Spain. Towards Semantic Network Models via Graph Databases for SDN Applications

Practical Security Event Auditing with FreeBSD

A Constraint Programming Application for Rotating Workforce Scheduling

Performance of KDB-Trees with Query-Based Splitting*

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Questions 1 through 25 are worth 2 points each. Choose one best answer for each.

MACH: AN OPEN SYSTEM OPERATING SYSTEM Aakash Damara, Vikas Damara, Aanchal Chanana Dronacharya College of Engineering, Gurgaon, India

Tony Wong & Vivek Chaudhri

Data Structures and Algorithms Written Examination

HPC performance applications on Virtual Clusters

Use of Hadoop File System for Nuclear Physics Analyses in STAR

Section IV.1: Recursive Algorithms and Recursion Trees

Fall 2012 Q530. Programming for Cognitive Science

Classifying Large Data Sets Using SVMs with Hierarchical Clusters. Presented by :Limou Wang

Cloud Computing. Up until now


Programming IoT Gateways With macchina.io

Database Toolkit: Portable and Cost Effective Software

PartJoin: An Efficient Storage and Query Execution for Data Warehouses

SWI-Prolog: history and focus for the future

Research Statement Immanuel Trummer

Departamento de Investigación. LaST: Language Study Tool. Nº 143 Edgard Lindner y Enrique Molinari Coordinación: Graciela Matich

SNMP....Simple Network Management Protocol...

Better credit models benefit us all

Turing Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005

Lightweight Service-Based Software Architecture

University of Potsdam Faculty of Computer Science. Clause Learning in SAT Seminar Automatic Problem Solving WS 2005/06

Programming Language Pragmatics

Acme vs PDDL: support for dynamic reconfiguration of software architectures

Development (60 ЕCTS)

Seeing Systolic Computations in a Video Game World

Chapter 3 Operating-System Structures

Data Structure [Question Bank]

Performance Analysis and Optimization Tool

Classification On The Clouds Using MapReduce

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

Concurrency control. Concurrency problems. Database Management System

DB2 for i. Analysis and Tuning. Mike Cain IBM DB2 for i Center of Excellence. mcain@us.ibm.com

CSE 307: Principles of Programming Languages

Using In-Memory Computing to Simplify Big Data Analytics

Our Customer Relationship Agreement NODEMOBILE VOICE SERVICE DESCRIPTION

tdodo Internet Web Hosting Terms and Conditions

PPD: Scheduling and Load Balancing 2

Our Customer Relationship Agreement HOSTED LYNC SERVICE DESCRIPTION

Levels of Programming Languages. Gerald Penn CSC 324

Alternative models to distribute VO specific software to WLCG sites: a prototype set up at PIC

The Availability of Commercial Storage Clouds

1 A/B Testing White Paper. Web Spiders Pvt Ltd

Java Software Structures

Foxtel Broadband & Home Phone Agreement Foxtel Home Phone Service Description

Knowledge Discovery from Data Bases Proposal for a MAP-I UC

Why Query Optimization? Access Path Selection in a Relational Database Management System. How to come up with the right query plan?

Opus: University of Bath Online Publication Store

Viewpoint: Journals for Certification, Conferences for Rapid Dissemination -- Rethinking the Role of Journals in Computer Science

Quality of Service Management for Teleteaching Applications Using the MPEG-4/DMIF

Transcription:

On Applying Program Transformation to Implement Suspension-Based Tabling in Prolog DCC-FC & LIACC University of Porto, Portugal ricroc@ncc.up.pt ccaldas@dcc.online.pt rslopes@ncc.up.pt ICLP 2007, Porto, Portugal, September 2007

Tabling Implementations The common approach used to include tabling support into existing Prolog systems is to modify and extend the low-level engine. More efficient implementations. Not easily portable to other Prolog systems (requires changing important components of the system).

Tabling Implementations The common approach used to include tabling support into existing Prolog systems is to modify and extend the low-level engine. More efficient implementations. Not easily portable to other Prolog systems (requires changing important components of the system). A different approach is to apply source level transformations to a tabled program and then use external tabling primitives to implement tabled evaluation. Source level transformations can be written in Prolog. Tabling primitives can be implemented using the C language interface available in most Prolog systems. Less efficient implementations. ICLP 2007, Porto, Portugal, September 2007 1

Our Approach A suspension-based tabling mechanism based on program transformation with tabling primitives implemented in C. ICLP 2007, Porto, Portugal, September 2007 2

Our Approach The program transformation module is fully written in Prolog. The tabling primitives module uses the C language interface of the Yap Prolog system. It implements a local scheduling search strategy and uses tries to implement the table space. Suspension is implemented by leaving the continuation call for the current computation in the table entry corresponding to the variant call being suspended. During this process and as further new answers are found, they are stored in their tables and returned to all variant calls by calling the previously stored continuation calls. ICLP 2007, Porto, Portugal, September 2007 3

Program Transformation % original tabled predicate p(x,z) :- e(x,y), p(y,z). p(x,z) :- e(x,z). % transformed predicate p(x,z) :- tabled_call(p(x,z),sid,_,p0,true), consume_answer(p(x,z),sid). p0(p(x,z),sid) :- e(x,y), tabled_call(p(y,z),sid,[x,z,y],p0,p1). p1(p(y,z),sid,[x,z,y]) :- new_answer(p(x,z),sid). p0(p(x,z),sid) :- e(x,z), new_answer(p(x,z),sid). ICLP 2007, Porto, Portugal, September 2007 4

Experimental Results We ran our approach against the YapTab system that implements tabling support at the low-level engine. YapTab also implements a suspension-based mechanism, uses tries to implement the table space and is implemented on top of Yap. Predicate Binary Tree Cycle Grid 12 14 16 200 300 400 10x10 15x15 20x20 p right first/2 4.00 3.73 3.62 4.36 3.99 3.89 7.75 6.41 6.11 p right last/2 3.73 3.59 3.70 4.56 4.00 3.98 8.55 6.27 6.42 p left first/2 2.65 2.39 2.34 3.05 2.65 2.26 3.11 2.46 2.12 p left last/2 5.00 4.31 4.25 5.13 4.34 4.24 5.67 4.73 4.15 p doubly first/2 8.13 7.72 7.68 10.45 11.57 11.22 10.34 9.66 10.40 p doubly last/2 15.05 13.96 13.68 20.36 22.23 21.72 19.74 18.25 19.53 Overheads over the YapTab running times ICLP 2007, Porto, Portugal, September 2007 5

Concluding Remarks As expected, YapTab outperformed our mechanism in all programs tested. Best performance was achieved for left recursive tabled predicates with the recursive clause first, with an average overhead between 2 and 3. Considering that Yap and YapTab are two of the fastest Prolog and tabling engines currently available, these results are very interesting and very promising. We thus argue that our approach is a good alternative to incorporate tabling into other Prolog systems with a C language interface. Currently, we have already a port of our implementation running as a module of the Ciao Prolog system [CICLOPS 2007]. ICLP 2007, Porto, Portugal, September 2007 6