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

more on computational issues comp34512
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

More on Computational Issues COMP34512

Rafael Gonçalves Bijan Parsia bparsia@cs.man.ac.uk

Tuesday, 11 March 14

slide-2
SLIDE 2

Tuning our Logic

  • Both Prop & Pred Logic had issues

– Even for our simple use case!

  • We would like the formalism to be

– Representationally adequate

  • (Propositional fails)

– Computationally reasonable

  • (Both have issues)

– Usable (cognitively adequate)

  • Predicate logic has too much choice
  • Propositional logic has “wrong expressivity”

– So we are forced into hacky workarounds

  • Proposal: RDFS--

– Tuned for expressing terminologies

2

Expressivity (Representational Adequacy) Usability (Weak Cognitive Adequacy vs. Cognitive Complexity) Computability (vs. Computational and Implementational Complexity)

More Expressivity hurt Usability Less Expressivity hurt Usability (in different ways)

Tuesday, 11 March 14

slide-3
SLIDE 3

RDFS--: Syntax

  • 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

Individual (f) ::= [a-z]+ Class (A) ::= [A-Z][a-zA-Z]* (in camel case) TBoxAxiom (A1, A2) :: = A1 ⊑ A2 | A1 ≡ A2 ABoxAxiom (A1,f) :: = f:A1 | A1(f) A1 SubClassOf: A2 | A1 EquivalentTo: A2 | f Types: A1

Tuesday, 11 March 14

slide-4
SLIDE 4

RDFS--: Semantics

  • Two possible approaches

– Direct Model Theory (an interpretation function) – By Translation (a translation function)

4

Syntax Translation to FOL Interpretation (assuming Δ) fluffy fluffy fluffyI ∈ Δ Cat Cat/1 i.e., Cat(x) CatI ⊆ Δ Cat(fluffy) fluffy:Cat Cat(fluffy) fluffyI ∈ CatI Cat ⊑ Mammal ∀x(Cat(x) → Mammal(x)) CatI ⊆ MammalI Animal ≡ Animalia ∀x(Animal(x) ↔ Animalia(x)) AnimalI = AnimaliaI

Tuesday, 11 March 14

slide-5
SLIDE 5

RDFS--: Semantics

  • Model theory is simpler for the simpler language!

5

RFDS-- RFDS-- Interpretation FOL FOL Interpretation Cat(fluffy) fluffy:Cat True, since fluffyI ∈ CatI Cat(fluffy) True, since fluffyI ∈ CatI Cat ⊑ Mammal True, since CatI ⊆ MammalI ∀x(Cat(x) → Mammal(x)) True, since every possible σ is such that if σ(C, x) is True then σ(M, x) is also True I1: Δ = {1,2,3...} CatI = {1,4,5} MammalI = {1,2,3,4,5} fluffyI = 5

Exactly the same Equivalent

Tuesday, 11 March 14

slide-6
SLIDE 6

RDFS--: Expressivity

  • Can captures some stuff better than propositional!

6

English Prop Logic Predicate Logic A Term Logic (RDFS--) Mammals are Animals Mf → Af Ms → As ∀x(M(x) → A(x)) M ⊑ A Cats are Mammals Cf → Mf Cs → Ms ∀y(C(y) → M(y)) C ⊑ M Dogs are Mammals D → M ∀y∀x(D(x) → M(x)) D ⊑ M Fluffy is a Cat Cf C(f) C(f) Sparkles is a Cat Cs C(s) C(s)

No need to hack names and multiply axioms

Tuesday, 11 March 14

slide-7
SLIDE 7

English Prop Logic Predicate Logic RDFS-- Mammals are Animals M → A ∀x(M(x) → A(x)) M ⊑ A 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) → ∃x(eats(y,x) ∧ D(x)) C ⊑ ED English Prop Logic Predicate Logic RDFS-- Mammals are Animals M → A ∀x(M(x) → A(x)) M ⊑ A 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) → ∃x(eats(y,x) ∧ D(x)) C ⊑ ED

RDFS--: Expressivity

  • Does as bad or worse in other cases

7

Tuesday, 11 March 14

slide-8
SLIDE 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)

  • Find a (directed) path between C and D
  • Only tricky bit is cycle detection

– Not that tricky!

  • Polynomial (what’s a tighter bound?)

– Instantiation (f Types: C)

  • Same! Just hang f off its asserted type node

– Equivalence (C EquivalentTo: D)

  • Second kind of edge and/or find a cycle

8

C D C1 C2 C3 C4

Tuesday, 11 March 14

slide-9
SLIDE 9

RDFS--: Cognitively?

  • Easy to learn and use and analyse
  • Severe expressivity limitations a PITA

9

English Prop Logic Predicate Logic RDFS-- Mammals are Animals M → A ∀x(M(x) → A(x)) M ⊑ A 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) → ∃x(eats(y,x) → D(x)) C ⊑ ED

Tuesday, 11 March 14

slide-10
SLIDE 10

ALC: Syntax

  • 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

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)

Tuesday, 11 March 14

slide-11
SLIDE 11

ALC: Expressivity

  • Does great! (on our example)

11

English Prop Logic Predicate Logic ALC Mammals are Animals M → A ∀x(M(x) → A(x)) M ⊑ A 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) → ∃x(eats(y,x) ∧ D(x)) C ⊑ ∃eats.D Fluffy is a Cat. F → C C(f) C(f)

Tuesday, 11 March 14

slide-12
SLIDE 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

slide-13
SLIDE 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

slide-14
SLIDE 14

Linear Y-Axis

14

2.7x 0.8x2+20 1.3x+50 exponential (E) quadratic (Q) linear (L)

Each is preferable w.r.t. a certain input size range

Tuesday, 11 March 14

slide-15
SLIDE 15

Logarithmic Y-Axis

15

2.7x 0.8x2+20 1.3x+50 exponential (E) now linear quadratic (Q) now looks almost linear linear (L) still linear

Tuesday, 11 March 14

slide-16
SLIDE 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

slide-17
SLIDE 17

Made Up Illustration

17

0" 50000" 100000" 150000" 200000" 250000" 300000" 0" 100" 200" 300" 400" 500" 600" WCC" Actual"Case"

Tuesday, 11 March 14