Logic Programming with Solution Preferences Hai-Feng Guo University of Nebraska at Omaha, USA.

Slides:



Advertisements
Similar presentations
Logical conditions If ………………... Logical condition Is something which must either give a "true" or "false" answer / 2 possible results. For example is.
Advertisements

Industrial Economics (Econ3400) Week 4 August 14, 2008 Room 323, Bldg 3 Semester 2, 2008 Instructor: Dr Shino Takayama.
Charting the Potential of Description Logic for the Generation of Referring Expression SELLC, Guangzhou, Dec Yuan Ren, Kees van Deemter and Jeff.
Enter. The Scene Type text here Choice A1 Text for decisions Guidelines Guideline text Click on A, B or C A B C Choice B1 Choice C1 Click on A, B or C.
Algorithm Design Methods (I) Fall 2003 CSE, POSTECH.
1 Modeling and Simulation: Exploring Dynamic System Behaviour Chapter9 Optimization.
A Constraint Logic Programming Solution to the Teacher Relocation Problem Nagehan Ilhan Assoc.Prof.Dr Zeki Bayram Eastern Mediterranean University Famagusta.
Optimization Problems in Optical Networks. Wavelength Division Multiplexing (WDM) Directed: Symmetric: Undirected: Optic Fiber.
Introduction to Truth Maintenance Systems A Truth Maintenance System (TMS) is a PS module responsible for: 1.Enforcing logical relations among beliefs.
 Ammar Abh-Hhdrohss Islamic University -Gaza 1 Chapter 2 Concatenated codes.
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
Presentation of Designing Efficient Irregular Networks for Heterogeneous Systems-on-Chip by Christian Neeb and Norbert Wehn and Workload Driven Synthesis.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Sequential Synthesis.
Chapter 6 FUZZY FUNCTION Chi-Yuan Yeh. Kinds of fuzzy function Crisp function with fuzzy constraint Fuzzy extension function which propagates the fuzziness.
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Ugo Montanari On the optimal approximation of descrete functions with low- dimentional tables.
Regulatory Network (Part II) 11/05/07. Methods Linear –PCA (Raychaudhuri et al. 2000) –NIR (Gardner et al. 2003) Nonlinear –Bayesian network (Friedman.
1 Segmentation with Global Optimal Contour Xizhou Feng 4/25/2003.
Linear Programming Special Cases Alternate Optimal Solutions No Feasible Solution Unbounded Solutions.
Classification with reject option in gene expression data Blaise Hanczar and Edward R Dougherty BIOINFORMATICS Vol. 24 no , pages
1 Chapter 15 Introduction to Planning. 2 Chapter 15 Contents l Planning as Search l Situation Calculus l The Frame Problem l Means-Ends Analysis l The.
Unconstrained Optimization Problem
Lecture outline Support vector machines. Support Vector Machines Find a linear hyperplane (decision boundary) that will separate the data.
Linear Programming – Max Flow – Min Cut Orgad Keller.
Motion Planning in Dynamic Environments Two Challenges for Optimal Path planning.
On Fairness, Optimizing Replica Selection in Data Grids Husni Hamad E. AL-Mistarihi and Chan Huah Yong IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS,
Optimization of Linear Problems: Linear Programming (LP) © 2011 Daniel Kirschen and University of Washington 1.
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
Escape Routing For Dense Pin Clusters In Integrated Circuits Mustafa Ozdal, Design Automation Conference, 2007 Mustafa Ozdal, IEEE Trans. on CAD, 2009.
Artificial Intelligence in Game Design Problems and Goals.
CS62S: Expert Systems Based on: The Engineering of Knowledge-based Systems: Theory and Practice A. J. Gonzalez and D. D. Dankel.
Location problems on networks with routing ▪ E Fernández ▪ TGS 2010 ▪ Jarandilla Noviembre Arc hub location problems as network design problems with.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
1 Global Routing Method for 2-Layer Ball Grid Array Packages Yukiko Kubo*, Atsushi Takahashi** * The University of Kitakyushu ** Tokyo Institute of Technology.
New Modeling Techniques for the Global Routing Problem Anthony Vannelli Department of Electrical and Computer Engineering University of Waterloo Waterloo,
Search exploring the consequences of possible actions.
1Mr.Mohammed Abu Roqyah. Database System Concepts and Architecture 2Mr.Mohammed Abu Roqyah.
FORS 8450 Advanced Forest Planning Lecture 5 Relatively Straightforward Stochastic Approach.
1 Outline:  Optimization of Timed Systems  TA-Modeling of Scheduling Tasks  Transformation of TA into Mixed-Integer Programs  Tree Search for TA using.
Solving Problems by searching Well defined problems A probem is well defined if it is easy to automatically asses the validity (utility) of any proposed.
Aaron Gember, Theophilus Benson, Aditya Akella University of Wisconsin-Madison.
SecPAL Presented by Daniel Pechulis CS5204 – Operating Systems1.
Leaving the Script Justin Permar Soar Workshop June 5, 2013 ADAM GT 1
Efficient Semi-supervised Spectral Co-clustering with Constraints
Simplifying Dynamic Programming via Tabling Hai-Feng Guo University of Nebraska at Omaha, USA Gopal Gupta University of Texas at Dallas, USA.
LDAP for PKI Problems Cannot search for particular certificates or CRLs Cannot retrieve particular certificates or CRLs.
9/22: Transportation: review Initial allocation –NorthWest corner method –Least Cost method –Remember: this is for the INITIAL LAYOUT ONLY -- this is NOT.
What is ASP? CSCE 330 Programming Language Presentation JANICE NEIGHBOR, MICHAEL RICKABAUGH, DAVID THOMAS
Alternative Search Formulations and Applications
Introduction to Linear Programs
Lesson 6: Optimizing Areas and Perimeters
Systems of Equations and Inequalities
Optimal marketing strategy: A decision-making with ANP and TOPSIS
Class and Method Design
BACK SOLUTION:
פחת ורווח הון סוגיות מיוחדות תהילה ששון עו"ד (רו"ח) ספטמבר 2015
Branch and Bound.
Supernetting Recall: subnetting allows an organization to share a single IP network address among multiple physical networks Supernetting (a.k.a. classless.
Data Model.
Machine Learning Week 3.
Assoc. Prof. Dr. Zeki Bayram
A more complex LP problem with What’sBest!
Visual servoing: a global path-planning approach
LINEARPROGRAMMING 4/26/2019 9:23 AM 4/26/2019 9:23 AM 1.
A more complex LP problem
David Botzer and Opher Etzion
Assoc.Prof.Dr Zeki Bayram
Optimal Partitioning of Data Chunks in Deduplication Systems
Function Notation.
Presentation transcript:

Logic Programming with Solution Preferences Hai-Feng Guo University of Nebraska at Omaha, USA

Preference Logic Programming (PLP) Proposed by Bharat Jayaraman (ICLP95, POPL96). PLP is an extension of constraint logic programming for declaratively specifying optimization problems requiring comparison and selection among alternative solutions.

Optimization Problems Traditional specification: A set of constraints Minimizing (or maximizing) an objective function Difficult to specify in the following cases compound objectives optimization over structural domains

Optimization using PLP Specification in PLP A set of constraints Solution preference rules Advantages Separate optimization from problem specification Declarativity and flexibility

A simple example: search for a lowest-cost path path(X, X, 0, 0, []). path(X, Y, C, D, [(X, Y)]) :- edge(X, Y, C, D). path(X, Y, C, D, [(X, Z) | P]) :- edge(X, Z, C1, D1), path(Z, Y, C2, D2, P), D is D1 + D2, C is C1 + C2. edge(a, b, 3, 4). … … path(X,Y,C1, D1,_) <<< path(X,Y,C2, D2,_) :- C2 < C1. path(X,Y,C1, D1,_) <<< path(X,Y,C2, D2,_) :- C1 = C2, D2 < D1.

Solution Preferences in Tabled Prolog Brief introduction of Tabled Prolog Mode-directed tabled predicates Support solution preferences

Tabled Prolog A tabled Prolog system terminates more often by computing fixed points avoids redundant computation by memoing the computed answers keeps the declarative and procedural semantics consistent for any definite Prolog programs with bounded-size terms.

Reachability :- table reach/2. reach(X, Y) :- reach(X, Z), arc(Z, Y). reach(X, Y) :- arc(X, Y). arc(a, b). arc(a, c). arc(b, a). :- reach(a, X). :- table reach/3. reach(X, Y, E) :- reach(X, Z, E1), arc(Z, Y, E2), append(E1, E2, E). reach(X, Y, E) :- arc(X, Y, E). arc(a, b, [(a, b)]). arc(a, c, [(a, c)]). arc(b, a, [(b, a)]). :- reach(a, X, P). abc

How tabled answers are collected? When an answer to a tabled subgoal is generated, variant checking is used to check whether it has been already tabled. Observation: for collecting paths for the reachability problem, we need only one simple path for each pair of nodes. A second possible path for the same pair of nodes could be thought of as a variant answer.

Indexed / Non-indexed The arguments of each tabled predicate are divided into indexed and non- indexed ones. Only indexed arguments are used for variant checking for collecting tabled answers. Non-indexed arguments are treated as no difference.

Mode Declaration for Tabled Predicates :- table p(a 1, …, a n ). p/n is a predicate name, n > 0; each a i has one of the following forms: + denotes that this indexed argument is used for variant checking; denotes that this non-indexed argument is not used for variant checking.

Reachability :- table reach(+, +, –). reach(X, Y, E) :- reach(X, Z, E1), arc(Z, Y, E2), append(E1, E2, E). reach(X, Y, E) :- arc(X, Y, E). arc(a, b, [(a, b)]). arc(a, c, [(a, c)]). arc(b, a, [(b, a)]). :- reach(a, X, P). abc

Built-in Modes for Tabled Predicates ModesInformal Semantics + – min max last <<< an indexed argument non-indexed / for the first answer non-indexed / for the minimal non-indexed / for the maximal non-indexed / for the last answer non-indexed / for user-defined preferences

A shortest path :- table path(+,+,min,–). path(X, X, 0, []). path(X, Y, D, [e(X, Y)]) :- edge(X, Y, D). path(X, Y, D, [e(X, Z) | P]) :- edge(X, Z, D1), path(Z, Y, D2, P), D is D1 + D2. edge(a,b,4).edge(b,a,3).edge(b,c,2). … …

Syntax A Prolog program with solution preferences consists of three parts: 1. Constraints/rules to the general problem; 2. Specify which predicate to be optimized with a mode declaration; 3. Optimization criteria using a set of preference clauses in a form of: T1 <<< T2 :- B1, B2, …, Bn. (n0)

A lowest-cost path path(X, X, 0, 0, []). path(X, Y, C, D, [e(X, Y)]) :- edge(X, Y, C, D). path(X, Y, C, D, [e(X, Z) | P]) :- edge(X, Z, C1, D1), path(Z, Y, C2, D2, P), D is D1 + D2, C is C1 + C2. :- table path(+,+,<<<,<<<, –). path(X,Y,C1, D1,_) <<< path(X,Y,C2, D2,_) :- C2 < C1. Path(X,Y,C1, D1,_) <<< path(X,Y,C2, D2,_) :- C1 = C2, D2 < D1.

Challenge How the defined solution preferences take effects automatically on pruning suboptimal answers and their dependents during the computation? The solution preferences --- Prolog programming level The answer collection --- the system level

A naïve transformation pathNew(X, X, 0, 0, []). pathNew(X, Y, C, D, [(X,Y)]) :- edge(X, Y, C, D). pathNew(X, Y, C, D, [(X, Z)|P]) :- edge(X, Z, C1, D1), path(Z, Y, C2, D2, P), C is C1 + C2, D is D1 + D2. :- table path(+, +, last, -, -). path(X, Y, C1, D1, _) <<< path(X, Y, C2, D2, _) :- C2 < C1. path(X, Y, C1, D1, _) <<< path(X, Y, C2, D2, _) :- C1 = C2, D2 < D1. path(X, Y, C, D, P) :- pathNew(X, Y, C, D, P), ( path(X, Y, C1, D1, P1) -> path(X, Y, C1, D1, P1) <<< path(X, Y, C, D, P) ;true ).

Limitation The answer set over <<< has a total order relation: Every two answers are comparable in terms of <<<; Contradictory preferences are not allowed in the program; It is assumed that there is only a single optimal answer.

updateTable/1 updateTable(Ans) :- allTabledAnswers(TabAns), updateTabledAnswers(TabAns, Ans). updateTabledAnswers(TabAns, Ans) :- compareToTabled(TabAns, Ans, Flist, AnsFlag), removeTabledAnswers(Flist), AnsFlag == 0. compareToTabled([], _, [], Flag) :- (var(Flag) -> Flag = 0; true). compareToTabled([T | Ttail], Ans, [F | Ftail], Flag) :- (T F = 1; F = 0), (Ans Flag = 1; true), compareToTabled(Ttail, Ans, Ftail, Flag).

updateTable(Ans) It is invoked when a new answer Ans to a tabled subgoal is obtained; It determines whether Ans is less preferred than any current tabled answer; if so, Ans is discarded; It also determines whether Ans is better preferred than any current tabled answer; if so, those tabled answers are removed from the table.

Embedding Preferences via an Interface Predicate path(X, X, 0, 0, []) :- updateTable(path(X,X,0,0,[])). path(X, Y, C, D, [(X,Y)]) :- edge(X, Y, C, D), updateTable(path(X,Y,C,D,[(X,Y)])). path(X, Y, C, D, [(X, Z)|P]) :- edge(X, Z, C1, D1), path(Z, Y, C2, D2, P), C is C1 + C2, D is D1 + D2, updateTable(path(X,Y,C,D,[(X,Z)|P]). :- table path(+, +, <<<, <<<, -). path(X, Y, C1, D1, _) <<< path(X, Y, C2, D2, _) :- C2 < C1. path(X, Y, C1, D1, _) <<< path(X, Y, C2, D2, _) :- C1 = C2, D2 < D1.

Flexibility Support multiple optimal answers If two answers are not comparable, then both of them can be optimal atoms. If contradictory preferences occurs, e.g, p(a) <<< p(b) and p(b) <<< p(a), then both p(a) and p(b) should be removed from the table.

Experiments: seconds/(ratio) matrixlcsobstapspknap without preferences 1.47 (1.0) 0.80 (1.0) 1.50 (1.0) 3.14 (1.0) (1.0) Preferences with a naïve transformation 0.37 (0.25) 0.53 (0.66) 0.38 (0.25) 3.11 (0.99) (0.78) Preferences with an interface predicate 1.06 (0.72) 0.70 (0.88) 1.11 (0.74) 2.63 (0.84) (0.59)

Conclusions Programming with Preferences is a declarative paradigm for specifying optimization problems requiring comparison and selection among alternative solutions. A tabled Prolog system with mode declaration scheme provides an easy vehicle for the implementation.