1 / 44

Logics for Data and Knowledge Representation

Logics for Data and Knowledge Representation. Languages for Data Representation. Outline. Model Language Natural Language ER UML Logic Using Languages Specification & Automation Services Using logics. Model. A model is an abstraction of a part of the world. Outline. Model

camden
Télécharger la présentation

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 Knowledge Representation Languages for Data Representation First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  2. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  3. Model A model is an abstraction of a part of the world First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  4. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  5. Language • Language : A (usually infinite) set of expressions (phrases), and rules to form expressions, with a notion of “correct phrase” (a phrase member of a language). Often an algorithm for checking correctness • A tool for codifying the (mental) model (what we have in mind) • Expressions • Meaning Syntax Semantics Boss First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  6. Formal vs. Informal languages • Recall the composition of a language Language = Syntax + Semantics • Formal syntax • Infinite/ finite (always recognizable) alphabet • Finite set of formal constructors and building rules for phrase construction • Algorithm for correctness checking (a phrase in a language) • Formal Semantics: the relationship between syntactic constructs and the elements of an universe of meanings is a (mathematical) function • Informal syntax/ semantics: the opposite of formal First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  7. Levels of Formalization (update) Both Syntax and Semantics can be formal or informal. NOTE: formal Semantics only with formal syntax. ProgrammingLanguages NLs Diagrams Logics 0 1 EnglishItalianRussianHindi... ERUML... SQL... PLFOLDL... First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 7

  8. Natural Language • Monkey-Bananas (MB) by McCarthy, 1969 “There is a monkey in a laboratory with some bananas hanging out of reach from the ceiling. A box is available that will enable the monkey to reach the bananas if he climbs on it. The monkey and box have height Low, but if the monkey climbs onto the box he will have height High, the same as the bananas. [...]” • Question: How shall the monkey reach the bananas? First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  9. E-R Schemas • Data representation models for databases design under the Entity-Relationship Model [Chen 1976]. • It provides basic “alphabet “ (constructs for schemas: • Entity (or Class) • Relation (or Association) • Attribute (simple and composed) • … + arrows and various notation Entity Relation Attribute First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 9

  10. The E-R Constructs (1) • Entity: class of objects with same properties. These are individuals (objects) • Relation: relations among entities. • Attribute: properties of entities Bananas Climb Height First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 10

  11. The E-R Constructs (2) • Cardinality of Relation: min/max number of objects in an entity that may be related by a relation to an object in a different entity. • Cardinality of Attribute: range of values of an attribute of an entity or a relation. • Entity Identificator: Id which provides unique identification of an entity. 0..1 0..n Climb Monkeys Boxes Height Bananas First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 11

  12. The E-R Constructs (3) • Generalization: logical relationship between an entity E (father entity ) and a set of entities E1...Ei...En (child entities). • For each i, E generalizes Ei and Ei specializes E. Ei is a subset of E (IS-A relation). Properties of E are also of Ei (inheritance), but not necessarily vice versa. E E1 Ei En There are other representations for ER diagrams First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 12

  13. Example of Monkey and Bananas in ER Height Get Bananas Climb Monkeys Boxes Height Height The squares represent monkey, bananas and box. The attribute “height” may has either value of “high” or “low”. The diamonds “Climb” and “Get” are binary relations First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  14. UML • Unified Modeling Language UML. • Representation language to model data, operations, processes, architectures. • From software engineering under the paradigm of object-oriented programming. • UML class diagrams useful in database designas an “alternative” to the E-R schemas. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 14

  15. UML Class Diagrams 1 0..* • Basic components of an UML class diagram • Class • Association. • Classes and associations correspond to entities and relations in the E-R schemas. • The elements in a class are called instances. • The world here is a set of instances. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang 15

  16. Example of Monkey and Bananas in UML Get 0..* 1 1 Climb 0..1 “A monkey can climb onto 0 to 1 box. A monkey can get 0 or more bananas.” First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  17. Logic: eg. Propositional Logic • Language L={A,,,,} • Example MonkeyLow, BananaHigh, MonkeyLow  BananaHigh  MonkeyGetBanana MonkeyLow  MonkeyClimbBox  MonkeyHigh MonkeyHigh  BananaHigh  MonkeyGetBanana • Semantics: “Originally, the monkey is low and bananas are high in position. The monkey cannot get the bananas. If the monkey climbs onto the box, it becomes high in position and can get the bananas.” First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  18. Formal Model A (formal) model is an abstraction of a part of the world A model : a Triple= <D,A,R> • D= domain (a is in A): set of objects of interest • A= set of attributes (a has attribute P): subsets of D • R= set of relations (a is in relation with b): subset of Cartesian products A×B, with A,B subsets of D, r=<a,b> is a pair of objects. Note: we can easily extend to n-ary relations First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  19. Formal semantics (example) • Domain {monkey1, banana3, box11, leaf0} • Attribute High={banana3},Low={monkey1, box11} • Relation Climb={<monkey1, box11>} Get={<monkey1, banana3>, <monkey,1 leaf0>} First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  20. Formal semantics )(example) • Domain {True, False} (the same as: {1, 0} ) • Attribute HighBanana=1, LowMonkey=0 • Relation ClimbLowBox= 1 First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  21. Formal semantics for ER and UML Get Height • Domain {monkey, banana, box} • Attribute High={banana},Low={monkey, box} • Relation Climb= … Get= … Bananas Get 0..* Climb 1 Monkeys Boxes Height Height 1 Climb 0..1 Same First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  22. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  23. Uses of Data Representation Languages • The two purposes in modeling: Specification and Automation (Automated Reasoning) • Specification: representation of the problem at the proper level of abstraction • Allow informal/formal syntaxandinformal/formal semantics. • Automated Reasoning: computing consequences or properties of the chosen specifications. • Requires formal semantics. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  24. Why Natural Languages? • Used as informalspecification • often used at the very beginning of problem solving, when we need a direct, “flexible”, well-understood language and the problem is still largely unclear • semantics is informal, largely ambiguous • Pragmatically inefficient for automation First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  25. Why Diagrams? • Used to provide more structured/organized specification than natural languages • Informal/formal syntax (depends on the kind of diagram) • Informalsemantics • Largely structured and organized; usually used better in representation with unified languages. • When things are non-trivial • More precisionExample: NL to UML • Pragmatically inefficient for automation First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  26. Why Logic? • Used as formalspecification languages • formal syntax, formal semantics • well-understood • Used as (formal) languages for automation • “reasoningservices” (see the next slides) • Pragmatically efficient for automation exploiting the explicitly codified semantics. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  27. Informal and Formal specification tradeoff • The more you specify, the more cost grows (e.g., man power) Cost & Precision of specification Formalization Natural Language Logics Diagram First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  28. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  29. Logics • A logic is a representation language with • a formal syntax; • a formal semantics. … any language (eg., using mathematical notation, textual, graphical, …) • As formal languages, logics are suitable for representing (specification) of and reasoning (automation) about data and knowledge. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  30. Logics for Specification • Logic as a formal language: is good for the specification (representation) of knowledge. • it provides a formal syntax. • Starting from a precise syntax logic provides a formal (i.e., unambiguous) semantics. • Logic as a formal semantics: is good for specification of declarative data and knowledge (as different from programs). The meaning of sentences is declaratively defined, i.e. with logic we describe what holds without caring about how it can be computed. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  31. Logics for Reasoning • Logics provides a notion of deduction (axioms, deductive machinery, theorem) that can be used to implement “reasoners” which allow to infer conclusions from a given knowledge base (i.e, a set of “premises”, premises can be axioms or theorems). • From implicit knowledge to explicit knowledge. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  32. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  33. Logics for Automated Reasoning • Recall the MB story… MonkeyHigh  BananaHigh  MonkeyGetBanana MonkeyLow  BoxLow  MonkeyCanClimbBox MonkeyCanClimbBox  MonkeyClimbBox  MonkeyHigh MonkeyLow  MonkeyClimbBox  BananaHigh  MonkeyGetBanana First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  34. Tools for Automated Reasoning • SAT • Description Logic reasoners • LCF (Robin Milner @ Edinburgh & Stanford) • Prover9 (William McCune) • … many many others …. • To list updated automated reasoning tools First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  35. Reasoning Services (1) • The basic reasoningtasks (or “services”) we would like to compute are the following: • Model Checking (EVAL): Is a sentence ψ true in model M? • Satisfiability (SAT): Is there a model M where ψ is true? • Validity(VAL): Is ψ true according to all possible models M? • Entailment(ENT): ψ1 true in M (all models) implies ψ2 is true in M (all models). First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  36. EVAL • Is a sentence ψ true according to a model M? Given that ∆={T,F},and MonkeyHigh  BananaHigh  MonkeyGetBanana MonkeyLow  BoxLow  MonkeyCanClimbBox MonkeyCanClimbBox  MonkeyClimbBox  MonkeyHigh MonkeyLow  MonkeyClimbBox  BananaHigh  MonkeyGetBanana And a model M MonkeyLow=T MonkeyClimbBox=F BananaHigh=T BoxLow=T • Evaluate whether • ψ1= MonkeyCanClimbBox is true • ψ2= MonkeyGetBanana is false. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  37. SAT • Is there existing model M that is ψ true? Given that ∆={T,F},ψ = MonkeyGetBanana MonkeyHigh  BananaHigh  MonkeyGetBanana MonkeyLow  BoxLow  MonkeyCanClimbBox MonkeyCanClimbBox  MonkeyClimbBox  MonkeyHigh MonkeyLow  MonkeyClimbBox  BananaHigh  MonkeyGetBanana Look for a model M MonkeyLow=T MonkeyClimbBox=T BananaHigh=T BoxLow=T Where ψ = MonkeyGetBanana is true. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  38. VAL • Is a sentence ψ true according to every possible model M? Given a theory as MonkeyHigh  BananaHigh  MonkeyGetBanana MonkeyLow  BoxLow  MonkeyCanClimbBox MonkeyCanClimbBox  MonkeyClimbBox  MonkeyHigh MonkeyLow  MonkeyClimbBox  BananaHigh  MonkeyGetBanana ψ1= MonkeyGetBanana is true for the model in the previous slide; First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  39. ENT Given a theory as MonkeyHigh  BananaHigh  MonkeyGetBanana MonkeyLow  BoxLow  MonkeyCanClimbBox MonkeyCanClimbBox  MonkeyClimbBox  MonkeyHigh MonkeyLow  MonkeyClimbBox  BananaHigh  MonkeyGetBanana • ψ1= BoxLow  MonkeyClimbBox • ψ2= MonkeyGetBanana • We have ψ1entails ψ2. First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  40. Reasoning Services (2) • Other services: consistency subsumption, instance checking, equivalence, concept coherence, ... • NB: not all reasoning services are provided by a single logic (e.g., instance checking). First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  41. Outline • Model • Language • Natural Language • ER • UML • Logic • Using Languages • Specification & Automation • Services • Using logics First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  42. What does a logic allow to do? • To specify the knowledge formally • To derive new knowledge automatically • Must be efficient First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  43. The thread of the logics (substitute) • Syllogism and Class? • PL • FOL • MLs,DefL,DLs • OWL • CxL • C-OWL Syllogism Syllogism Classification FOL PL MLs Definition L??? DLs OWL We will see all these in this course CxL C-OWL First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

  44. E-R Semantics (Exercise) • Complete the definition of the formal, set-theoretic semantics for the E-R schema given in the foregoing example. • Represent the formal semantics of the previous slide informally by using natural language (English). First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia and Rui Zhang

More Related