more on computational issues comp34512
play

More on Computational Issues COMP34512 Rafael Gonalves Bijan - PowerPoint PPT Presentation

More on Computational Issues COMP34512 Rafael Gonalves Bijan Parsia bparsia@cs.man.ac.uk Tuesday, 11 March 14 Tuning our Logic Both Prop & Pred Logic had issues Expressivity (Representational Adequacy) Even for our simple use


  1. More on Computational Issues COMP34512 Rafael Gonçalves Bijan Parsia bparsia@cs.man.ac.uk Tuesday, 11 March 14

  2. Tuning our Logic • Both Prop & Pred Logic had issues Expressivity (Representational Adequacy) – Even for our simple use case! • We would like the formalism to be – Representationally adequate Usability • (Propositional fails) Computability (Weak Cognitive Adequacy (vs. Computational and vs. Implementational Complexity) Cognitive Complexity) – Computationally reasonable More Expressivity • (Both have issues) – Usable (cognitively adequate) hurt Usability • Predicate logic has too much choice • Propositional logic has “wrong expressivity” Less Expressivity – So we are forced into hacky workarounds hurt Usability • Proposal: RDFS-- (in different ways) – Tuned for expressing terminologies 2 Tuesday, 11 March 14

  3. RDFS--: Syntax Individual (f) ::= [a-z]+ Class (A) ::= [A-Z][a-zA-Z]* (in camel case) TBoxAxiom (A1, A2) :: = A1 ⊑ A2 A1 SubClassOf: A2 | A1 ≡ A2 | A1 EquivalentTo: A2 ABoxAxiom (A1,f) :: = f:A1 | f Types: A1 | A1(f) • Super simple syntax! – Tiny bit of propositional logic – Tiny bit of predicate logic • Variables & Quantifiers hidden! No pointless choice there! • We divide the theory into 2 parts: – TBox: “Terminological box” • Universally quantified (bi)conditionals between monadic predicates – ABox: “Assertional Box” • Ground monadic predicates – TBox ≈ Schema; ABox ≈ Data 3 Tuesday, 11 March 14

  4. RDFS--: Semantics • Two possible approaches – Direct Model Theory (an interpretation function) – By Translation (a translation function) Syntax Translation to FOL Interpretation (assuming Δ ) fluffy fluffy fluffy I ∈ Δ Cat Cat/1 i.e., Cat(x) Cat I ⊆ Δ Cat(fluffy) Cat(fluffy) fluffy I ∈ Cat I fluffy:Cat Cat ⊑ Mammal ∀ x(Cat(x) → Mammal(x)) Cat I ⊆ Mammal I Animal ≡ Animalia ∀ x(Animal(x) ↔ Animalia(x)) Animal I = Animalia I 4 Tuesday, 11 March 14

  5. RDFS--: Semantics • Model theory is simpler for the simpler language! I1: Δ = {1,2,3...} Cat I = {1,4,5} Exactly Mammal I = {1,2,3,4,5} the same fluffy I = 5 RFDS-- RFDS-- FOL FOL Interpretation Interpretation Cat(fluffy) True, since Cat(fluffy) True, since fluffy:Cat fluffy I ∈ Cat I fluffy I ∈ Cat I Cat ⊑ Mammal True, since ∀ x(Cat(x) → True, since every possible σ is such that if Mammal(x)) Cat I ⊆ Mammal I σ (C, x) is True then σ (M, x) is also True Equivalent 5 Tuesday, 11 March 14

  6. RDFS--: Expressivity • Can captures some stuff better than propositional! English Prop Predicate Logic A Term Logic Logic (RDFS--) Mammals are Mf → Af ∀ x(M(x) → A(x)) M ⊑ A Animals Ms → As Cats are Cf → Mf ∀ y(C(y) → M(y)) C ⊑ M Mammals Cs → Ms Dogs are D → M ∀ y ∀ x(D(x) → M(x)) D ⊑ M Mammals Fluffy is a Cat Cf C(f) C(f) Sparkles is a Cs C(s) C(s) Cat No need to hack names and multiply axioms 6 Tuesday, 11 March 14

  7. RDFS--: Expressivity • Does as bad or worse in other cases English English Prop Logic Prop Logic Predicate Logic Predicate Logic RDFS-- RDFS-- Mammals are Mammals are M → A M → A ∀ x(M(x) → A(x)) ∀ x(M(x) → A(x)) M ⊑ A M ⊑ A Animals Animals Cats are Mammals Cats are Mammals C → M C → M ∀ y(C(y) → M(y)) ∀ y(C(y) → M(y)) C ⊑ M C ⊑ M Dogs are Mammals D → M Dogs are Mammals D → M ∀ y ∀ x(D(x) → M(x)) ∀ y ∀ x(D(x) → M(x)) D ⊑ M D ⊑ M Cats are not Dogs Cats are not Dogs C → ¬D C → ¬D ∀ y(C(y) → ¬D(y)) ∀ y(C(y) → ¬D(y)) C ⊑ NotD C ⊑ NotD Cats eat some dogs C → ED Cats eat some dogs C → ED ∀ y(C(y) → ∀ y(C(y) → C ⊑ ED C ⊑ ED ∃ x(eats(y,x) ∧ D(x)) ∃ x(eats(y,x) ∧ D(x)) 7 Tuesday, 11 March 14

  8. RDFS--: Computational Complexity • Consistency? – WCC: 0 • They are all always consistent • How can we know this? • Entailment? – There are only three sorts of possible entailment – Subsumption (C SubClassOf: D) D • Find a (directed) path between C and D • Only tricky bit is cycle detection C3 – Not that tricky! • Polynomial (what’s a tighter bound?) C1 C2 C4 – Instantiation (f Types: C) • Same! Just hang f off its asserted type node C – Equivalence (C EquivalentTo: D) • Second kind of edge and/or find a cycle 8 Tuesday, 11 March 14

  9. RDFS--: Cognitively? • Easy to learn and use and analyse • Severe expressivity limitations a PITA English Prop Logic Predicate Logic RDFS-- Mammals are M → A ∀ x(M(x) → A(x)) M ⊑ A Animals Cats are Mammals C → M ∀ y(C(y) → M(y)) C ⊑ M Dogs are Mammals D → M ∀ y ∀ x(D(x) → M(x)) D ⊑ M Cats are not Dogs C → ¬D ∀ y(C(y) → ¬D(y)) C ⊑ NotD Cats eat some dogs C → ED ∀ y(C(y) → C ⊑ ED ∃ x(eats(y,x) → D(x)) 9 Tuesday, 11 March 14

  10. ALC: Syntax Individual (f) ::= [a-z]+ Class (A) ::= [A-Z][a-zA-Z]* (in camel case) Property (P) ::= [a-z][a-zA-Z]* (in camel case) ClassExpression (C, D) :: = A | ¬C | C ⊔ D | C ⊓ D | ∃ P.C | ∀ P.C TBoxAxiom (C, D) :: = A1 ⊑ A2 | A1 ≡ A2 ABoxAxiom (C,f,g) :: = f:C | C(f) | <f,g>:P | P(f,g) • Somewhat simple syntax! – All of propositional logic – Tiny bit of predicate logic – Same basic structure as RDFS-- • Similar semantics, by translation or direct model theory • Still decidable – But, depending on the exact flavor and problem v. HARD • PSPACE to EXPTIME 10 Tuesday, 11 March 14

  11. ALC: Expressivity • Does great! (on our example) English Prop Logic Predicate Logic ALC Mammals are M → A ∀ x(M(x) → A(x)) M ⊑ A Animals Cats are Mammals C → M ∀ y(C(y) → M(y)) C ⊑ M Dogs are Mammals D → M ∀ y ∀ x(D(x) → M(x)) D ⊑ M Cats are not Dogs C → ¬D ∀ y(C(y) → ¬D(y)) C ⊑ ¬D Cats eat some dogs C → ED ∀ y(C(y) → C ⊑ ∃ eats.D ∃ x(eats(y,x) ∧ D(x)) Fluffy is a Cat. F → C C(f) C(f) 11 Tuesday, 11 March 14

  12. Computational Interlude • Do we have a hard constraint? – Polynominal? I.e., “tractable”? – Does this rule out ALC immediately? • Not necessarily! – Constants can matter – Worst case != Every case • Or even my case! • Key point – For a given input (or set of inputs) • we must terminate in reasonable time – for our context’s value of “reasonable” – Will this happen with ALC? 12 Tuesday, 11 March 14

  13. Exercise • On the linear y-axis chart: – Draw a line representing • A linear function (L) • A quadratic function (Q) • An exponential function (E) • On the log y-axis chart – Do the same! • Each of these represents the WWC of an algo – for a single problem! (they are named, L, Q, and E :)) – what do we know about the WWC of this problem? • Using different dots (xs vs. os vs +s, or different colors) – plot a set of inputs for each algo s.t. – we would prefer using E to Q and Q to L 13 Tuesday, 11 March 14

  14. Linear Y-Axis exponential (E) 2.7 x quadratic (Q) 0.8x 2 +20 linear (L) 1.3x+50 Each is preferable w.r.t. a certain input size range 14 Tuesday, 11 March 14

  15. Logarithmic Y-Axis exponential (E) now linear 1.3x+50 0.8x 2 +20 quadratic (Q) now looks almost linear 2.7 x linear (L) still linear 15 Tuesday, 11 March 14

  16. Robustness • Usability obviously is affected by computation time – Roughly, the more time to compute, the less usable • But often predictability is more important – Even with “hard” problems, • if the hardness is predictable, the user might be ok • predictability gives some user control • We say that the problem is predictable if – the time to solve the problem is “proportionate” to the size – very dependent on user knowledge! 16 Tuesday, 11 March 14

  17. Made Up Illustration 300000" 250000" 200000" WCC" 150000" Actual"Case" 100000" 50000" 0" 0" 100" 200" 300" 400" 500" 600" 17 Tuesday, 11 March 14

Recommend


More recommend