1 / 44

Logics for Data and Knowledge Representation

Logics for Data and Knowledge Representation. Modeling. Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese. Outline. Modeling Logical Modeling (formal modeling) Domain Language Interpretation Theory Model

mminto
Download Presentation

Logics for Data and Knowledge Representation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logics for Data and KnowledgeRepresentation Modeling Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

  2. Outline • Modeling • Logical Modeling (formal modeling) • Domain • Language • Interpretation • Theory • Model • How to use logical modeling • What is a logic? • Choosing the right logic and writing the theory • Reasoning services • Expressiveness • Expressiveness, Efficiency, Complexity • Decidability 2

  3. Modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Language L Theory T Data Knowledge World Mental Model Domain D Model M Meaning SEMANTIC GAP 3

  4. Modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • World: the phenomenon we want to describe • Domain: the abstract relevant elements in the real world • Mental Model: what we have in mind. It is the first abstraction of the world (subject to the semantic gap) • Language: the set of words and rules we use to build sentences used to express our mental model • Model: the formalization of the mental model, i.e. the set of true facts in the language, in agreement with the theory • Theory: the set of sentences (constraints) about the world expressed in the language that limit the possible models • NOTE: this does not necessarily need to be in formal semantics 4

  5. Example of informal Modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Mental Model Language L Domain D Theory T Model M World L: Informal description in NL D: {monkey, banana, tree} T: If the monkeyclimbs on the tree, he can get the banana M: The monkey actually climbs on the tree and gets the banana SEMANTIC GAP NOTE: a database can be seen as an informal model 5

  6. Logical Modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Language L Theory T Data Knowledge Interpretation Modeling Entailment World Mental Model ⊨ I Realization Domain D Model M Meaning SEMANTIC GAP NOTE: the key point is that in logical modeling we have formal semantics 6

  7. Logical Modeling Elements MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Domain: relevant objects • Logical Language: the set of formal words and rules we use to build complex sentences • Interpretation: the function that associates elements of the language to the elements in the domain • Model: the set of true facts in the language describing the mental model, in agreement with the theory • Theory / Knowledge Base (KB): data and knowledge • Truth-relation / logical entailment (⊨): deduction, reasoning, inference 7

  8. Example of formal (intentional) modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Mental Model Language L Domain D Theory T Model M World L = {Monkey, Climbs, GetBanana, , , } D= {T, F} T = { (Monkey Climbs) GetBanana} A possible model M: I(Monkey) = T I(Climbs) = T I(GetBanana) = T SEMANTIC GAP 8

  9. Fausto Mary Paul Jane Example: the LDKR class • The members of the LDKR class define a domain D • D is a finite set • Two “kinds” of the elements in D: Professor Student Both are specializations of Person Rui Sara Hugo Domain MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Domain (D): the chosen objects from the world • We will deal only with finite domains! • Question: what are we leaving out? 9

  10. Language MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Language (L) = a logical language • To each logical language we associate an alphabet of symbols Σ (sigma) • For instance, Σ may contain the logical symbols: • ∧ (and) • ∨ (or) • ¬ (not) • → (implication) • ∀ (for all, universal quantifier) • ∃ (exists, existential quantifier) • L has clear formation rules for formulas 10

  11. Logical Language (Syntax) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • The first step in setting up a logical language is to list the symbols • thealphabet of (formal) symbols Σ • formal symbol= a character, or group of characters taken from some alphabet (it is formal because we specify the meaning) • Symbols in Σ can be divided in: • descriptive(non-logical) • non-descriptive(logical) • NOTE: English can be restricted toa propositional language, ...but it is not logical (informal syntax) 11

  12. Logical language Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • The Language L for the LDKR class example with alphabet Σ • Logical symbols: ∧, ∨, ¬, → • Descriptive symbols: Person, Professor, Student 12

  13. Formal Syntax MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • The set of rules saying how to construct the sentences of the language from the alphabet of symbols (i.e. the syntax) is a grammar (i.e., is formal) • Example: ¬A, A ∧ B, A → B ¬Professor, Professor ∧ Student, Student → Person • Formal syntax is often called an abstract syntax, in contrast to the concrete syntax used, for instance in implementations. • Example: context-free grammars 13

  14. Fausto Intensional interpretation I(Professor) = T I(Student) = T I(Person) = T Extensional interpretation I(Professor) = {Fausto} I(Student) = {Mary, Paul, Jane, Rui, Sara, Hugo} I(Person) = {Fausto, Mary, Paul, Jane, Rui, Sara, Hugo} Mary Paul Jane Rui Sara Hugo Interpretation MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Interpretation (I) = a mapping of L into D • I must be effective (i.e., computable) 14

  15. Theory MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Theory T (also L-Theory) = set of facts of L • A fact defines a piece of knowledge (about D), namely something true • A theory is a way to put constraints on the intended models 15

  16. Theory MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • A finite theory T is called: • An ontology if it contains knowledge only (T-BOX) • A knowledge base (KB) if it contains knowledge (T-BOX) and data (A-BOX) • A database (DB) if it only contains data. • A DB + its schema is the simplest kind of knowledge base NOTE: Sometimes the terms Ontology and Knowledge Base are used interchangeably 16

  17. Theory Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS The set of (true) facts T over L Student → Person Professor → Person Student →¬ Professor Professor →¬ Student 17

  18. Model MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Model (M) = the abstract (in mathematical sense) representation of the intended truths via interpretation I of the language L • M is called L-model of D: M⊨T M satisfies T T holds in M Tis TRUE in M M yields T with T set of arbitrary complex formulas 18

  19. Model Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Intensional interpretation I(Professor) = T I(Student) = T I(Person) = T The I is a model for the theories below: M ⊨ {Person} M ⊨ {Professor ∨ Student} M ⊨ {Person, Professor ∨ Student, Student → Person} … 19

  20. Theory and Model MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • We have: M ⊨ T iff M ⊨ A, for each formula A in T • A model M of a theory T is any interpretation function that satisfies all the facts in T • There can be many models satisfying the theory T. They are a subset of all possible interpretation functions over L. • In case there are no models for T, we say that the theory T is unsatisfiable. 20

  21. Theory and Model Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS T Student → Person Professor → Person Student →¬ Professor Professor →¬ Student M I(Professor) = {Fausto} I(Student) = {Mary, Paul, Jane, Rui, Sara, Hugo} I(Person) = {Fausto, Mary, Paul, Jane, Rui, Sara, Hugo} M is a model for T (M ⊨ T ) M’ I(Professor) = {Fausto, Mary} I(Student) = {Mary, Paul, Jane, Rui, Sara, Hugo} I(Person) = {Fausto, Mary, Paul, Jane, Rui, Sara, Hugo} M’ is not, because Mary is both a student and a professor 21

  22. Same theory, different models (MODEL#1) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} MODEL#1 Informal Semantics: “If the monkey is low and the banana is high in position, then the monkey cannot get the banana. “ Formal Semantics: I(MonkeyLow) = T I(BananaHigh) = T I(MonkeyClimbBox) = F I(MonkeyGetBanana) = F

  23. Same theory, different models (MODEL#2) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} MODEL#2 Informal Semantics: “If the monkey climbs onto the box, he becomes high in position (not low anymore) and can get the banana.” Formal Semantics: I(MonkeyLow) = F I(BananaHigh) = T I(MonkeyClimbBox) = T I(MonkeyGetBanana) = T

  24. Same theory, different models (MODEL#3) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} MODEL#3 Informal Semantics: “If the monkey is low and the banana is also low, then the monkey can get the banana. “ Formal Semantics: I(MonkeyLow) = T I(BananaHigh) = F I(MonkeyClimbBox) = F I(MonkeyGetBanana) = T

  25. How to use logical modeling MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: EXPRESSIVENESS • Define a logic • most often by reseachers • once for all (not a trivial task!) • Choose the right logic for the problem • Given a problem the computer scientist must choose the right logic, most often one of the many available • Write the theory • The computer scientist writes a theory T • Use reasoning services • The computer scientist uses reasoning services to solve her programs 25

  26. What is a Logic? MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Logic = <L, I, ⊨ >where LLanguage Set of phrases/sentences/formulas (alphabet + formation rules) IInterpretation function What phrases mean in a chosen domain D with I: L -> D ⊨Satisfiability relation (over M) How to compute the fact that a formula A is TRUE in M, notationally M ⊨ A A ⊨ B in M iff M ⊨ A implies M ⊨ B 26

  27. Choose the right logic for the problem Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Problem: the LDKR class Specification: “In the LDKR class Fausto is the professor. There are 6 students. They are Mary, Paul, Jane, Rui, Hugo and Sara”. Formalization: • We want to represent both classes of objects (Professor, Student) and individuals (Mary, Paul…) • Choose a logic that allows for them, e.g. ClassL with Individuals L = {Professor, Student , ∧, ∨, ¬, →} D = {Fausto, Mary, Paul, Jane, Rui, Sara, Hugo} 27

  28. Define the theory for the problem Fausto Mary Paul Jane Rui Sara Hugo MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {Professor, Student , ∧, ∨, ¬, →} D = {Fausto, Mary, Paul, Jane, Rui, Sara, Hugo} In the theory we want to model the fact that the set of professors is always disjoint from the set of students… T = {Student → ¬ Professor; Professor → ¬ Student} M I(Professor) = {Fausto} I(Student) = {Mary, Paul, Jane, Rui, Sara, Hugo} M ⊨T Then we can use reasoning services to handle our problem 28

  29. Yes, M ⊨ ψ EVAL ψ , M No, M ⊭ψ Reasoning Services: EVAL MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Model Checking (EVAL) Is a sentence ψ true in model M? Check M ⊨ ψ

  30. EVAL MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} Evaluate ψ1 and ψ2 in M ψ1=  MonkeyClimbBox is true in M (YES) ψ2= MonkeyGetBanana is false in M (NO) M I(MonkeyLow) = T I(BananaHigh) = T I(MonkeyClimbBox) = F I(MonkeyGetBanana) = F 30

  31. Reasoning Services: SAT M SAT ψ No MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Satisfiability (SAT) Is there a model M where ψ is true? find M such that M ⊨ ψ

  32. SAT MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} SAT is a search problem (find a model M) I(MonkeyLow) = F I(BananaHigh) = T I(MonkeyClimbBox) = T I(MonkeyGetBanana) = T ψ = MonkeyGetBanana Is there a model M where ψ is true? (YES, the model on the left) 32

  33. Reasoning Services: VAL Yes VAL ψ No MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Validity (VAL) Is ψ true according to all possible models? Check whether for all M, M ⊨ ψ

  34. VAL MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} VAL is a search problem (check ψ in all M) NOTE: It is enough to find a counterexample to conclude for non validity I(MonkeyLow) = F I(BananaHigh) = T I(MonkeyClimbBox) = T I(MonkeyGetBanana) = F ψ = MonkeyLow  MonkeyGetBanana Is ψ true according to all possible model M? (No, the monkey can be high without getting the banana) 34

  35. Reasoning Services: ENT Yes, ψ1⊨ψ2 ENT ψ1, ψ2, M No MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS Entailment (ENT) ψ1 true in M (all models) implies ψ2 true in M (all models) check A ⊨ B in M by checking M ⊨ A implies M ⊨ B

  36. ENT MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS L = {MonkeyLow, BananaHigh, MonkeyClimbBox, MonkeyGetBanana, , , } T = { (MonkeyLow  BananaHigh  MonkeyGetBanana)  (MonkeyLow  MonkeyClimbBox)  ( MonkeyLow  BananaHigh  MonkeyGetBanana)} ψ1 = MonkeyClimbBox ψ2 =  MonkeyLow ψ1 true in M (all models) implies ψ2 is true in M (all models).(Yes) NOTE: ψ1entailsψ2 in all models 36

  37. An Important Trade-Off MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • There is a trade-off between: • expressive power (expressiveness) and • computational efficiency provided by a (logical) language • This trade-off is a measure of the tension between specification and automation • To use logic for modeling, the modeler must find the right trade off between expressiveness in the language for more tractable forms of reasoning services. 37

  38. Examples of Expressiveness MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS 38

  39. Efficiency VS. Complexity MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • Efficiency • Performing in the best possible manner; satisfactory and economical to use [Webster] • In modeling it applies toreasoning • We use the more specific termcomputational complexity(time, space,...) • Complexity (or computational complexity) of reasoning • It is the difficulty to compute a reasoning task expressed by using a logic • With degrees of expressiveness, we may classify the logical languages according to some “degrees of complexity” 39

  40. Degrees of Complexity MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • The more you specify, the more cost grows COST & PRECISION OF THE SPECIFICATION Natural Language Diagram Logics FORMALITY 40

  41. When is the use of logics appropriate? MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • When logic is used we always pay a performance price • We therefore use it when it is cost-effective • To prove correctness (offline use) • To draw conclusions (online use) 41

  42. Examples of offline use (specification) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • For data and knowledge representation • In safety-critical applications • Trains • Planes • … • In security critical applications • bank transactions • … 42

  43. Examples of online use (reasoning) Web 1.0 Web 2.0 LET PEOPLE INTEROPERATE (informal semantics) Web 3.0 LET PROGRAMS INTEROPERATE (formal semantics) MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS • To let programs interoperate 43

  44. The existence of an effective method to determine the validity of formulas in a logical language A logic is decidable if there is an effective method to determine whether arbitrary formulas are included in a theory A decisionprocedure is an algorithm that, given a decision problem, terminates with the correct yes/no answer. In this course we focus on logics that are expressive enough to model real problems but are still decidable Decidability MODELING :: LOGICAL MODELING :: HOW TO USE LOGICAL MODELING :: REASONING SERVICES :: EXPRESSIVENESS 44

More Related