Approximated Probabilistic Answer Set Programming

Similar documents
Discuss the size of the instance for the minimum spanning tree problem.

Algebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the school year.

CS510 Software Engineering

Introduction to Logic in Computer Science: Autumn 2006

Chapter 6. Linear Programming: The Simplex Method. Introduction to the Big M Method. Section 4 Maximization and Minimization with Problem Constraints

Lecture 7: NP-Complete Problems

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Why? A central concept in Computer Science. Algorithms are ubiquitous.

THE DIMENSION OF A VECTOR SPACE

Notes on Determinant

One last point: we started off this book by introducing another famously hard search problem:

Similarity and Diagonalization. Similar Matrices

Applied Algorithm Design Lecture 5

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Permutation Betting Markets: Singleton Betting with Extra Information

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

We shall turn our attention to solving linear systems of equations. Ax = b

CORRELATED TO THE SOUTH CAROLINA COLLEGE AND CAREER-READY FOUNDATIONS IN ALGEBRA

Linear Programming I

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Linear Programming. March 14, 2014

Actually Doing It! 6. Prove that the regular unit cube (say 1cm=unit) of sufficiently high dimension can fit inside it the whole city of New York.

Integer Operations. Overview. Grade 7 Mathematics, Quarter 1, Unit 1.1. Number of Instructional Days: 15 (1 day = 45 minutes) Essential Questions

NP-Completeness and Cook s Theorem

Approximation Algorithms

These axioms must hold for all vectors ū, v, and w in V and all scalars c and d.

OHJ-2306 Introduction to Theoretical Computer Science, Fall

Practical Guide to the Simplex Method of Linear Programming

Testing LTL Formula Translation into Büchi Automata

3. Linear Programming and Polyhedral Combinatorics

5.1 Bipartite Matching

Minimally Infeasible Set Partitioning Problems with Balanced Constraints

Introduction to Matrix Algebra

Lecture 3: Finding integer solutions to systems of linear equations

Transportation Polytopes: a Twenty year Update

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

Generating models of a matched formula with a polynomial delay

Polynomial Operations and Factoring

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

Logic in general. Inference rules and theorem proving

. P. 4.3 Basic feasible solutions and vertices of polyhedra. x 1. x 2

Lecture 2 Matrix Operations

(67902) Topics in Theory and Complexity Nov 2, Lecture 7

LEARNING OBJECTIVES FOR THIS CHAPTER

Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

South Carolina College- and Career-Ready (SCCCR) Algebra 1

Permutation Betting Markets: Singleton Betting with Extra Information

Linear Programming Problems

Which Semantics for Neighbourhood Semantics?

LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS. 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method

A Modular Representation of a Business Process Planner

CSC 373: Algorithm Design and Analysis Lecture 16

Software Modeling and Verification

Computing exponents modulo a number: Repeated squaring

1 Solving LPs: The Simplex Algorithm of George Dantzig

Continued Fractions and the Euclidean Algorithm

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

Algorithmic Software Verification

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Linear Codes. Chapter Basics

Guessing Game: NP-Complete?

Mathematical finance and linear programming (optimization)

NOTES ON LINEAR TRANSFORMATIONS

Standard Form of a Linear Programming Problem

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Bounded Treewidth in Knowledge Representation and Reasoning 1

Linear Programming. April 12, 2005

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

A Propositional Dynamic Logic for CCS Programs

Introduction. Appendix D Mathematical Induction D1

Optimization in R n Introduction

Two classes of ternary codes and their weight distributions

Factoring Polynomials

4.6 Linear Programming duality

npsolver A SAT Based Solver for Optimization Problems

Lecture 1: Oracle Turing Machines

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

Cartesian Products and Relations

Factoring of Prime Ideals in Extensions

This exposition of linear programming

Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

Wentzville School District Algebra 1: Unit 8 Stage 1 Desired Results

by the matrix A results in a vector which is a reflection of the given

Solution to Homework 2

Math 1050 Khan Academy Extra Credit Algebra Assignment

Algorithm Design and Analysis

P versus NP, and More

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Indiana State Core Curriculum Standards updated 2009 Algebra I

Solution of Linear Systems

Computational Methods for Database Repair by Signed Formulae

How To Prove The Dirichlet Unit Theorem

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

1 VECTOR SPACES AND SUBSPACES

Universality in the theory of algorithms and computer science

Formal Verification and Linear-time Model Checking

Transcription:

Approximated Probabilistic Answer Set Programming Department of Computer Science Universidade de São Paulo São Paulo, Brazil 2014

Toy Example 4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 50% and the edge (3, 4) to 40%

Outline 1 2 Answer Set Programming 3 Probabilistic Satisfiability 4 5 6

Next Topic 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

What is? Non-monotonic, declarative programming paradigm for hard combinatorial problems A Program is a set of rules h L 1,..., L m, not L m+1,..., not L n The symbol not represents default negation or negation as a failure to prove Programs may have variables and functions, but must be grounded before solving

Constraints and Weight Rules Other types of rules: Restrictions: Rules without heads L 1,..., L m, not L m+1,..., not L n Weight rules: Rules made from weight constraints C 0 C 1,..., C n Weight Constraints: L {h 1 = w 1,..., not h n = w n } U. Weight rules make Σ P 2 -complete.

Answer Sets For programs without default negation, the Answer Set is the minimal model that satisfies all rules For programs with default negation, maybe there is not a unique minimal model We must first assume a set a literals and them verify if this set is a minimal model of the resulting rules

Answer Sets Let M be a finite set of atoms of P, the program P M, obtained from P by removing: all the rules that have a literal A in their negative body if A M; the negative body of the remaining rules is called reduction of P by M. Let P M be the reduction of the program P by M, M is an Answer Set of P if the minimal model of P M is M.

Toy Example 4 6 2 5 3 1 An Program that finds all the paths from vertex 1 to n. 1 {visited(x, Y ) = 1 for each edge(x, Y )} 1 vertex(x ), pathto(x ). pathto(1). pathto(y ) pathto(x ), visited(x, Y ), edge(x, Y ). not pathto(n).

Next Topic History Applications 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

A Brief History of History Applications Probabilistic logic was proposed in On the Laws of Thought [Boole 1854] Classical probability and classical logic No assumption of a priori statistical independence Rediscovered several times since Boole De Finetti [1937, 1974], Good [1950], Smith [1961] Studied by Hailperin [1965] Nilsson [1986] (re)introduces to AI Papadimitriou et al [1988]: NP-complete Many other works; see Hansen & Jaumard [2000]

The Setting: the language History Applications Logical variables or atoms: P = {x 1,..., x n } Connectives:,,,,. Formulas (L) are inductively composed form atoms using connectives Formulas can be brought to clausal form, but need not be.

Semantics History Applications Propositional valuation v : P {0, 1} Generalized for any propositional formula (clausal or not) v : L {0, 1}

Semantics History Applications Propositional valuation v : P {0, 1} Generalized for any propositional formula (clausal or not) v : L {0, 1} A probability distribution over propositional valuations π : V [0, 1] π(v i ) = 1 2 n i=1

Semantics History Applications Propositional valuation v : P {0, 1} Generalized for any propositional formula (clausal or not) v : L {0, 1} A probability distribution over propositional valuations π : V [0, 1] π(v i ) = 1 2 n i=1 Probability of a formula α according to π P π (α) = {π(v i ) v i (α) = 1}

The Problem History Applications Consider k formulas α 1,..., α k defined on n atoms {x 1,..., x n } A problem Σ is a set of k restrictions Σ = {P(α i ) = p i 1 i k} Probabilistic Satisfiability: are these restrictions consistent?

The Problem History Applications Consider k formulas α 1,..., α k defined on n atoms {x 1,..., x n } A problem Σ is a set of k restrictions Σ = {P(α i ) = p i 1 i k} Probabilistic Satisfiability: are these restrictions consistent? Given Σ = {P(φ i ) = p i φ i L PL, 1 i q}. Is there a π such that P π (φ i ) = p i, for 1 i q?

A example Is the Hypothesis Consistent with the Data History Applications The problem: how to fit precise theories with an imprecise world? Doctor investigating disease D Examine role of genes G 1, G 2, G 3 Hypothesis At least two genes have to be present for D to develop Data Gene occurrence in D-patients G 1 60% G 2 60% G 3 60%

A example History Applications Σ = { P(a b) = P(a c) = P(b c) = 1 P(a) = P(b) = P(c) = 0.6 }

A example History Applications Σ = { P(a b) = P(a c) = P(b c) = 1 P(a) = P(b) = P(c) = 0.6 } v 1 = {a = b = c = 1}, v 2 = {a = b = 1; c = 0}, v 3 = {a = c = 1; b = 0} and v 4 = {a = 0; b = c = 1}.

History Applications The Problem: An Algebraic Formalization Vector of probabilities p of dimension k 1 (given) Consider a large matrix A k 2 n = [a ij ] (computed) a ij = v j (α i ) {0, 1} : decide if there is vector π of dimension 2 n 1 such that Aπ = p πi = 1 π 0 π: probability distribution of exponential size

is NP-complete History Applications is NP-complete: [Georgakopoulos & Kavvadias & Papadimitriou 1988] A problem has a solution, then there is a solution π with at most k + 1 elements π i > 0 Carathéodory s Lemma So has a polynomial size witness 1 1 π 1 0/1 0/1..... π 2. 0/1 0/1 π k+1 = 1 p 1. p k

Possible Applications History Applications has many potential applications Computer models of biological processes Machine learning Fault tolerance/detection Software design and analysis Economics, econometrics, etc. Already successfully applied in Materials Science [Finger 2013]

Next Topic 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

is more expressive than SAT We want to extend with probabilistic logic Facilitate writing complex models with

A P instance is a grounded Program and a set of probabilities over the atoms The set of probabilities P = {P(a i ) = p i 1 i k} is satisfied by S if there is a probability distribution π over all subsets where p i = {π(v l ) a i v l and v l is Answer Set of S}

Like the, we can write a P problem in matrix form A k 2 HB S = [a ij ], such that a ij = 1 iff the j-th atom subset contains the i-th atom criterion for deciding the satisfiability of a P instance becomes: Aπ = p πi = 1 π 0

Proposition If there exists an solution for a P instance, there is a solution with at most k + 1 nonzero elements in π. This Proposition follows directly from Carathéodory s Lemma. P is Σ P 2 -complete (due to weight rules)

Toy Example 4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 50% and the edge (3, 4) to 40% P(visited(1, 3)) = 0.5, P(visited(3, 4)) = 0.4 Satisfiable with π = [0.5, 0.1, 0.4]

Next Topic 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

Solving via Linear Programming We decide the consistency by finding a solution to the matrix equation This can be seen as a Linear Programming problem, with the Simplex algorithm We initialize the algorithm using artificial variables The equation with the first base is: 1 1... 1 0 1... 1...... 0 0... 1 π 0 π 1. π k = 1 p 1 The cost function is the number of columns that do not correspond to an Answer Set. p k

Column generation We must generate new columns to reduce the cost function Use an Solver to generate new Answer Sets with the added restriction that it s reduced cost is negative c B B 1 A j > 0 Be careful since is non-monotonic, and you can t guarantee that by adding new rules you will have the same Answer Set But you can if the only rules added are restriction

Inequalities as SAT instances It s possible to express an binary linear inequality as SAT formulas [J.P. Warners, 1998] The coefficients must be integer and are represented in binary form With that we obtain a CNF formula (a 11 a n1 ) (a 1m a jm ) And express it in the program as the restrictions: not a 11,..., not a n1.. not a 1m,..., not a jm.

Weight rules Append the rule: {l 1 = c B B 1 1,..., l k = c B B 1} c B B 1 (possible scaled to only allow integers) k 0

Implementation Implementation available at git://gitorious.org/pasp/pasp-asp.git

Next Topic 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

Problems Trying to use P on a POS-Tagger revealed some limitations...

4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 20% and the edges (3, 4) and (4, 5) to 40% Unsatisfiable

4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 20% and the edges (3, 4) and (4, 5) to 40% Unsatisfiable Can we find a π that best approximate to these probabilities?

Error Given a probability distribution π, we define the error of π as E(π) = p i {π(v l ) a i v l and v l is Answer Set of S} i P If E(π) = 0, it is satisfiable.

We need a different algorithm 4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 20% and the edges (3, 4) and (4, 5) to 40% π(i 3 ) = 0.4, π(i i ) = 0 i 3: E(π) = 0.2

We need a different algorithm 4 6 2 5 1 3 Limit the percentage of time the edge (1, 3) is used to 20% and the edges (3, 4) and (4, 5) to 40% π(i 3 ) = 0.4, π(i i ) = 0 i 3: E(π) = 0.2 The best solution the algorithm we saw can reach has error 0.4

Slack variables A viable solution will never have a greater probability to an atom It may assign (non-zero) probabilities to non-answer-set sets These can be thought as positive slack variables To have a viable solution with greater probability, we need negative slack variables

minimize c T π [A I I ] π = p π 0 πi = 1 π i > 0 for a column i in the Identity Matrix is summed or subtracted to the probability of the i-th atom. It is part of the error of this atom.

minimize c T π [A I I ] π = p π 0 πi = 1 π i > 0 for a column i in the Identity Matrix is summed or subtracted to the probability of the i-th atom. It is part of the error of this atom. The result is not a distribution over the subsets of HB S, but such a distribution can be obtained.

Next Topic 1 2 Answer Set Programming 3 Probabilistic Satisfiability History Applications 4 5 6 7

Implementation and optimization Part-of-speech tagger

Thank you!