A Master-Slave Architecture to Integrate Sets and Finite Domains in Java F. Bergenti E. Panegai G. Rossi Università degli Studi di Parma Bari, 26-27 Giugno.

Slides:



Advertisements
Similar presentations
2 Introduction A central issue in supporting interoperability is achieving type compatibility. Type compatibility allows (a) entities developed by various.
Advertisements

The GDSE Framework A Meta-Tool for Automated Design Space Exploration Tripti Saxena Graduate Student Vanderbilt University 1.
Introduction. IC-Parc2 ECLiPSe Components Constraint Logic Programming system, consisting of  A runtime core Data-driven computation, backtracking, garbage.
Automated Reasoning Systems For first order Predicate Logic.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Introduction To System Analysis and Design
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Optimisation Although Constraint Logic Programming is somehow focussed in constraint satisfaction (closer to a “logical” view), constraint optimisation.
A First Attempt towards a Logical Model for the PBMS PANDA Meeting, Milano, 18 April 2002 National Technical University of Athens Patterns for Next-Generation.
1 Draft of a Matchmaking Service Chuang liu. 2 Matchmaking Service Matchmaking Service is a service to help service providers to advertising their service.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
CHAPTER 6 Stacks Array Implementation. 2 Stacks A stack is a linear collection whose elements are added and removed from one end The last element to be.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Architectural Design.
What is Software Architecture?
Introduction To System Analysis and design
Object Oriented Data Structures
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Introduction to Object-oriented programming and software development Lecture 1.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
An Integration Framework for Sensor Networks and Data Stream Management Systems.
Ming Fang 6/12/2009. Outlines  Classical logics  Introduction to DL  Syntax of DL  Semantics of DL  KR in DL  Reasoning in DL  Applications.
1 Evaluating top-k Queries over Web-Accessible Databases Paper By: Amelie Marian, Nicolas Bruno, Luis Gravano Presented By Bhushan Chaudhari University.
Lesson 3 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
CS6133 Software Specification and Verification
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Embedding Constraint Satisfaction using Parallel Soft-Core Processors on FPGAs Prasad Subramanian, Brandon Eames, Department of Electrical Engineering,
Introduction to Data Structures and Algorithms CS 110: Data Structures and Algorithms First Semester,
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Module 3: Steering&Arrays #1 2000/01Scientific Computing in OOCourse code 3C59 Module 3: Algorithm steering elements If, elseif, else Switch and enumerated.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
SemiBoost : Boosting for Semi-supervised Learning Pavan Kumar Mallapragada, Student Member, IEEE, Rong Jin, Member, IEEE, Anil K. Jain, Fellow, IEEE, and.
1 Supplementary Slides for Software Engineering: A Practitioner's Approach, 5/e Supplementary Slides for Software Engineering: A Practitioner's Approach,
Automated Reasoning Systems For first order Predicate Logic.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Chapter 5 Constraint Satisfaction Problems
Salman Marvasti Sharif University of Technology Winter 2015.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Declarative Programming in Java using JSetL E. PanegaiG. Rossi Dipartimento di Matematica Università di Parma Roma, Giugno 2005 Convegno Italiano.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Process Asad Ur Rehman Chief Technology Officer Feditec Enterprise.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
03/02/20061 Evaluating Top-k Queries Over Web-Accessible Databases Amelie Marian Nicolas Bruno Luis Gravano Presented By: Archana and Muhammed.
1 Architecture and Behavioral Model for Future Cognitive Heterogeneous Networks Advisor: Wei-Yeh Chen Student: Long-Chong Hung G. Chen, Y. Zhang, M. Song,
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Assumption-based Truth Maintenance Systems: Motivation n Problem solvers need to explore multiple contexts at the same time, instead of a single one (the.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Computer Systems Laboratory Stanford University Clark W. Barrett David L. Dill Aaron Stump A Framework for Cooperating Decision Procedures.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Software Testing.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Exception Handling Oo28.
Introduction to Data Structure
Presentation transcript:

A Master-Slave Architecture to Integrate Sets and Finite Domains in Java F. Bergenti E. Panegai G. Rossi Università degli Studi di Parma Bari, Giugno 2006 Convegno Italiano di Logica Computazionale

CILC 06 – Bari, 26/27 Giugno Outline of the talk Aims:  Implement and validate the integration of JSetL (a set solver) and JFD (a finite domains solver) ;  Find out a generic architecture approach for a cooperation between constraint solvers ; The Master-Slave architecture; Case study: JSetL+JFD; Conclusions and future work.

CILC 06 – Bari, 26/27 Giugno Introduction Solvers are normally implemented on the basis of more or less explicit tradeoffs between:  Capabilities: the kinds of constraints they manage and under which assumptions; and  Performances: the adopted strategies, heuristics and optimizations. Often single solvers cannot be used on hybrid problems. Idea: Combine several constraint solving techniques to solve problems that none of the single solvers can handle alone. CILC 06 – Bari, 26/27 Giugno 2006

4 A common architectural outline can be found in many frameworks and architectures that explore the cooperative integration of constraint solvers:  A top level of meta-resolution (namely a meta- solver);  A set of constraint solvers; and  An interface between the meta-solver and the object-level solvers. Introduction CILC 06 – Bari, 26/27 Giugno 2006 Meta-solver Solver 1 Solver 2 Solver n Interface

CILC 06 – Bari, 26/27 Giugno We always need a layer of meta-resolution? Often this layer implies implementation efforts to realize functionalities already present in the solvers. The master-slave (M-S) approach: No meta-solver One of the solvers is opportunely selected and promoted to the role of master. Introduction Meta-solver Solver 1 Solver 2 Solver n Interface Solver 2 Solver n Solver 1 Interface

CILC 06 – Bari, 26/27 Giugno The case study integrate two Java solvers, namely JSetL and JFD, into an added-value Java constraint solver capable of exploiting:  The full expressive power of JSetL, with its inherent flexibility and generality; and  The efficiency of JFD in treating finite integer domains variables. Constraint solving algorithms are basically the same exploited in CLP(Set+FD). Moving from a logic programming framework, to an OO programming context (Java) causes some implementation decisions to become more evident. Introduction

CILC 06 – Bari, 26/27 Giugno M-S Constraint Solving The general architecture:  Each solver is responsible for a predefined set of constraints and is equipped with a private constraint store (conjunction of atomic constraints).  The main task of each solver is to try to reduce any conjunction of atomic constraints to a simplified (irreducible) form.  One solver is selected as Master solver, all the others are Slaves (Slaves are black boxes).  The master is in charge of distributing tasks to, and gathering results from, the slaves.  The constraint distribution policy is based on a fixed a-priori mapping.

CILC 06 – Bari, 26/27 Giugno M-S Constraint Solving : Selection of Master Good selection of the master: 1. The master should provide a constraint language that subsumes the union of the languages of all slaves; 2. The performances: slaves should perform better than the master in their reference domains; 3. The support for constraint programming abstractions, e.g., logical variables and nondeterminism; 4. The possibility of extending the selected solver to integrate master-specific procedures (e.g., constraint dispatching, result processing etc.); and 5. The public functionalities provided to programmers.

CILC 06 – Bari, 26/27 Giugno At first stage the master needs to communicate constraints. Allocation of an atomic constraint C=op(t 1,...,t n ):  (MASTER) If C is a constraint of the master and S=Ø, then the master solves it;  (SLAVE) If C is not a constraint of the master and S  Ø, then C is posted to all slaves in S;  (BOTH) If C is a constraint of the master and S  Ø, then the master posts C to all slaves in S and then solves it; or  (UNKNOWN) If C is not a constraint of the master and S=Ø, the allocation fails, i.e., the constraint is unknown. M-S Constraint Solving : Communication

CILC 06 – Bari, 26/27 Giugno Communication second stage: Interface that slave solvers provide:  add(C) where C is a slave constraint to be added to the constraint store of the slave;  get_constraints() that returns the conjunction of constraints that are present in the store of the slave;  solve(B) where B is a value from an enumerative type used to specify which solving process is requested. M-S Constraint Solving : Communication

CILC 06 – Bari, 26/27 Giugno Communication third stage: we need other glue functions for translate and filter constraints:  master_to_slave(Slave,C) translates a master constraint C to the corresponding slave constraint;  slave_to_master(Slave,D) translates a slave constraint D to the corresponding master constraint;  which_type(C) that allows C to be classified as belonging to one of the four types of constraints MASTER, SLAVE, BOTH and UNKNOWN; and  which_slave(C) that maps C to a possibly empty set of slaves that can handle it. M-S Constraint Solving : Communication

CILC 06 – Bari, 26/27 Giugno The master's procedure for constraint solving: procedure master_solve(Constraint Store) repeat reset(Store); step(Store) until is_final_form(Store) end procedure; Actions are repeated until the solving process terminates successfully or until it fails.  The process terminates successfully when no further constraint can be reduced or allocated to slaves and when all results are gathered from the constraint stores of slaves.  The process fails when the master, or any slave, detects an inconsistency and no further nondeterministic choices are left open. General Constraint Solving Procedures

CILC 06 – Bari, 26/27 Giugno procedure step (Constraint Store) C = extract(Store);// Constraint C Selected_Slaves = Ø; while C  true do T = which_type(C); Slaves = which_slave(C);// Set Slaves Selected_Slaves = Selected_Slaves υ Slaves;// Set Selected_Slaves if T == SLAV E or T == BOTH then for all Slave  Slaves do Slave.add(master_to_slave(Slave, C)) end for if T == BOTH or T == MASTER then handle_constraint(Store,C) C = extract(Store); end while; for all Slave  Selected_Slaves do Slave.solve(REDUCE); slave_try_next(Slave, Store) end for; end procedure; General Constraint Solving Procedures

CILC 06 – Bari, 26/27 Giugno The master and the slaves solvers can be sources of nondeterminism. The slaves interface modules further provide the following methods:  next_solution() to explore the next nondeterministic alternative that a previous call to solve might have left open.  save() that returns a snapshot of the current state of computation of a slave; and  restore() that restores a previously saved state. Nondeterminism Management

CILC 06 – Bari, 26/27 Giugno General Constraint Solving Procedures Procedure used to explore nondeterministic choices left open by slaves: procedure slave_try_next(Solver Slave, Constraint Store) Constraint D; either D = slave_to_master(Slave, Slave.get_constraints()); if D == false then fail else insert(Store,D); end if; orelse // try next nondeterministic alternative Slave.next_solution(); slave_try_next(Slave, Store) end either end procedure;

CILC 06 – Bari, 26/27 Giugno JSetL is a library that endows Java to support general purpose declarative programming. In particular, JSetL provides: logical variables, unification, list and set data structures, constraint solving, and nondeterminism. JFD is a library that provides constraint solving techniques for variables with finite domains. Case Study: JSetL+JFD

CILC 06 – Bari, 26/27 Giugno Case Study: JSetL+JFD procedure step (Constraint Store)... // initialization while C  true do T = which_type(C); Slaves = which_slave(C);// Set Slaves Selected_Slaves = Selected_Slaves υ Slaves;// Set Selected_Slaves if T == SLAV E or T == BOTH then for all Slave  Slaves do Slave.add(master_to_slave(Slave, C)) end for if T == BOTH or T == MASTER then handle_constraint(Store,C) C = extract(Store); end while; for all Slave  Selected_Slaves do Slave.solve(LABEL_ALL); slave_try_next(Slave, Store) end for; end procedure;

CILC 06 – Bari, 26/27 Giugno The handle_constraint procedure of JSetL+JFD: procedure handle_constraint(Constraint Store, Constraint C) if C == op  (o1,o2) then member(Store, C) else if C == op = (o1,o2) then equals(Store, C) else if... then else if C == next then slave_try_next(Store, C) // Unroll nondeterministic choice end if end procedure Case Study: JSetL+JFD

CILC 06 – Bari, 26/27 Giugno The procedure used to explore nondeterministic choices left open by slaves: procedure slave_try_next(Constraint Store, Constraint C) Constraint D; if C.get_alternative() = 0 then add_choice_point(next); // save computation state D = slave_to_master(jfd, jfd.get constraints()); if D = false then fail else insert(Store,D) end if else jfd.next solution();. try next nondeterministic alternative insert(Store, next) end if end procedure Case Study: JSetL+JFD

CILC 06 – Bari, 26/27 Giugno Case Study: JSetL+JFD Nondeterminism is confined to constraint solving: procedure member(Constraint Store, Constraint C) if C = op  (o1,Ø) then fail else if C = op  (o1,X) then insert(Store, op = (X, {o1 |N})) else if C = op  (o1, {o2 | s}) then if C.get_alternative() = 0 then add_choice_point(C); // Save nondeterministic choice insert(Store, op=(o1, o2)) else insert(Store, op2(o1, s)) end if else if... then end if end procedure

CILC 06 – Bari, 26/27 Giugno Extend constraints management and functionalities of JSetL+JFD. Tests on solving process and labeling. Tests with more slaves (i.e Solver for multisets). Application on Configuration Problems. Download at: Conclusions and Future Work