first order knowledge compilation for probabilistic
play

First-Order Knowledge Compilation for Probabilistic Reasoning Guy - PowerPoint PPT Presentation

First-Order Knowledge Compilation for Probabilistic Reasoning Guy Van den Broeck based on joint work with Adnan Darwiche, Dan Suciu, and many others MOTIVATION 1 A Simple Reasoning Problem ... ? Probability that Card1 is Hearts? [Van den


  1. Statistical Relational Learning Hard constraint ∞ Smoker(x) ⇒ Person(x) Soft constraint 3.75 Smoker(x) ∧ Friend(x,y) ⇒ Smoker(y) • An MLN = set of constraints (w, Γ ( x )) • Weight of a world = product of w, for all rules (w, Γ ( x )) and groundings Γ ( a ) that hold in the world P MLN (Q) = [sum of weights of worlds of Q] / Z Applications: large probabilistic KBs

  2. FO NNF SYNTAX

  3. First-Order Knowledge Compilation • Input: Sentence in FOL • Output: Representation tractable for some class of queries. • In this work: – Function-free FOL – Model counting in NNF tradition • Some pre-KC-map work: – FO Horn clauses – FO BDDs

  4. Alphabet • FOL – Predicates/relations: Friends – Object names: x, y, z – Object variables: X, Y, Z – Symbols classical FOL ( ∀ , ∃ , ∧ , ∨ , ¬,…) • Group logic – Group variables: X, Y, Z – Symbols from basic set theory (e.g., ∪ , ∩, ∈ , ⊆ , {, }, complement).

  5. Syntax • Object terms: X, alice, bob • Group terms : X, {alice,bob}, X ∪ Y • Atom: Friends(alice,X) • Formulas: – (α), ¬α, α ∨ β, and α ∧ β – ∀ X ∈ G , α and ∃ X ∈ G , α – ∀ X ⊆ G , α and ∃ X ⊆ G , α • Group logic syntactic sugar: – P( G ) is ∀ X ∈ G, P (X) – ` P( G ) is ∀ X ∈ G, ¬P (X)

  6. Examples: • ∀ X ∈ G , Y ∈ {alice, bob}, Enemies(X, Y ) ⇒ ¬Friends(X, Y ) ∧ ¬Friends(Y, X) • ∀ X ∈ G , Y ∈ G , Smokes(X) ∧ Friends(X, Y) ⇒ Smokes(Y) • ∃ G ⊆ {alice, bob} , Smokes( G) ∧ ` Healthy( G )

  7. Semantics • Template language for propositional logic • Grounding a sentence: gr( α ) • Replace ∀ by ∧ • Replace ∃ by ∨ • End result: ground sentence = propositional logic • Grounding is polynomial in group sizes when no ∀ X ⊆ G or ∃ X ⊆ G Important for polytime reduction to NNF circuits

  8. Decomposability • Conjunction: α (X, G ) ∧ β (X, G ) For any substitution X=c and G =g, we have that gr( α (c,g)) ∧ gr( β (c,g)) is decomposable Meaning: α and β can never talk about the same ground atoms • Quantifier: ∀ Y ∈ G, α (Y) For any two a,b ∈ G, we have that gr( α (a)) ∧ gr( α (b)) is decomposable

  9. Determinism • Disjunction: α (X, G ) ∨ β (X, G ) For any substitution X=c and G =g, we have that gr( α (c,g)) ∨ gr( β (c,g)) is deterministic Meaning: α ∧ β is UNSAT • Quantifier: ∃ Y ∈ G, α (Y) For any two a,b ∈ G, we have that gr( α (a)) ∨ gr( α (b)) is decomposable

  10. Group Quantifiers • Decomposability: ∀ X ⊆ G, α ( X ) For any two A , B ⊆ G, we have that gr( α ( A )) ∨ gr( α ( B )) is decomposable • Determinism: ∃ X ⊆ G, α ( X ) For any two A , B ⊆ G, we have that gr( α ( A )) ∨ gr( α ( B )) is deterministic

  11. Automorphism • Object permutation σ : D→ D is a one-to-one mapping from objects to objects. • Permuting α using σ replaces o in α by σ(o). • Sentences α and β are p -equivalent iff α is equivalent to an object permutation of β. Smokes(alice) and Smokes(bob) are p-equivalent • Group quantifiers: ∀ X ⊆ G, α ( X ) or ∃ X ⊆ G, α ( X ) Are automorphic iff for any two A , B ⊆ G s.t. |A|=|B|, gr( α ( A )) and gr( α ( B )) are p-equivalent

  12. First-Order NNF Decomposable

  13. First-Order NNF Decomposable

  14. First-Order DNNF Decomposable

  15. First-Order DNNF Deterministic

  16. First-Order d-DNNF Deterministic

  17. First-Order d-DNNF Automorphic

  18. First-Order d-DNNF Automorphic

  19. First-Order ad-DNNF Automorphic

  20. FO NNF Languages • FO NNF: group logic circuits, negation only on atoms • FO d-DNNF: determinism and decomposability Grounding generates a d-DNNF • FO DNNF Grounding generates a DNNF • FO ad-DNNF: automorphic Powerful properties!

  21. FO NNF TRACTABILITY

  22. Symmetric WFOMC Def . A weighted vocabulary is ( R , w ), where – R = (R 1 , R 2 , …, R k ) = relational vocabulary – w = (w 1 , w 2 , …, w k ) = weights • Fix an FO formula Q, domain of size n • The weight of a ground tuple t in R i is w i Complexity of FOMC / WFOMC(Q, n)? Data/domain complexity: fixed Q, input n / and w

  23. Symmetric WFOMC on FO ad-DNNF Complexity polynomial in domain size! Polynomial in NNF size for bounded depth.

  24. FOMC Query: Example FO-Model Counting: w(R) = w(¬R) = 1 FO ad-DNNF sentences

  25. FOMC Query: Example FO-Model Counting: w(R) = w(¬R) = 1 FO ad-DNNF sentences Δ = (Stress(Alice) ⇒ Smokes(Alice)) 4. Domain = {Alice}

  26. FOMC Query: Example FO-Model Counting: w(R) = w(¬R) = 1 FO ad-DNNF sentences Δ = (Stress(Alice) ⇒ Smokes(Alice)) 4. Domain = {Alice} → 3 models

  27. FOMC Query: Example FO-Model Counting: w(R) = w(¬R) = 1 FO ad-DNNF sentences Δ = (Stress(Alice) ⇒ Smokes(Alice)) 4. Domain = {Alice} → 3 models Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people}

  28. FOMC Query: Example FO-Model Counting: w(R) = w(¬R) = 1 FO ad-DNNF sentences Δ = (Stress(Alice) ⇒ Smokes(Alice)) 4. Domain = {Alice} → 3 models Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models

  29. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models

  30. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people}

  31. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ⇒ MotherOf(y)) If Female = true?

  32. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ⇒ MotherOf(y)) If Female = true? → 4 n models If Female = false? Δ = true

  33. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ⇒ MotherOf(y)) If Female = true? → 4 n models If Female = false? Δ = true → 3 n + 4 n models

  34. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ⇒ MotherOf(y)) If Female = true? → 4 n models If Female = false? Δ = true → 3 n + 4 n models Δ = ∀ x, ∀ y, (ParentOf(x,y) ∧ Female(x) ⇒ MotherOf(x,y)) 1. D = {n people}

  35. FOMC Query: Example Δ = ∀ x, (Stress(x) ⇒ Smokes(x)) 3. Domain = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ∧ Female ⇒ MotherOf(y)) 2. D = {n people} → 3 n models Δ = ∀ y, (ParentOf(y) ⇒ MotherOf(y)) If Female = true? → 4 n models If Female = false? Δ = true → 3 n + 4 n models Δ = ∀ x, ∀ y, (ParentOf(x,y) ∧ Female(x) ⇒ MotherOf(x,y)) 1. D = {n people} n models → (3 n + 4 n )

  36. Group Quantifiers: Example Δ = ∀ x ,y ∈ D , (Smokes(x) ∧ Friends(x,y) ⇒ Smokes(y)) Domain = {n people} • Not decomposable! • Rewrite as FO ad-DNNF: ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G ) • Not possible to ground to d-DNNF! • How to do tractable CT?

  37. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )

  38. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  39. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  40. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  41. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  42. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  43. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  44. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  45. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  46. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k

  47. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k → models

  48. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k → models  If we know that there are k smokers?

  49. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k → models  If we know that there are k smokers? → models

  50. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k → models  If we know that there are k smokers? → models  In total…

  51. Group Quantifiers: Example ∃ G ⊆ D, Smokes( G ) ∧ ` Smokes (` G ) ∧ ` Friends( G , ` G )  If we know G precisely: who smokes, and there are k smokers? Database: Smokes Friends Smokes Smokes(Alice) = 1 Smokes(Bob) = 0 Smokes(Charlie) = 0 k k Smokes(Dave) = 1 Smokes(Eve) = 0 ... n-k n-k → models  If we know that there are k smokers? → models → models  In total…

  52. Playing Cards Revisited Let us automate this: ... ∀ p, ∃ c, Card(p,c) ∀ c, ∃ p, Card(p,c) ∀ p, ∀ c, ∀ c’, Card( p,c) ∧ Card(p,c ’) ⇒ c = c’ [Van den Broeck.; AAAI- KR‟15]

  53. Playing Cards Revisited Let us automate this: ... ∀ p, ∃ c, Card(p,c) ∀ c, ∃ p, Card(p,c) ∀ p, ∀ c, ∀ c’, Card( p,c) ∧ Card(p,c ’) ⇒ c = c’ [Van den Broeck.; AAAI- KR‟15]

  54. Playing Cards Revisited Let us automate this: ... ∀ p, ∃ c, Card(p,c) ∀ c, ∃ p, Card(p,c) ∀ p, ∀ c, ∀ c’, Card( p,c) ∧ Card(p,c ’) ⇒ c = c’ Computed in time polynomial in n [Van den Broeck.; AAAI- KR‟15]

  55. FO COMPILATION

  56. Compilation Rules • Lots of preprocessing • Shannon decomposition/Boole’s expansion • Detect propositional decomposability • FO Shannon decomposition: Simplify β (remove atoms subsumed by P( X )) Always deterministic! Ensure automorphic ∃ • Detect FO decomposability

  57. FO NNF EXPRESSIVENESS

  58. Main Positive Result: FO 2 • FO 2 = FO restricted to two variables • “The graph has a path of length 10”: ∃ x ∃ y(R(x,y) ∧ ∃ x (R(y,x) ∧ ∃ y (R(x,y) ∧ …))) • Theorem: Compilation algorithm to FO ad- DNNF is complete for FO 2 • Model counting for FO 2 in PTIME domain complexity

  59. Main Negative Results Domain complexity: • There exists an FO formula Q s.t. symmetric FOMC(Q, n) is #P 1 hard • There exists Q in FO 3 s.t. FOMC(Q, n) is #P 1 hard • There exists a conjunctive query Q s.t. symmetric WFOMC(Q, n) is #P 1 hard • There exists a positive clause Q w.o . „=„ s.t. symmetric WFOMC(Q, n) is #P 1 hard Therefore, no FO ad-DNNF can exist 

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend