10/28 homework 3 returned homework 4 socket opened (no office hours today) where hard problems are...

30
10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Post on 22-Dec-2015

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

10/28

Homework 3 returned

Homework 4 socket opened

(No office hours today)

Where hard problems are

Phase Transition

Page 2: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Davis-Putnam-Logeman-Loveland Procedure

detect failure

Page 3: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

DPLL Example

Clauses (p,s,u) (~p, q) (~q, r) (q,~s,t) (r,s) (~s,t) (~s,u)

Pick p; set p=true unit propagation (p,s,u) satisfied (remove) p;(~p,q) q derived; set q=T (~p,q) satisfied (remove) (q,~s,t) satisfied (remove) q;(~q,r)r derived; set r=T (~q,r) satisfied (remove) (r,s) satisfied (remove) pure literal elimination in all the remaining clauses, s occurs negative set ~s=True (i.e. s=False) At this point all clauses satisfied. Return p=T,q=T;r=T;s=False

s was not Pure in all clauses (onlyThe remaining ones)

Page 4: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Model-checking by Stochastic Hill-climbing

• Start with a model (a random t/f assignment to propositions)

• For I = 1 to max_flips do– If model satisfies clauses then

return model– Else clause := a randomly selected

clause from clauses that is false in model

• With probability p whichever symbol in clause maximizes the number of satisfied clauses /*greedy step*/

• With probability (1-p) flip the value in model of a randomly selected symbol from clause /*random step*/

• Return Failure

Remarkably good in practice!!

Clauses 1. (p,s,u) 2. (~p, q) 3. (~q, r) 4. (q,~s,t) 5. (r,s) 6. (~s,t) 7. (~s,u)

Consider the assignment “all false” -- clauses 1 (p,s,u) & 5 (r,s) are violated --Pick one—say 5 (r,s) [if we flip r, 1 (remains) violated if we flip s, 4,6,7 are violated] So, greedy thing is to flip r we get all false, except r otherwise, pick either randomly

Page 5: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Phase Transition in SAT

Theoretically we only know that phase transition ratio occurs between 3.26 and 4.596.

Experimentally, it seems to be close to 4.3(We also have a proof that 3-SAT has sharp threshold)

Page 6: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

http://www.ipam.ucla.edu/publications/ptac2002/ptac2002_dachlioptas_formulas.pdf

Progress in nailing the bound.. (just FYI)

Not discussed in class

Page 7: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

An easy upper bound for 3-sat transition (optional)

• Suppose there are n variables and c clauses• Probability that a random assignment satisfied a clause if 7/8

– Each clause contains 3 variables; so 23 possible assignments for the variables. Of these, just one, the all false one, makes the clause false

• Probability that all c clauses are satisfied is (7/8)c (assuming clause independence; holds when n>>3)

• There are 2n possible random assignments. So, the number of assignments which will satisfy the entire 3SAT instance is 2n (7/8)c This is the expected number of satisfying assignments

• We want to know when the expected num of satisfying assignments becomes less than 1 (i.e., unsatisfiable)

– 2n (7/8)c < 1– n + c log2 7/8 < 0

• Taking log to the base 2 on both sides– n < - c log2 7/8 – n < c log2 8/7– c/n > 1/log2 8/7 = 1/0.1926 = 5.1921

Not discussed in class

Page 8: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

CSP:SAT with multi-valued variables

• It is easy to generalize the SAT problem to handle non-boolean variables– CSP problem

• Given a set of discrete variables and their domains

• And a set of constraints (expressed as legal value combinations that can be taken by various subsets of the variables)

– Clausal constraints (such as p=>q ) can be seen in this way too

• Find a model (an assignment of domain values to the variables) that satisfies all constraints

– SAT is a boolean CSP

Page 9: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

We can model any CSP problem also as a SAT problem Consider the variables “WA-is-red” “WA-is-green”…. |V|*|D| boolean variables --but this leads to some loss of structure

Page 10: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

We will mostly talk about discrete domain variables

All CSPs can be compiled to binary CSPs (by introducing additional variables) Most early work on CSP concentrated on binary CSPs

Page 11: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 12: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

10/30

Counseling today during office hours

Page 13: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Most of the SAT improvements work for CSP too. Main differences are:

--Variable selection heuristics CSP solvers typically consider most constrained variable first heuristic (i.e., heuristic with the smallest domain)--Value selection heuristics CSP solvers consider “least constraining value first” heuristic-- Lookahead Instead of unit propagation, CSP solvers use variety of constraint propagation algorithms (forward checking, arc-consistency, path consistency)

Backtracking SearchAs is the case for SAT, basic search For CSP is in the space of partialAssignments --extend the assignment by selecting a variable and considering all its values (in different branches) --prune any (even partial) assignment if it violates a constraint

RedViolates

Page 14: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Variable Ordering Strategies

Notice that for “boolean CSPs” (SAT), most constrained variable heuristics are less effective (since all variables have domains of size 2 (normal), 1 (have a specific value) or 0 (backtrack)

Page 15: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Value Ordering Heuristics

Page 16: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Lookahead

Variable ordering can be improved in the presence of FC

DVO (Dynamic variable ordering) --Consider the variable with the smallest remaining domain next

Page 17: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

2-consistency

Forward checking will stop thinking everyone has non-empty domains. However, NT is blue; if you propagate that we know that SA cannot be blue. This means SA is empty domain

Graphplan mutex propagation can beSeen as a form of 3-consistency Enforcement..

Page 18: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Summary of Propositional Logic

• Syntax• Semantics (entailment)• Entailment computation

– Model-theoretic• Using CSP techniques

– Proof-theoretic• Resolution refutation

– Heuristics to limit type of resolutions» Set of support

• Connection to CSP– K-consistency can be seen as a form of limited inference

Page 19: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Why FOPC

If your thesis is utter vacuousUse first-order predicate calculus.With sufficient formalityThe sheerest banality

Will be hailed by the critics: "Miraculous!"

Page 20: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 21: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 22: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 23: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 24: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 25: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 26: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 27: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Left-leg-of

Tarskian Interpretations

Page 28: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 29: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition
Page 30: 10/28 Homework 3 returned Homework 4 socket opened (No office hours today) Where hard problems are Phase Transition

Inference in first order logic

• For “ground” sentences (i.e., sentences without any quantification), all the old rules work directly– P(a,b)=> Q(a); P(a,b) |= Q(a)– ~P(a,b) V Q(a) resolved with P(a,b) gives Q(a)

• What about quantified sentences?– Universal Instantiation (a universally quantified

statement entails every instantiation of it)

• Can we combine these (so we can avoid unnecessary instantiations?) Yes. Generalized modus ponens

• Needs UNIFICATION

)(),()(),( bQbaentailsPxQyxyPx

)(|),();(),( bqbaPxQyxyPx